After Update android studio dolphin my old projects xml preview not showing views. Is anyone facing same issue? And have done solution then please share it here.
It's run perfectly fine but preview not working.
What I did tried?
File -> Invalidate Cashes / Restart
Delete build , idea , gradle folder
Restart PC and android studio
but none of that solved my problem.
In my case, I have upgraded the project AGP (Android Gradle Plugin) and then restart the android studio.
Problem Solved.
I'm suffering from same issue/bug. What I did so far?
Attempt 1
File -> Sync Project with gradle files
File -> Invalid catch and Restart.
Delete build folder idea and .gradle folder.
Restart Android studio and restarted my pc as well.
This will do solve in one of the my project which is only 5 screen project. But not solved in my other old projects which are more than 5 year old.
Attempt 2
Tried all step from attempt 1 Also tried what siregar2103 answered
File -> Repair IDE but still have same problem ,But Repair IDE did solve my other project issue/bug.
Attempt 3
All from Attempt 1 and 2 but not solve in my main project so I decided to upgrade my years old project to latest one.
I did upgrade my Gradle from 4.1.3 to 7.3.0
Update all dependency to latest one but I face many error while doing that.
Hilt error and other errors too. Which I'm going to mention below.
For Hilt I did removed all old Hilt related library and and below
kapt "com.google.dagger:dagger-compiler:2.42"
kapt "com.google.dagger:hilt-android-compiler:2.43.2"
implementation "com.google.dagger:dagger:2.42"
implementation "com.google.dagger:hilt-android:2.43.2"
implementation 'androidx.hilt:hilt-work:1.0.0'
kapt "androidx.hilt:hilt-compiler:1.0.0"
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation "androidx.navigation:navigation-compose:2.5.1"
In build.gradle file (not .app level)
id 'com.google.dagger.hilt.android' version '2.43.2' apply false
Important note: I did add implementation "androidx.navigation:navigation-compose:2.5.1" dependency because I got
java.lang.IllegalArgumentException: CreationExtras must have a value
by SAVED_STATE_REGISTRY_OWNER_KEY error in runtime.
Other Error which I faced is
Exception is:
com.intellij.openapi.externalSystem.model.ExternalSystemException:
lateinit property _buildFeatureValues has not been initialized
For this I did build gradle using command line and it give me full error which I didn't get when I directly build don't know why? But It's through error related flat dir and aar file so I did removed flat dir code and change aar file implementation code now It's started to build and my app started to install.
Now still some of my file not rendering and that because of I'm using custom attr from style so I'm trying to figuring out why it's happening and I'll update this answer when I find solution for that.
So using above my 60% xml files preview start showing in my old projects. For 40% screen I have to change my default theme to custom theme in preview of xml so it can start rendering.
Repair IDE
Upgrade your code to latest Android Gradle Plugin
This 2 step should solve your problem. And build using command line for more error related details.
Have you try to using Repair IDE? It works for me
I ran into a similar issue when upgrading to Dolphin. I was able to solve this by changing the preview's theme from App.Starting [default] to my app's theme.
Try to update the gradle and sync files. It work for me.
The XML file in your project may contain an error. The reason may be a font issue or a file not linking correctly with your XML layout.
This is for your reference on how to find errors.
Hope you find it useful.
Check what Layout Inspectors you have enabled in Android Studio and try to let only the API 29-30 inspector active.
In my case if in xml custom views have used that my preview screen not show views if I remove or comment custom views in xml layout after that the preview screen show other view perfectly
I know removing custom layouts not solution.
for solve this issue I do following steps
First I just update Gradle plugin version to 7.3.0 from setting project structure (No working)
after that I also update com.google.gms:google-services version to 4.3.14
now every things work fine.
In my case, I have upgraded Android Gradle Plugin when update is popUp and then restart the android studio.
My Problem Solved.
I am looking as well for a soluition till now.
From what i see, it has something to do with
AGP or Cardview (Layouts). Many code snipeets relate to this issue.
I am trying to update the AGP version, but it seems, that the enveronmet is more broken than that.
I get as well an empty Field for the gradle version and plugin under settings.
For anyone can not fix this issue, i'm just need to update gradle version and buildtool
buildSrc/src/main/kotlin/Dependencies.kt
object BuildPlugins {
object Versions {
const val buildToolVersion = "7.3.0" //lower version seem not work
and change to 7.4 in gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
I am new to maptiler mapbox development , I download app from maptiler. now I am trying to build that app in to my android studio. but there are some errors. I am following it's ReadMe file . I put dependency MapboxGLAndroidSDK.aar in to lib and also apply mapbox public token and secret token at appropriate place as per ReadMe steps . but still I can't run app due to following error:
NoSuchMethodError: No virtual Method setSkuId(Ljava/lang/string;)V in class Lcom/mapbox/android/telemetry/AppUserTurnstile; or its super class
these are my mapbox dependencies:
com.mapbox.mapboxsdk:mapbox-core:4.3.0
com.mapbox.mapboxsdk:mapbox-services:4.3.0
com.mapbox.mapboxsdk:mapbox-geojson:4.3.0
com.mapbox.mapboxsdk:mapbox-android-telemetry:4.3.0
com.mapbox.mapboxsdk:mapbox-android-gestures:0.4.0
these all are prebuild dependencies now I am working with offline mode so if I have to apply more dependency I have to Downoload jar/aar for it. please suggest me some way to solve these error and successful run .Thanks
finally I found a way to run my project.
the conclusion is Mapbox updated it all library and split some. So I have to download all (.aar)Libraries from Maven repository and add it to my projects as library dependency to resolve issue regarding Mapbox library.
recently I updated following library with latest version .aar file:
mapbox-android-sdk
mapbox-sdk-services
mapbox-sdk-turf
mapbox-android-telemetry
mapbox-sdk-geojson
mapbox-android-core
mapbox-android-gestures
If you have internet connectivity you can directly upgrade all the library.
otherwise you can download from this link
I am trying to integrate admob into my app but I keep getting this strange error that says
Duplicate class com.google.android.gms.common.api.internal.zza found
in modules jetified-play-services-base-11.6.2-runtime.jar
(com.google.android"attached is my build.gradle file.
(com.google.android.gms:play-services-base:11.6.2"
The error usually appears when one of the modules that you include in your project has inside another library that you are including in your main project as well. My recommendation is to first update the version of the libraries that are highlighted. Then try to remove this and check if everything works:
implementation 'com.google.android.gms:play-services-ads:18.3.0'
Or if you have access to the gradle file of the module remove 'play-services-ads' there
I am facing a very weird problem . In my project I am retrofit as a network library . SO for JSON serialisation and deserialisation I am using gson-converter library "com.squareup.retrofit2:converter-gson:$rootProject.retrofitVersion"
// rootProject.retrofitVersion = '2.3.0'
after sync I got this error which failed gradle to build the app
Error:Execution failed for task ':app:preMockDebugAndroidTestBuild'.
Conflict with dependency 'com.google.code.gson:gson' in project ':app'. Resolved versions for app (2.7) and test app (2.8.0) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.
I have used retrofit and gson many times in past but never face this sort of error . Please some one help me . I have searched a lot , non of the solution works
I have recently faced this same issue with retrofit gson convert factory .
see this issue . I didn't get the solution yet though . I have searched a lot just like you . Luckily I have applied a ghostbuster solution , I repeat this is a ghostbuster solution . I have no acceptable explanation for this .
what I did I add latest total gson library as a dependency
like this implementation 'com.google.code.gson:gson:2.8.0' (version may differ this one was the time of my writing) and suddenly gradle build was successful .
please let me know if it works for you too
N.B please before down voting add a comment , I made myself clear this one works for me . Still I have no Idea what was wrong
update version with:
implementation 'com.google.code.gson:gson:2.8.0'
Unable to push android library to maven. It is giving following error.
"Could not edit /../../pom.xml file"....
caused by InvalidUserDataException: The configuration to scope mapping is not unique. Please help.
The problem is with version and scope mapping while updating your pom file.If multiple mappings are found for same dependencies exception is thrown.
You can see it here for unique property mapping in spring.
For Android, you must use an updated version of standard maven plugin Android Maven Plugin.
This might help you Repository link and integration details.
I was able to resolve the InvalidUserDataException by using as of today the latest version of the multidex library: androidx.multidex:multidex:2.0.1.
I verified that the error occurs when I use androidx.multidex:multidex:2.0.0.
I also verified that the error does not occur when I keep using com.android.support:multidex:1.0.3 in combination with android.enableJetifier=true.