I am using Firebase inside my app with Facebook authentication. After the 3th restart of my app, it freezes and then shows an ANR (please see my last question). After some doing some research i found out that something is blocking the main thread. I have no clue why this is happening. The error below show up a couple of times when my app is running (my app does not freeze when this error appears). Does anyone have an idea?
I have included some info below, maybe it helps
Note: Google play services on test device (Samsung SM-G920F) is running version: 9.0.83 (440-121911109)
Getting this error:
05-28 02:35:56.798 29479-29506/? E/DynamiteModule: Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor" on path: DexPathList[[zip file "/data/app/com.package.myapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.package.myapp-1/lib/arm64, /vendor/lib64, /system/lib64]]
Theads:
Dependencies:
compile 'com.facebook.android:facebook-android-sdk:4.12.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.spotify.sdk:spotify-auth:1.0.0-beta12#aar'
compile 'com.google.firebase:firebase-database:9.0.1'
compile 'com.google.firebase:firebase-auth:9.0.1'
compile 'com.google.firebase:firebase-core:9.0.1'
compile 'com.google.firebase:firebase-crash:9.0.1'
compile 'com.squareup.okhttp3:okhttp:3.3.0'
compile 'com.google.guava:guava:19.0'
compile 'com.google.android.gms:play-services:9.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
I had the exact same ANR as you using Firebase and Google Play Services. I solved my problem with the answer in After Upgrading to Google Play Services 9.0.0, App Hangs in DynamiteModulesC -- remove the general play-services and only include the specific play service libraries you need.
Related
I moved my SDK directory from my laptop to a remote hard drive. Afterward, I noticed Android Studio can't find
com.google.api.client.extensions.android (see below)
The app compiles fine and runs fines which makes it more perplexing....
Did anyone have the similar experience? If so, what's the resolution.
Apparently, there was a conflict in the google.android library.
I added force = true to a handful of libraries and the problem was resolved. Below is a sample of what I did:
compile ('com.android.support:appcompat-v7:26.1.0'){
force = true
}
compile ('com.android.support:design:26.1.0'){
force = true
}
// For enabling Google app invite
compile ('com.google.firebase:firebase-invites:11.4.2')
compile 'com.google.android.gms:play-services-plus:11.4.2'
compile 'com.google.android.gms:play-services-auth:11.4.2'
compile 'com.google.android.gms:play-services-identity:11.4.2'
compile 'com.google.android.gms:play-services-location:11.4.2'
compile 'com.google.android.gms:play-services-gcm:11.4.2'
compile 'com.facebook.android:facebook-android-sdk:4.27.0'
After having started using Firebase for event logging in my android app I keep getting these error messages when I fire up my app:
E/System: java.lang.IllegalStateException: The database '/...folder here.../google_app_measurement_local.db' is not open.
at android.database.sqlite.SQLiteDatabase.throwIfNotOpenLocked(SQLiteDatabase.java:2169)
at android.database.sqlite.SQLiteDatabase.createSession(SQLiteDatabase.java:365)
at android.database.sqlite.SQLiteDatabase$1.initialValue(SQLiteDatabase.java:84)
at android.database.sqlite.SQLiteDatabase$1.initialValue(SQLiteDatabase.java:83)
at java.lang.ThreadLocal$Values.getAfterMiss(ThreadLocal.java:430)
at java.lang.ThreadLocal.get(ThreadLocal.java:65)
at android.database.sqlite.SQLiteDatabase.getThreadSession(SQLiteDatabase.java:359)
at android.database.sqlite.SQLiteProgram.getSession(SQLiteProgram.java:101)
at android.database.sqlite.SQLiteQuery.setLastStmt(SQLiteQuery.java:96)
at android.database.sqlite.SQLiteQuery.close(SQLiteQuery.java:111)
at android.database.sqlite.SQLiteCursor.close(SQLiteCursor.java:300)
at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:366)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:202)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:185)
at java.lang.Thread.run(Thread.java:818)
Here's a snippet from my build.gradle:
dependencies {
compile 'com.android.support:support-v4:25.0.0'
compile 'com.google.firebase:firebase-analytics:9.8.0'
compile 'com.google.firebase:firebase-crash:9.8.0'
compile files('src/main/resources/simple-xml-2.7.jar')
compile files('src/main/resources/date4j.jar')
compile 'com.android.support:appcompat-v7:25.0.0'
compile files('src/main/resources/picasso-2.5.2.jar')
}
All I do is call
_firebaseAnalytics = FirebaseAnalytics.getInstance(context);
and then
_firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SHARE, payload);
I have not been able to find any solutions online and am now hoping for help here...
Please move to latest version of firebase SDK. Firebase solved this memory leak issue in their updated sdk. Remove your old SDK and add below line in your gradle file.
compile 'com.google.firebase:firebase-core:11.0.1'
I have just faced with this when enabling strictmode, when adding
compile 'com.google.firebase:firebase-core:9.8.0'
I had to use earlier version:
compile 'com.google.firebase:firebase-core:9.6.0'
I've found latest version from Firebase Android SDK Release Notes
After I updated my Support library from 23.1.1 to 23.4.0 I get this warning cannot access android.support.v4.app.baseFragmentActivityEclair on every call to super and every instance of AppCompatActivity
And if I updated my support library to 24.1.1 The warning changes to cannot access android.support.v4.app.baseFragmentActivityJB.
Can anyone tell me why this warning is shown and how can I remove this warning:
here is my dependencies before:
(no error in this)
compile 'com.android.support:palette-v7:23.1.1'
compile 'com.android.support:gridlayout-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
here is my dependencies after cannot access android.support.v4.app.baseFragmentActivityEclairwarning:
compile 'com.android.support:palette-v7:23.4.0'
compile 'com.android.support:gridlayout-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
here is my dependencies after cannot access android.support.v4.app.baseFragmentActivityJBwarning:
compile 'com.android.support:palette-v7:24.1.1'
compile 'com.android.support:gridlayout-v7:24.1.1'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
We ran into a similar problem when one of the packages in our project had dependencies on version 24.0 support libraries and another package was dependent on version 23.4.0. This seems to be a problem for the Android Studio (IntelliJ) IDE, not the compiler, because we were able to build and run the project without any problems. We resolved the warning by reverting the 24.0 dependency to 23.4.0. I suspect that going the other direction (advancing all of our package dependencies to 24.0) would also have eliminated the warning but we didn't experiment with that due to the number of packages in our project.
If you're looking to hack around this, many of the support libraries have an internal library called libs/internal_impl-$VERSION.jar that includes these types of version-specific implementations. To get your IDE to work, you can extract these JARs and manually include them in your IDE's build path.
For example, you can extract the classes referenced here, assuming version 24.2.1, using this command:
unzip support-fragment-24.2.1.aar libs/internal_impl-24.2.1.jar
Below is log when app is first time installing:
05-12 13:16:23.632 28250-28250/com.app.projectName W/System: ClassLoader referenced unknown path: /data/app/com.app.projectName-1/lib/arm
05-12 13:16:59.041 28250-28250/com.app.projectName W/System: ClassLoader referenced unknown path: /data/app/com.app.projectName-1/lib/arm
05-12 13:16:59.073 28250-28250/com.app.projectName I/MultiDex: VM with version 2.1.0 has multidex support
05-12 13:16:59.073 28250-28250/com.app.projectName I/MultiDex: install
05-12 13:16:59.073 28250-28250/com.app.projectName I/MultiDex: VM has multidex support, MultiDex support library is disabled.
And I am using MultiDex library in my project it will work completely below pre lollipop devices.This delay varying in Lollipop devices between 30 sec to 90 sec first time app start up.
See it is not due to MultiDex right? because when time is 1.) initializing 05-12 13:16:23.632 and second log comes after 36 second which is 05-12 13:16:59.041
That thing creates app delay ClassLoader referenced.... MultiDex is initializing fast. Below is the screen shot It is taking 15 seconds to 30 seconds and sometime even more.
My Gradle file is:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.bignerdranch.android:expandablerecyclerview:2.1.1'
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'org.apache.httpcomponents:httpcore:4.2.4'
compile 'org.apache.httpcomponents:httpmime:4.3'
compile 'com.google.code.gson:gson:2.5'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
compile 'com.squareup.okhttp3:logging-interceptor:3.1.2'
compile 'co.lujun:androidtagview:1.0.2'
compile 'com.google.android.gms:play-services-analytics:9.0.1'
compile 'com.google.android.gms:play-services-auth:9.0.1'
compile 'com.google.android.gms:play-services-plus:9.0.1'
compile 'com.google.android.gms:play-services-gcm:9.0.1'
compile 'com.google.android.gms:play-services-maps:9.0.1'
compile 'com.google.android.gms:play-services-location:9.0.1'
compile 'org.solovyev.android.views:linear-layout-manager:0.5#aar'
compile 'org.apache.commons:commons-lang3:3.0'
compile 'jp.wasabeef:picasso-transformations:2.0.0'
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.greysonparrelli.permiso:permiso:0.2.0'
compile 'com.github.lawloretienne:imagegallery:0.0.14'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.10.0'
compile 'com.github.mahmed8003:DroidValidatorLight:1.0.0'
compile 'com.android.support:palette-v7:23.4.0'
compile 'com.yalantis:ucrop:1.1.+'
compile 'com.baoyz.pullrefreshlayout:library:1.2.0'
compile 'com.jakewharton:butterknife:7.0.1'
}
Any help appreciate.
Finally found answer after more then 16 days all thanks to you #Amir. Correct answer is to disabling instant run then run. There is a strange issue with newly released Android Studio 2.0 & 2.1. first time of launching application take longer than usual this issue happens only in debug mode and not effect your released APK.
Settings/Preferences(Mac) → Build, Execution, Deployment → Instant Run and uncheck Instant Run
Settings/Preferences(Mac) → Build, Execution, Deployment → Instant Run and uncheck Instant Run
I was also facing the same problem and finally i fixed this.
note:
1) before generating an apk file unchecked all these option to resolve delay issue from your production build.
2) while you are developing or adding new features then keep it as default setting(instant run) to make development faster.
I hope this will resolve your issue.
This is a really strange problem and I've been days stuck with it: we've got a working project (no errors whatsoever) in a git repository. Everything is OK (it's even published in Google Play) when executing the project from the creator's equip, but, when we try to clone it in a different equip (we've tried Mac, Linux and Windows), this exception is thrown:
Unable to execute dex: method ID not in [0, 0xffff]: 65536
Hereafter, even if we apply the multidex solution as described in Android Developers or delete the unused dependencies, the app raises an exception when trying to load class android.support.design.widget.NavigationView (coming from a NoClassDefFound in runtime).
I suspect maybe it has something to do with the gradle plugin or appcompat libs version, but so far, nothing we've tried has worked.
Edit: This is not a common multiDex error, I'm pretty familiarized about how to solve them, it's about one computer executing the app without problems but when you clone the same project from git in other computer, it won't run and the MultiDex error is thrown.
EDIT 2: mi dependenvy list is as follows (I ommit the company libs but they're not the problem
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.mo2o.third:valnif:1.0.0'
compile 'com.android.support:recyclerview-v7:23.0.+'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile('com.afollestad.material-dialogs:core:0.8.0.1#aar') {
transitive = true
}
compile 'com.android.support:percent:23.0.0'
compile 'se.emilsjolander:stickylistheaders:2.6.0'
compile 'me.grantland:autofittextview:0.2.+'
compile 'com.google.android.gms:play-services-auth:8.3.0'
compile "com.google.android.gms:play-services-gcm:8.3.0"
compile 'com.google.android.gms:play-services-plus:8.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'