パルカワ2

最近はFlutterをやっています

Firebase API initialization failure.

compileSdkVersion 24, targetSdkVersion 24, サポートライブラリ 24.0.0 で開発してたらFirebaseがErrorを吐いてた。

サポートライブラリを24.0.0にしてるのが原因のようなので、24の機能に依存しているわけではないので、全部23に戻した。

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "io.github.hisaichi5518.akashic"
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
}
    
dependencies {
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:recyclerview-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
}

エラーが出てるけど、通知は受け取れたので、24のままでも良かったかもしれない(気持ち悪いけど)

07-17 19:06:28.532 7303-7303/io.github.hisaichi5518.akashic E/FirebaseApp: Firebase API initialization failure.
                                                                           java.lang.reflect.InvocationTargetException
                                                                               at java.lang.reflect.Method.invoke(Native Method)
                                                                               at com.google.firebase.FirebaseApp.zza(Unknown Source)
                                                                               at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                               at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                               at com.google.firebase.FirebaseApp.zzbu(Unknown Source)
                                                                               at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
                                                                               at android.content.ContentProvider.attachInfo(ContentProvider.java:1748)
                                                                               at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
                                                                               at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
                                                                               at android.app.ActivityThread.installProvider(ActivityThread.java:5158)
                                                                               at android.app.ActivityThread.installContentProviders(ActivityThread.java:4753)
                                                                               at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4693)
                                                                               at android.app.ActivityThread.-wrap1(ActivityThread.java)
                                                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
                                                                               at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                               at android.os.Looper.loop(Looper.java:148)
                                                                               at android.app.ActivityThread.main(ActivityThread.java:5422)
                                                                               at java.lang.reflect.Method.invoke(Native Method)
                                                                               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                            Caused by: java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.firebase.iid.zzg' appears in /data/data/io.github.hisaichi5518.akashic/files/instant-run/dex/slice-com.google.firebase-firebase-iid-9.0.0_71b4f57689b32f0b280a7a5d016ccf0a2694cb94-classes.dex)
                                                                               at com.google.firebase.iid.zzg.zzeC(Unknown Source)
                                                                               at com.google.firebase.iid.zzg.<init>(Unknown Source)
                                                                               at com.google.firebase.iid.zzg.<init>(Unknown Source)
                                                                               at com.google.firebase.iid.zzd.zzb(Unknown Source)
                                                                               at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
                                                                               at java.lang.reflect.Method.invoke(Native Method) 
                                                                               at com.google.firebase.FirebaseApp.zza(Unknown Source) 
                                                                               at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
                                                                               at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
                                                                               at com.google.firebase.FirebaseApp.zzbu(Unknown Source) 
                                                                               at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) 
                                                                               at android.content.ContentProvider.attachInfo(ContentProvider.java:1748) 
                                                                               at android.content.ContentProvider.attachInfo(ContentProvider.java:1723) 
                                                                               at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
                                                                               at android.app.ActivityThread.installProvider(ActivityThread.java:5158) 
                                                                               at android.app.ActivityThread.installContentProviders(ActivityThread.java:4753) 
                                                                               at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4693) 
                                                                               at android.app.ActivityThread.-wrap1(ActivityThread.java) 
                                                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405) 
                                                                               at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                               at android.os.Looper.loop(Looper.java:148) 
                                                                               at android.app.ActivityThread.main(ActivityThread.java:5422) 
                                                                               at java.lang.reflect.Method.invoke(Native Method) 
                                                                               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)