1

I have a game and using Tune as an analytics library. Using latest Unity (5.3.4f1) and getting apk over Unity (no eclipse/android studio).

My game is in the playstore for several months and I am observing some "app cannot be opened" crashes on some devices with the crash logs below:

java.lang.Error: FATAL EXCEPTION [main]
Unity version : 5.3.4f1
Device model : samsung SM-J700H
Device fingerprint: samsung/j7e3gxx/j7e3g:5.1.1/LMY48B/J700HXXU1AOI3:user/release-keys
Caused by: java.lang.RuntimeException: Unable to instantiate receiver com.tune.TuneTracker: java.lang.ClassNotFoundException: Didn't find class "com.tune.TuneTracker" on path: DexPathList[[zip file "/data/app/fab.gameofwords-1/base.apk"],nativeLibraryDirectories=[/data/app/fab.gameofwords-1/lib/arm, /vendor/lib, /system/lib]]
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2992)
at android.app.ActivityThread.access$1800(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1507)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5910)
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:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.tune.TuneTracker" on path: DexPathList[[zip file "/data/app/fab.gameofwords-1/base.apk"],nativeLibraryDirectories=[/data/app/fab.gameofwords-1/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2987)
... 9 more
Suppressed: java.lang.ClassNotFoundException: com.tune.TuneTracker
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 11 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

And here is our AndroidManifest.xml file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="fab.gameofwords" android:installLocation="preferExternal" android:theme="@android:style/Theme.NoTitleBar" android:versionCode="1" android:versionName="1.0">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:icon="@drawable/app_icon" android:label="@String/app_name" android:debuggable="true">
<meta-data android:name="com.google.android.gms.version" android:value="@Integer/google_play_services_version" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fb577464905719222" />
<provider android:name="android.support.v4.content.FileProvider" android:authorities="fab.gameofwords.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@XML/file_paths" />
</provider>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@String/app_name">
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.unity.FBUnityLoginActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityDialogsActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.LoginActivity" android:configChanges="keyboardHidden|orientation" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true" />
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" />
<activity android:name="com.androidnative.AndroidNativeProxy" android:launchMode="singleTask" android:label="@String/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar">
<activity android:name="com.outlinegames.unibill.PurchaseActivity" android:label="@String/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait" />
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="oauth" android:host="fab.gameofwords" />
</intent-filter>
</activity>
<!--Parse-->
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="fab.gameofwords" />
</intent-filter>
</receiver>
<service android:name="com.parse.ParsePushService" />
<!--End-->
<!--Google Analytics-->
<service android:name="com.google.analytics.tracking.android.CampaignTrackingService" />
<receiver android:name="com.google.analytics.tracking.android.CampaignTrackingReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<!--End-->
<!--Tune-->
<receiver android:name="com.tune.TuneTracker">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<!-- meta-data only needed here if not using Gradle to include the GPS lib -->
<meta-data android:name="com.google.android.gms.version" android:value="@Integer/google_play_services_version" />
<!--End-->
<activity android:name="com.outlinegames.unibill.PurchaseActivity" android:label="@String/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityAppLinkActivity" android:exported="true" />
<activity android:name="com.facebook.unity.FBUnityGameRequestActivity" />
<activity android:name="com.facebook.unity.FBUnityCreateGameGroupActivity" />
<activity android:name="com.facebook.unity.FBUnityJoinGameGroupActivity" />
<activity android:name="com.facebook.unity.AppInviteDialogActivity" />
<provider android:name="com.facebook.FacebookContentProvider" android:authorities="com.facebook.app.FacebookContentProvider577464905719222" android:exported="true" />
<activity android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@String/app_name" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!--<permission android:protectionLevel="signature" android:name="fab.gameofwords.permission.C2D_MESSAGE" />-->
<uses-permission android:name="fab.gameofwords.permission.C2D_MESSAGE" />
<uses-permission android:name="com.android.vending.BILLING" />
</manifest>

What can be wrong here? Why is it only crashing on some devices (not all) ??? Thanks in advance.

turkenh
  • 2,564
  • 3
  • 25
  • 32
  • If using Android Studio, try setting `multiDexEnabled = false` in your `build.gradle` file under the `defaultConfig`. Give it a try and see if this helps. – ishmaelMakitla May 30 '16 at 09:16
  • I am not using Android Studio (as mentioned above) and the bad think is, I can not reproduce issue on my SGS 4 but there are hundreds of crash logs on store with some other devices. – turkenh May 30 '16 at 09:22
  • Not being able to reproduce makes it very difficult indeed. Could you please check selected answer [here](http://stackoverflow.com/questions/29458927/classnotfoundexception-unable-to-instantiate-broadcastreceiver) and the discussion [here](http://stackoverflow.com/questions/3558977/android-broadcast-receiver-error-class-not-found-exception). Hope these point you in the right direction. – ishmaelMakitla May 30 '16 at 09:37

1 Answers1

0

Your plugin is crashing your game.

Looked very close and found something that may be the problem.

<meta-data android:name="com.google.android.gms.version" android:value="@Integer/google_play_services_version" />

Integer should be integer. Also, that line of code above appeared twice in your Manifest. Both of them must be fixed. Not even sure if you should have it declared multiple times.

To make sure that is not the problem, copy this directly:

<receiver android:name="com.tune.TuneTracker">       
        <intent-filter>      
            <action android:name="com.android.vending.INSTALL_REFERRER" />       
        </intent-filter> 
    </receiver>
    <!-- meta-data only needed here if not using Gradle to include the GPS lib -->
    <meta-data android:name="com.google.android.gms.version"
               android:value="@integer/google_play_services_version" />

Make sure that Google Play Services is installed in your SDK, from the Android SDK Manager.

enter image description here

Verify that Stripping Level is Disabled from Unity Android Player Settings.

enter image description here

Programmer
  • 121,791
  • 22
  • 236
  • 328