Tomus
Tomus

Reputation: 121

Unity 2018.2 build error in manifest ( resource drawable/app_icon not found )

I have upgraded unity to 2018.2.2f1 and now when I want to build the apk this error prevents build from finishing:

...\Temp\gradleOut\build\intermediates\manifests\full\debug\AndroidManifest.xml:76: AAPT: error: resource drawable/app_icon (aka com.domain.projectname:drawable/app_icon) not found.

This is part of the original (not the merged) manifest:

...<application android:theme="@style/UnityThemeSelector" android:icon="@drawable/app_icon" android:label="@string/app_name" android:largeHeap="true">
        <!-- The MessagingUnityPlayerActivity is a class that extends
         UnityPlayerActivity to work around a known issue when receiving
         notification data payloads in the background. -->
        <activity android:name="com.google.firebase.MessagingUnityPlayerActivity"
                  android:label="@string/app_name"
                  android:icon="@drawable/app_icon"
                  android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
        </activity>...

that android:icon="@drawable/app_icon" inside the activity tag is causing the problem. If I remove it, the build is successful, but the app crashes on start. If I change the @drawable to @mipmap, the app still crashes. Logs from logcat give no usefull info either:

Caused by: java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
        at com.google.android.gms.common.internal.zze.zzw(Unknown Source)
        at com.google.android.gms.common.internal.zzi.zzamc(Unknown Source)
        at com.google.android.gms.common.internal.zzh.handleMessage(Unknown Source)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:211)
        at android.app.ActivityThread.main(ActivityThread.java:5389)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)

Any hints giving me a better understandig about this situation would be appreciated.

Upvotes: 1

Views: 5669

Answers (2)

Ali R
Ali R

Reputation: 1

I had this problem when I updated my project to latest version of unity. It took me much time to find the problem. Simply replace @drawable with @mipmap in AndrdoidManifest.xml in plugin folder.

Upvotes: 0

fluff
fluff

Reputation: 31

I just had these same problems. Upon crash, my log tells me that it's caused by

08-21 16:34:17.202 14578 14578 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.company.gamename/com.google.firebase.MessagingUnityPlayerActivity}: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.MessagingUnityPlayerActivity" on path: DexPathList[[zip file "/data/app/com.company.gamename-1/base.apk"],nativeLibraryDirectories=[/data/app/com.company.gamename-1/lib/arm, /data/app/com.company.gamename-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]

My app stopped crashing when I replaced android:name="com.google.firebase.MessagingUnityPlayerActivity" with android:name="com.unity3d.player.UnityPlayerActivity" in the manifest.

I haven't found a better solution for the icon-issue than removing android:icon="@drawable/app_icon"

Upvotes: 3

Related Questions