java.lang.RuntimeException:无法实例化接收器com.tune.TuneTracker

时间:2016-05-30 09:08:58

标签: java android unity3d

我有一个游戏并使用Tune作为分析库。 使用最新的Unity(5.3.4f1)并通过Unity获得apk(没有eclipse / android工作室)。

我的游戏在Playstore中持续了几个月,我观察到一些" app无法打开"使用以下崩溃日志在某些设备上崩溃

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

这是我们的AndroidManifest.xml文件:

<?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>

这里有什么不对?为什么它只在某些设备上崩溃(不是全部)??? 提前谢谢。

1 个答案:

答案 0 :(得分:0)

你的插件正在崩溃你的游戏。

非常接近并发现可能存在问题的东西。

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

Integer应为integer。此外,上面的代码行在你的Manifest中出现了两次。两者都必须修复。甚至不确定你是否应该多次声明它。

要确保不是问题,请直接复制:

<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" />

确保您的SDK中安装了Google Play服务,来自Android SDK Manager。

enter image description here

验证从Unity Android播放器设置禁用了剥离级别。

enter image description here