since I've updated to Android Studio 3.1, my project is not running anymore. I have searched for a solution all over the internet with no positive results.
Here's the error I get in the Logcat:
--------- beginning of crash
04-13 13:33:55.466 12720-12720/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: woopy.domain.com.woopy, PID: 12720
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbq;
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source:2)
at android.app.ActivityThread.installProvider(ActivityThread.java:6239)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbq" on path: DexPathList[[zip file "/data/app/woopy.domain.com.woopy-KqNv1gE1ZomaesHCq33DJw==/base.apk"],nativeLibraryDirectories=[/data/app/woopy.domain.com.woopy-KqNv1gE1ZomaesHCq33DJw==/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source:2)
at android.app.ActivityThread.installProvider(ActivityThread.java:6239)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
04-13 13:33:55.567 12720-12727/? I/zygote: Debugger is no longer active
Here's my build.gradle (Module:app) file:
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "woopy.domain.com.woopy"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Enabling multidex support.
multiDexEnabled true
aaptOptions {
cruncherEnabled = false
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
implementation 'com.parse:parse-android:+'
implementation 'com.parse.bolts:bolts-android:1.+'
//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services-maps:+'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.google.android.gms:play-services:+'
implementation 'com.google.android.gms:play-services-ads:+'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.facebook.android:facebook-android-sdk:4.+'
implementation 'com.parse:parsefacebookutils-v4-android:1.10.3#aar'
implementation 'com.commit451:PhotoView:1.2.4'
}
And here's my build.gradle (Project: appname):
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The Build is successful, but the app crashes at startup.
EDIT:
It doesn't build successful anymore now, it throws this absolutely weird error in the Build message console:
AGPBI: {"kind":"error","text":"Program type already present: com.google.android.gms.location.places.zza","sources":[{}],"tool":"D8"}
:app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'
.
Try adding this dependency to your gradle file:
implementation 'com.android.support:multidex:1.0.3'
Also you should use the same versions for the support and play services libraries. And you should avoid using "+" for latest version. Change this part:
implementation 'com.google.android.gms:play-services-maps:+'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.google.android.gms:play-services:+'
implementation 'com.google.android.gms:play-services-ads:+'
into this:
implementation 'com.google.android.gms:play-services-maps:12.0.1'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.android.gms:play-services-ads:12.0.1'
EDIT: You may also add this part to your app level gradle file and try again. I did not see anyone tried this but it may work.
allprojects {
repositories {
//...
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.google.android.gms'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "12.0.1"
}
}
}
}
}
2ND UPDATE: Just seen this, the dependency below, covers all the others, then it may cause a duplication issue. Remove the other dependencies and leave this one:
implementation 'com.google.android.gms:play-services:12.0.1'
I had the same issue and I solved it.Update all your com.google.android.gms:play-services dependencies to 15.0.0. It should look like this:
implementation 'com.google.android.gms:play-services-maps:15.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'com.google.android.gms:play-services:15.0.0'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
Once you do that, it should fix the issue with finding the NoClassDefFoundError error (at least it did for me).
That worked for me I added subprojects block as below to my project gradle file
allprojects {
repositories {
//...
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.google.android.gms'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "+"
}
if (details.requested.group == 'com.google.firebase'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "+"
}
}
}
}
}
implementation 'com.google.android.gms:play-services-maps:15.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'com.google.android.gms:play-services:15.0.0'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
This helped me.
You may be using different verions of libraries.
Important point is you may be using an external library which is using a different play services version (may be older) . Please check care fully all external libraries updates and match them all
I solved it by removing
implementation "com.google.android.gms:play-services:$play_service_version"
and keeping only important dependencies.
In my case I had
implementation "com.google.android.gms:play-services:$play_service_version"
implementation "com.google.android.gms:play-services-location:$play_service"
And I removed
implementation "com.google.android.gms:play-services:$play_service_version"
and kept
implementation "com.google.android.gms:play-services-location:$play_service"
Here play_service_version & play_service are versions
I had exactly the same problem. I tried quite a few things, but here's what actually helped.
I added this to my project:
implementation 'com.google.android.gms:play-services-base:16.0.1'.
The error went away.
Then I removed it. Everything was still fine. Cleaned the project - still no error.
Don't ask me for logic behind this, it just worked for me, that's all I know.
#cubycode I am also running into the same issue and I tried all solutions listed here.
I received the same error even with the 'zzbq;' at the end
In app build.gradle I had to update my com.google.firebase:firebase-core to 16.0.1 to match the same line in the react-native-firebase build.gradle
Example:
app/build.gradle
implementation 'com.google.firebase:firebase-core:16.0.1'
react-native-firebase/android/build.gradle
compileOnly "com.google.firebase:firebase-core:16.0.1"
Step 1:
This kind of error throw the some logs. Read it carefully to find out which dependency cause this issue
Step 2:
Update that dependency to latest version.
For ex: In my case it throw the error in material design dependency. I just update that dependency to latest version - problem solved
My error log - Didn't find class "com.google.android.material.tabs........"
Related
I just integrated Kochava SDK to my app recently. While I installing or running apk first time its crashed, but its working fine while running second time! However I also checked by generating signed(released) apk and then installing manually on device then its continuously crashing!
Here is my Project gradle file:
buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
maven {url "http://kochava.bintray.com/maven"}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'io.fabric.tools:gradle:1.31.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://jcenter.bintray.com" }
jcenter()
google()
maven {
url 'https://maven.google.com/'
}
maven {
url "http://dl.bintray.com/glomadrian/maven"
}
maven { url "https://jitpack.io" }
maven {url "http://kochava.bintray.com/maven"}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And Module gradle file is:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
dataBinding {
enabled = true
}
defaultConfig {
applicationId "xyz.xyz.myapplication"
minSdkVersion 19
targetSdkVersion 28
versionCode 31
versionName "4.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary true
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
aaptOptions {
ignoreAssetsPattern "!*ffprobe"
ignoreAssetsPattern "!*ffmpeg"
ignoreAssetsPattern "!arm"
ignoreAssetsPattern "!x86"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
android.buildTypes.each { type ->
type.buildConfigField 'String', 'Base_URL', WEBServiceBaseURL
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//Android necessary...
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
//Support libs...
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'commons-io:commons-io:2.6'
//Facebook ads
implementation 'com.google.ads.mediation:facebook:5.6.0.0'
implementation 'com.facebook.android:audience-network-sdk:5.6.0'
implementation 'com.facebook.android:facebook-android-sdk:4.41.0'
//Firebase
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.google.firebase:firebase-ads:18.3.0'
implementation 'com.google.firebase:firebase-config:19.0.3'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-messaging:20.0.1'
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation 'com.google.android.play:core:1.6.4'
//FFMPEG
implementation 'com.writingminds:FFmpegAndroid:0.3.2'
//Image crop
implementation 'com.naver.android.helloyako:imagecropview:1.2.2'
//Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
//Exo Player
implementation 'com.google.android.exoplayer:exoplayer:2.10.5'
//Progress bar
implementation 'com.dinuscxj:circleprogressbar:1.3.0'
//Range seekbar
implementation 'com.crystal:crystalrangeseekbar:1.1.3'
//Glide...
implementation 'com.github.bumptech.glide:glide:4.9.0'
//GPUImage...
implementation 'jp.co.cyberagent.android:gpuimage:2.0.3'
//Fetch a downloader library...
implementation "androidx.tonyodev.fetch2:xfetch2:3.1.4"
implementation "androidx.tonyodev.fetch2okhttp:xfetch2okhttp:3.1.4"
//Downloader for Android 19...
implementation 'com.mindorks.android:prdownloader:0.6.0'
//Lottie...
implementation 'com.airbnb.android:lottie:3.2.0'
//Volley for Anfroid 4!
implementation 'com.android.volley:volley:1.1.1'
//Introduction for any screen...
implementation 'com.github.paolorotolo:appintro:4.0.0'
//ViewPagerEffects...
implementation 'com.eftimoff:android-viewpager-transformers:1.0.1#aar'
//Kochava...
implementation 'com.kochava.base:tracker:3.6.3'
implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
implementation 'com.android.installreferrer:installreferrer:1.1'
//AVLoader...
implementation 'com.wang.avi:library:2.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation project(path: ':jiaozivideoplayer')
}
apply plugin: 'com.google.gms.google-services'
I also implemented Application class as per suggestion and rule:
public class MyApplication extends MultiDexApplication {
#Override
public void onCreate() {
super.onCreate();
MultiDex.install(this);
final Fabric fabric = new Fabric.Builder(this)
.kits(new Crashlytics())
.debuggable(true)
.build();
Fabric.with(fabric);
AudienceNetworkAds.initialize(this);
AudienceNetworkAds.isInAdsProcess(this);
MobileAds.initialize(this, getString(R.string.app_id));
if (Build.VERSION.SDK_INT < 21) {
PRDownloaderConfig config = PRDownloaderConfig.newBuilder()
.setReadTimeout(30_000)
.setConnectTimeout(30_000)
.build();
PRDownloader.initialize(getApplicationContext(), config);
}
Tracker.configure(new Tracker.Configuration(getApplicationContext())
.setAppGuid("koboo-8bod4gz3")
.setLogLevel(Tracker.LOG_LEVEL_INFO)
);
}
}
Above code is OK for Kochava integration. But another thing is that, here I also need all those google and firebase sdk! So, may be its problem is in between google sdk and Kochava sdk! But I need can't remove google sdk or crashlytics and also I need to integrate Kochava for tracking my application in Ad campaign in "Tik Tok" as per its suggestion!
Well if I don't initialize Tracker.configure(....); in application class then app run fine and not crashing but then Kochava not working!
So, after initialize Tracker.configure(...); Kochava sdk it will be generate error:
2019-12-03 15:33:14.254 E/AndroidRuntime: FATAL EXCEPTION: main
Process: xyz.xyz.myapplication, PID: 6113
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/aidl/BaseStub;
at com.android.installreferrer.api.InstallReferrerClientImpl.startConnection(InstallReferrerClientImpl.java:133)
at com.kochava.base.c$a.run(Unknown Source:15)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.aidl.BaseStub" on path: DexPathList[[zip file "/data/app/videostatusmaker.videostatus.boo-Ptd9gTEkM8rXlvGCnCByPg==/base.apk"],nativeLibraryDirectories=[/data/app/videostatusmaker.videostatus.boo-Ptd9gTEkM8rXlvGCnCByPg==/lib/x86, /data/app/videostatusmaker.videostatus.boo-Ptd9gTEkM8rXlvGCnCByPg==/base.apk!/lib/x86, /system/lib, /system/product/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.android.installreferrer.api.InstallReferrerClientImpl.startConnection(InstallReferrerClientImpl.java:133)
at com.kochava.base.c$a.run(Unknown Source:15)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
May be there is some problem in Kochava library or something I missing in integration?! Please tell me what is the problem? Or it is not suitable with google sdk?
Here is the link for Android Kochava SDK integration.
Well if you have more than one module in your app then put all Kochava dependencies in all of those module :
implementation 'com.kochava.base:tracker:3.6.3'
implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
implementation 'com.android.installreferrer:installreferrer:1.0'
These all must be in all module level gradle files. This is not mentioned is in documentation but you can try it. Because I tried your code in my application and I also have Google ads and other Google's libraries and also have three modules in my app. But added these libraries in all modules than its work perfectly!
I don't know if you have more than one module in your app but if there is than this will helpful.
EDIT
It has been fixed by google, on the same version...
It should work now, if it's still crashing it's probably linked to the previous version being cached, the following should fix it:
implementation('com.android.installreferrer:installreferrer:1.1') { changing .= true}
More information here: https://github.com/adjust/android_sdk/issues/402
Try with com.android.installreferrer:installreferrer:1.0 instead of 1.1
Looks like IGetInstallReferrerService expects com.google.android.aidl.BaseStub in the 1.1 implementation, which does not come with installreferrer
mVck is correct and as far as we can tell, it's likely on Google's end and looks to be specific to version 1.1 of their library. This is our theory because it appears others on SO are experiencing similar issues with other vendor SDKs.
We've reached out to our Google reps to confirm, but in the meantime, please
stay on version 1.0 of Google's library as indicated above. Once we receive confirmation we'll be sure and update our support documentation. Thanks!
I just ran into the same thing and what fixed it for me was to delete the install referrer dependency from my gradle cache and then re-sync with gradle. I think it was something to do with the cached aar. It's bizarre though because it was fine earlier this week and the aar didn't change as far as I'm aware. Regardless, deleting it and re-syncing did the trick for me.
I was having trouble downgrading to 1.0 after attempting to fix this issue with the 1.1.1 fix. In my case the installreferrer was adding the permission READ_PHONE_STATE to my application. Gradle was attempting to resolve 1.1 even after I backed down the version to 1.0 in my app.gradle.
In order to fix this I now force installreferrer to use version 1.0.
dependencies {
configurations.all {
resolutionStrategy.force 'com.android.installreferrer:installreferrer:1.0'
}
implementation 'com.android.installreferrer:installreferrer:1.0'
}
I'm updating my project to use the jetpack libraries.
I executed this in the commandline:
./gradlew :app:kaptDebugKotlin
in my project directory, and this error was thrown:
e: [kapt] An exception occurred: java.lang.UnsatisfiedLinkError: org.sqlite.core.NativeDB._open_utf8([BI)V
at org.sqlite.core.NativeDB._open_utf8(Native Method)
at org.sqlite.core.NativeDB._open(NativeDB.java:71)
at org.sqlite.core.DB.open(DB.java:174)
at org.sqlite.core.CoreConnection.open(CoreConnection.java:220)
at org.sqlite.core.CoreConnection.<init>(CoreConnection.java:76)
at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:25)
at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:24)
at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:45)
at org.sqlite.JDBC.createConnection(JDBC.java:114)
at androidx.room.verifier.DatabaseVerifier$Companion.create(DatabaseVerifier.kt:81)
at androidx.room.processor.DatabaseProcessor.doProcess(DatabaseProcessor.kt:78)
at androidx.room.processor.DatabaseProcessor.process(DatabaseProcessor.kt:54)
at androidx.room.RoomProcessor$DatabaseProcessingStep.process(RoomProcessor.kt:63)
at com.google.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:330)
at com.google.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:181)
at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.process(annotationProcessing.kt:99)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1068)
at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:55)
at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing$default(annotationProcessing.kt:27)
at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.runAnnotationProcessing(Kapt3Extension.kt:216)
at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:164)
at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:93)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:98)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:108)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:85)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:370)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:61)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:101)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:361)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:126)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:154)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:51)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:95)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:50)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:88)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:405)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:98)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:927)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:98)
at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:957)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:926)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:404)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
This is my project build.gradle
ext {
archLifecycleVersion = '2.0.0'
roomVersion = '2.1.0-alpha02'
pagingVersion = '2.1.0-beta01'
supportLibVersion = '1.0.0'
}
buildscript {
ext.kotlin_version = '1.2.51'
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.guava:guava:19.0'
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02'
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
mavenCentral()
}
}
And this is the app build.gradle
buildscript {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.cloud.tools.endpoints-framework-client'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "package.name.of.app"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
//multiDexEnabled false
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4096m"
}
dataBinding {
enabled = true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.appcompat:appcompat:$rootProject.supportLibVersion"
implementation "com.google.android.material:material:$rootProject.supportLibVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
kapt 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
// architecture components
implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.archLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-runtime:$rootProject.archLifecycleVersion"
implementation "androidx.room:room-runtime:$rootProject.roomVersion"
implementation "androidx.paging:paging-runtime:$rootProject.pagingVersion"
kapt "androidx.lifecycle:lifecycle-compiler:$rootProject.archLifecycleVersion"
kapt "androidx.room:room-compiler:$rootProject.roomVersion"
testImplementation 'junit:junit:4.12'
}
configurations {
all {
exclude module: 'httpclient'
exclude module: 'commons-logging'
}
}
Does anyone know what caused this issue? Why does the SQLite error occur during compilation instead of during actual execution? Also, has anyone successfully compiled an app with similar dependencies as described above?
Upon searching for information regarding this issue, I found this link
https://github.com/xerial/sqlite-jdbc/issues/97
The fix was to update /etc/fstab to remove 'noexec' from /tmp, and then remounting /tmp
In Windows grant all permissions to your user in c:\Users\\AppData\Temp and the problem will be gone.
You'll have to do it everytime you update Windows.
If you don't have permissions to remove noexec from /tmp, you can also supply an alternative java.io.tmpdir to kapt:
A Room issue has a comment from a Google engineer with a workaround:
Since you are using kapt are you sure you are passing java.io.tmpdir to Kotlin's compiler daemon and not Gradle's?
For example:
./gradlew <gradle-params> -Dkotlin.daemon.jvm.options="-Djava.io.tmpdir=path/to/a/folder" <task>
Another Room issue has a comment from a Google engineer suggesting that upgrading to 2.2.5 fixes the problem:
Can you try with Room 2.2.5 we had some further fixes in that version regarding the JDBC library and the way the Room compiler loads it and uses it.
I upgraded to 2.2.5, and the problem went away, but I didn't see this failure on every build, so I'll have to wait couple of weeks before I can say this is definitely fixed.
For me, the problem was AdoptOpenJDK installed via Homebrew. According to this issue some versions of the JDK distributed via Homebrew are not notarized.
I solved this by uninstalling from Homebrew and re-installing AdoptOpenJDK from the .pkg file downloaded from their site.
I have integrated Quick Blox Chat SDK version 3.8.1 (the latest version available as on 25-Sep-2018). I have successfully integrated the chat SDK. The problem which I'm facing is app crashes while opening for the first time with the following error.
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:353)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbq;
at com.google.android.gms.gcm.Task$Builder.checkConditions(Unknown Source:10)
at com.google.android.gms.gcm.OneoffTask$Builder.checkConditions(Unknown Source:0)
at com.google.android.gms.gcm.OneoffTask$Builder.build(Unknown Source:0)
at com.quickblox.messages.services.SubscribeTaskManager.a(Unknown Source:49)
at com.quickblox.messages.services.SubscribeService.c(Unknown Source:22)
at com.quickblox.messages.services.SubscribeService.a(Unknown Source:145)
at com.quickblox.messages.services.SubscribeService.a(Unknown Source:125)
at com.quickblox.messages.services.SubscribeService.e(Unknown Source:12)
at com.quickblox.messages.services.SubscribeService.b(Unknown Source:18)
at com.quickblox.messages.services.SubscribeService.onHandleWork(Unknown Source:46)
at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:392)
at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:383)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbq" on path: DexPathList[[zip file "/data/app/-HWe3wDorvDDaXln_aZyI2g==/base.apk"],nativeLibraryDirectories=[/data/app/HWe3wDorvDDaXln_aZyI2g==/lib/x86, /data/app/HWe3wDorvDDaXln_aZyI2g==/base.apk!/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.google.android.gms.gcm.Task$Builder.checkConditions(Unknown Source:10)
at com.google.android.gms.gcm.OneoffTask$Builder.checkConditions(Unknown Source:0)
at com.google.android.gms.gcm.OneoffTask$Builder.build(Unknown Source:0)
at com.quickblox.messages.services.SubscribeTaskManager.a(Unknown Source:49)
at com.quickblox.messages.services.SubscribeService.c(Unknown Source:22)
at com.quickblox.messages.services.SubscribeService.a(Unknown Source:145)
at com.quickblox.messages.services.SubscribeService.a(Unknown Source:125)
at com.quickblox.messages.services.SubscribeService.e(Unknown Source:12)
at com.quickblox.messages.services.SubscribeService.b(Unknown Source:18)
at com.quickblox.messages.services.SubscribeService.onHandleWork(Unknown Source:46)
at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:392)
at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:383)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
The app were working fine without any issue prior to integrate chat SDK. So I'm strongly belive that the issue is caused by chat SDK.
Notes
Mutidex is already enabled
Here is my app gradle file
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.myapp"
minSdkVersion 21
targetSdkVersion 28
multiDexEnabled true
versionCode 1
versionName "1.0 - Alpha Dev version"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
def paging_version = "1.0.1"
def material = "1.0.0-rc01"
def qbSdkVersion = '3.8.1'
def swipyVersion = '1.2.3'
def stickylistheadersVersion = '0.4.2'
def androidSupport = '28.0.0'
def androidArch = '1.1.1'
def playService = '15.0.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:$androidSupport"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "com.android.support:design:$androidSupport"
implementation 'com.google.firebase:firebase-crash:16.2.0'
implementation "android.arch.lifecycle:extensions:$androidArch"
implementation "android.arch.lifecycle:viewmodel:$androidArch"
implementation "android.arch.persistence.room:runtime:$androidArch"
annotationProcessor "android.arch.persistence.room:compiler:$androidArch"
implementation "com.google.android.gms:play-services-location:$playService"
implementation "com.google.android.gms:play-services-places:$playService"
implementation "com.google.firebase:firebase-core:16.0.3"
implementation 'com.google.firebase:firebase-messaging:17.3.2'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5#aar'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'pub.devrel:easypermissions:1.2.0' /*permission simplified*/
implementation 'com.github.jrvansuita:PickImage:2.2.3'/*Image picker Camera/Gallery*/
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' /*Image cropper*/
implementation 'com.wdullaer:materialdatetimepicker:3.6.3' /*Date picker*/
implementation 'com.kofigyan.stateprogressbar:stateprogressbar:1.0.0'
implementation('com.github.ganfra:material-spinner:2.0.0') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
implementation 'com.github.danimahardhika:cafebar:1.3.1'/*Snack Toast SDK*/
implementation(name: 'sinch-android-verification-1.5.1', ext: 'aar') /*SMS verification*/
implementation 'com.github.blocoio:faker:1.2.7' /*Data faker*/
implementation 'com.github.joielechong:countrycodepicker:2.1.8'
implementation 'com.yarolegovich:sliding-root-nav:1.1.0' /*Custom nav drawer*/
implementation "com.yuyakaido.android:card-stack-view:1.0.0-beta9" /*Card stack view*/
implementation 'com.jaredrummler:android-animations:1.0.0' /*View Animator*/
implementation 'com.facebook.fresco:fresco:1.10.0'
implementation 'com.github.Binary-Finery:Bungee:master-SNAPSHOT'/*Activity Translation*/
implementation 'com.github.ybq:Android-SpinKit:1.1.0' /*Loading animations*/
implementation 'com.github.thunder413:DateTimeUtils:1.0' /*Date converter utility*/
implementation(name: 'filepicker', ext: 'aar')
implementation(name: 'materialrangebar', ext: 'aar')
implementation 'com.github.warkiz.widget:indicatorseekbar:2.0.9'
implementation 'com.github.PuffoCyano:Range-Time-Picker-Dialog:v1.5' /*Multi time range picker*/
implementation('com.crashlytics.sdk.android:crashlytics:2.9.5#aar') {
transitive = true;
}
implementation "com.quickblox:quickblox-android-sdk-chat:$qbSdkVersion"
implementation "com.quickblox:quickblox-android-sdk-extensions:$qbSdkVersion"
implementation "com.quickblox:quickblox-android-sdk-messages:$qbSdkVersion"
implementation 'com.quickblox:chat-message-adapter:2.0'
implementation "com.github.orangegangsters:swipy:$swipyVersion#aar"
implementation "com.timehop.stickyheadersrecyclerview:library:$stickylistheadersVersion#aar"
}
apply plugin: 'com.google.gms.google-services'
Let me explain the scenario where app crash.
Run app from Android studio / Build APK and install directly in to device.
Splash screen -> Login page {here crash happens - surprisingly it's only happens at first time of app launch , if i kill the app and launched again this issue not showing up }
Any help appreciated.
Since version 3.2 android SDK provides new feature - auto subscription
to push notification out of the box. It means you don’t need bother
how to get GCM or FCM token, create
QBPushNotifications.createSubscription and what to do with received
data in your code anymore.
Actually what's making the app crash is that, you have not added the GCM dependency as stated by Quickblox.
Add the GCM dependency with version same as your other play services sdk version:
implementation "com.google.android.gms:play-services-gcm:$your_version"
This will remove Caused by: java.lang.NoClassDefFoundError
After hours of research and trial and error, I ended up with something like this to overcome the issue.
I found that the issue is mainly because of Quick Blox SubscribeService.
To overcome that follow the below workaround.
<service android:name="com.quickblox.messages.services.fcm.QBFcmPushInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
Remove the above service tag from the app manifest. The QBFcmPushInstanceIDService get invoked every time we open the application and an FCM token get refreshed which il trigger the following
SubscribeService.subscribeToPushes(this, true);
There the error occurs.
The SubscribeService must be called only after the successful login to Quick Blox server. So what I did was I removed it from the manifest and used default FCM functionality.
// Get token for sending notification to device { Google FCM }
FirebaseInstanceId.getInstance().getInstanceId()
.addOnCompleteListener(task -> {
if (!task.isSuccessful()) {
Log.warn("getInstanceId failed" + task.getException());
return;
}
// Get new Instance ID token
String token = task.getResult().getToken();
SubscribeService.subscribeToPushes(this, true);
});
The above code must be initiated only after once you login into the quick blox chat server
since I've updated to Android Studio 3.1, my project is not running anymore. I have searched for a solution all over the internet with no positive results.
Here's the error I get in the Logcat:
--------- beginning of crash
04-13 13:33:55.466 12720-12720/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: woopy.domain.com.woopy, PID: 12720
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbq;
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source:2)
at android.app.ActivityThread.installProvider(ActivityThread.java:6239)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbq" on path: DexPathList[[zip file "/data/app/woopy.domain.com.woopy-KqNv1gE1ZomaesHCq33DJw==/base.apk"],nativeLibraryDirectories=[/data/app/woopy.domain.com.woopy-KqNv1gE1ZomaesHCq33DJw==/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source:2)
at android.app.ActivityThread.installProvider(ActivityThread.java:6239)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
04-13 13:33:55.567 12720-12727/? I/zygote: Debugger is no longer active
Here's my build.gradle (Module:app) file:
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "woopy.domain.com.woopy"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Enabling multidex support.
multiDexEnabled true
aaptOptions {
cruncherEnabled = false
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
implementation 'com.parse:parse-android:+'
implementation 'com.parse.bolts:bolts-android:1.+'
//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services-maps:+'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.google.android.gms:play-services:+'
implementation 'com.google.android.gms:play-services-ads:+'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.facebook.android:facebook-android-sdk:4.+'
implementation 'com.parse:parsefacebookutils-v4-android:1.10.3#aar'
implementation 'com.commit451:PhotoView:1.2.4'
}
And here's my build.gradle (Project: appname):
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The Build is successful, but the app crashes at startup.
EDIT:
It doesn't build successful anymore now, it throws this absolutely weird error in the Build message console:
AGPBI: {"kind":"error","text":"Program type already present: com.google.android.gms.location.places.zza","sources":[{}],"tool":"D8"}
:app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'
.
Try adding this dependency to your gradle file:
implementation 'com.android.support:multidex:1.0.3'
Also you should use the same versions for the support and play services libraries. And you should avoid using "+" for latest version. Change this part:
implementation 'com.google.android.gms:play-services-maps:+'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.google.android.gms:play-services:+'
implementation 'com.google.android.gms:play-services-ads:+'
into this:
implementation 'com.google.android.gms:play-services-maps:12.0.1'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.android.gms:play-services-ads:12.0.1'
EDIT: You may also add this part to your app level gradle file and try again. I did not see anyone tried this but it may work.
allprojects {
repositories {
//...
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.google.android.gms'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "12.0.1"
}
}
}
}
}
2ND UPDATE: Just seen this, the dependency below, covers all the others, then it may cause a duplication issue. Remove the other dependencies and leave this one:
implementation 'com.google.android.gms:play-services:12.0.1'
I had the same issue and I solved it.Update all your com.google.android.gms:play-services dependencies to 15.0.0. It should look like this:
implementation 'com.google.android.gms:play-services-maps:15.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'com.google.android.gms:play-services:15.0.0'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
Once you do that, it should fix the issue with finding the NoClassDefFoundError error (at least it did for me).
That worked for me I added subprojects block as below to my project gradle file
allprojects {
repositories {
//...
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.google.android.gms'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "+"
}
if (details.requested.group == 'com.google.firebase'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "+"
}
}
}
}
}
implementation 'com.google.android.gms:play-services-maps:15.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'com.google.android.gms:play-services:15.0.0'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
This helped me.
You may be using different verions of libraries.
Important point is you may be using an external library which is using a different play services version (may be older) . Please check care fully all external libraries updates and match them all
I solved it by removing
implementation "com.google.android.gms:play-services:$play_service_version"
and keeping only important dependencies.
In my case I had
implementation "com.google.android.gms:play-services:$play_service_version"
implementation "com.google.android.gms:play-services-location:$play_service"
And I removed
implementation "com.google.android.gms:play-services:$play_service_version"
and kept
implementation "com.google.android.gms:play-services-location:$play_service"
Here play_service_version & play_service are versions
I had exactly the same problem. I tried quite a few things, but here's what actually helped.
I added this to my project:
implementation 'com.google.android.gms:play-services-base:16.0.1'.
The error went away.
Then I removed it. Everything was still fine. Cleaned the project - still no error.
Don't ask me for logic behind this, it just worked for me, that's all I know.
#cubycode I am also running into the same issue and I tried all solutions listed here.
I received the same error even with the 'zzbq;' at the end
In app build.gradle I had to update my com.google.firebase:firebase-core to 16.0.1 to match the same line in the react-native-firebase build.gradle
Example:
app/build.gradle
implementation 'com.google.firebase:firebase-core:16.0.1'
react-native-firebase/android/build.gradle
compileOnly "com.google.firebase:firebase-core:16.0.1"
Step 1:
This kind of error throw the some logs. Read it carefully to find out which dependency cause this issue
Step 2:
Update that dependency to latest version.
For ex: In my case it throw the error in material design dependency. I just update that dependency to latest version - problem solved
My error log - Didn't find class "com.google.android.material.tabs........"
Very much aware there are similar questions. Tried all the answers, none of them helped.
Everything works just fine when I upload the apk to my phone with Android Studio but when I download and install the apk I get this nonsense:
java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.mycompany.myapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mycompany.myapp-1/lib/arm64, /system/lib64, /vendor/lib64]]
at android.app.ActivityThread.installProvider(ActivityThread.java:5945)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5534)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5473)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1571)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6209)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.mycompany.myapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mycompany.myapp-1/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.ActivityThread.installProvider(ActivityThread.java:5930)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5534)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5473)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1571)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6209)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
The app is pretty much only a webview wrapper for a webapp + widget + GCM functionality that receives push messages and shows notifications. If I get this to work, I might never need to touch Android again, so for the love of god please help me with this final issue.
Here's my build.gradle files:
Project:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Module:
apply plugin: 'com.android.application'
//apply plugin: "com.ewerk.gradle.plugins.annotation-processor"
android {
compileSdkVersion 24
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.mycompany.myapp"
minSdkVersion 21
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true //tried this due to one answer, didnt do anything
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
/*
configurations.all {
resolutionStrategy {
force 'com.android.support:design:23.4.0'
force 'com.android.support:support-v4:23.4.0'
force 'com.android.support:appcompat-v7:23.4.0'
}
}
*/
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
//compile 'com.android.support:appcompat-v7:24.4.0'
//compile 'com.jakewharton:butterknife-compiler:8.4.0'
//annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.jakewharton:butterknife:8.4.0'
//compile 'com.google.android.gms:play-services-gcm:10.0.1'
//compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.firebase:firebase-messaging:9.4.0'
//compile 'com.firebase:firebase-client-android:2.3.1'
// https://mvnrepository.com/artifact/com.squareup.okhttp/okhttp
compile group: 'com.squareup.okhttp', name: 'okhttp', version: '2.7.5'
}
apply plugin: 'com.google.gms.google-services'
Yessss, finally. Goodbye android!
Turns out the APK android studio had built during normal build processes was crap for some reason. Build-> Build APK built a 3x bigger apk file that worked when downloaded too.