I used to work with Android Studio bundle 162.3871768. It was working fine. I just upgraded to bundle 201.6858069 and this is where all the mess started. Now I can't even place views in a layout! The layout itself is grayed out, and when I drag a view onto the layout nothing happens at all. Besides that, there is a warning message reading:
Replace the tag with FragmentContainerView
I just created a brand new navigation drawer app. Here is a screenshot:
And this is the code:
How can I fix this mess?
Edit: after following the warning message and replacing the fragment
tag with androidx.fragment.app.FragmentContainerView
the warning is gone, but I still can't place any views in the layout.
Edit: after running a build I noticed so many Java errors (cannot resolve symbol ...) which you can see in the below picture:
There are also many errors in the console which seem to be telling that some fetch attempts failed:
Execution failed for task ':app:checkDebugAarMetadata'.
- Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
- Could not find androidx.appcompat:appcompat:1.2.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/1.2.0/appcompat-1.2.0.pom
- https://jcenter.bintray.com/androidx/appcompat/appcompat/1.2.0/appcompat-1.2.0.pom
Required by:
project :app
- Could not find com.google.android.material:material:1.2.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/google/android/material/material/1.2.1/material-1.2.1.pom
- https://jcenter.bintray.com/com/google/android/material/material/1.2.1/material-1.2.1.pom
Required by:
project :app
- Could not find com.google.android.material:material:1.2.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/google/android/material/material/1.2.1/material-1.2.1.pom
- https://jcenter.bintray.com/com/google/android/material/material/1.2.1/material-1.2.1.pom
Required by:
project :app > androidx.navigation:navigation-ui:2.2.2
- Could not find androidx.transition:transition:1.0.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/androidx/transition/transition/1.0.1/transition-1.0.1.pom
- https://jcenter.bintray.com/androidx/transition/transition/1.0.1/transition-1.0.1.pom
Required by:
project :app > androidx.navigation:navigation-ui:2.2.2
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Edit: It seemed like an IP issue. Now the fetches have completed but the Java errors are still there. I ran a successful build but the app crashes when launched. Furthermore I noticed something: this issue only occurs if there is no internet connection while creating the project. This suggests that it has to download some files before creating the project. How can this be tackled? How can I create projects while I am offline?