DoubleVoid DoubleVoid - 1 month ago 23
Android Question

Galaxy S3 not working, could not find Firebase provider

I saw several answers to this problem, but nothing seems to help. I am installing my self signed Release-APK on a Samsung Galaxy S3 without any problem. Starting the app produces the following Exception;

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: /data/app/de.myapp.app-2.apk


Here's my gradle script (app):

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "de.myapp.app"
minSdkVersion 18
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'

compile 'com.google.android.gms:play-services-location:9.6.1'
compile 'com.google.android.gms:play-services-maps:9.6.1'
}


I tried using only specific google play services. Didn't help.
Works fine with the emulator and on my Nexus 5.

Answer

This could be because the Samsung Galaxy S3 is a relatively outdated device, which has been released over 3 years ago. Although in the documentation, Firebase states that its framework works in Android 2.2 and above, this may not always be the case for the latest Firebase updates.

I recommend using at least Android 4.1 as the target API in the manifest and try to clean and rebuild the app.

If this doesn't work, I recommend you to add the following line of code to better debug the issue with Firebase:

Firebase.getDefaultConfig().setLogLevel(Logger.Level.DEBUG); 

This needs to be added when you initialise a call to your Firebase database.

Hope this helps :)

Comments