Fabric initialization could not calculate hash for app icon in case of Android Instant Apps
I am initializing Fabric in Application class as
Fabric.with(context, crashlyticsKit);
My project is split into three modules: base function module, apk-wrapper module and instant application module. The application icon is declared as an attribute application
in the AndroidManifest.xml
base function module.
Fabric throws the following error when launching Instant Application
E/Fabric: Could not calculate hash for app icon.
android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1351)
at android.content.res.Resources.openRawResource(Resources.java:1265)
at android.content.res.Resources.openRawResource(Resources.java:1241)
at io.fabric.sdk.android.services.common.CommonUtils.getAppIconHashOrNull(CommonUtils.java:824)
at io.fabric.sdk.android.services.settings.Settings.initialize(Settings.java:83)
at io.fabric.sdk.android.Onboarding.retrieveSettingsData(Onboarding.java:124)
at io.fabric.sdk.android.Onboarding.doInBackground(Onboarding.java:99)
at io.fabric.sdk.android.Onboarding.doInBackground(Onboarding.java:45)
at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:63)
at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:28)
at io.fabric.sdk.android.services.concurrency.AsyncTask$2.call(AsyncTask.java:311)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
+4
source to share
3 answers
Just add the app icon to yours manifest
like this:
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher" <----- add this
android:label="@string/app_name"
android:theme="@style/AppTheme">
...
...
...
</application>
0
source to share