Onesignal没有在apk中找到升级接收器类

时间:2017-06-01 07:32:03

标签: android unity3d onesignal

所以我正在使用Unity 5.6.1和Onesignal(来自网站的最新SDk)构建Android应用程序,当我构建apk时它会崩溃。看着logcat,我看到了这条消息

  

引起:java.lang.ClassNotFoundException:找不到类" com.onesignal.UpgradeReceiver" on path:DexPathList [[zip file" /mnt/asec/com.MyPad3D.MazeWalkVR-2/base.apk"],nativeLibraryDirectories = [/ mnt / asec / com.MyPad3D.MazeWalkVR-2 / lib / arm,/ mnt / herc / com.MyPad3D.MazeWalkVR-2 /base.apk!/ lib / arababi-v7a,/ vendor / lib,/ system / lib]]

我无法理解现在该做什么以及如何进一步调试,任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:0)

你必须在Android的Manifest文件中添加这一行。在其中一个App我也实现了这个One信号。

<receiver android:name="com.onesignal.UpgradeReceiver">
            <intent-filter>
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
            </intent-filter>
        </receiver>

除此之外,您还应该在Android Manifest文件中添加此行。

   <meta-data
                android:name="onesignal_app_id"
                android:value="yyyyssyshsbchdsdavbavbfjvbkfdj" />
            <meta-data
                android:name="onesignal_google_project_number"
                android:value="xxxxxxxxx" />

            <receiver
                android:name="com.onesignal.GcmBroadcastReceiver"
                android:permission="com.google.android.c2dm.permission.SEND">
                <intent-filter>
                    <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                    <category android:name="com.newsreader.sitl" />
                </intent-filter>
            </receiver>
            <receiver android:name="com.onesignal.NotificationOpenedReceiver" />

            <service android:name="com.onesignal.GcmIntentService" />
            <service
                android:name="com.onesignal.SyncService"
                android:stopWithTask="false" />

            <activity
                android:name="com.onesignal.PermissionsActivity"
                android:theme="@android:style/Theme.Translucent.NoTitleBar" />

            <service android:name="com.onesignal.NotificationRestoreService" />

            <receiver android:name="com.onesignal.BootUpReceiver">
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED" />
                    <action android:name="android.intent.action.QUICKBOOT_POWERON" />
                </intent-filter>
            </receiver

>
   <service
            android:name="com.newsreader.notificationHelper.NotificationExtender"
            android:exported="false">
            <intent-filter>
                <action android:name="com.onesignal.NotificationExtender" />
            </intent-filter>
        </service>
        <meta-data android:name="com.onesignal.NotificationOpened.DEFAULT" android:value="DISABLE" />