Невозможно создать экземпляр получателя com.example.smsmining.GcmBroadcastReceiver: java .lang.ClassNotFoundException: - PullRequest
0 голосов
/ 20 января 2020

Я реализую один сигнал в единстве. Когда я отправляю уведомление от oneSignal в приложении, приложение вылетает и выдает эту ошибку, которая находится в заголовке. Я также пытался .GcmBroadcastReceiver , но выдает ту же ошибку. Вот мой файл meifest.

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
          xmlns:tools="http://schemas.android.com/tools" 
          package="com.deadmosquitogames.androidgoodiesdemo.assetstore"
          android:versionName="1.0" android:versionCode="1" android:installLocation="preferExternal">
    <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true"
                      android:xlargeScreens="true" android:anyDensity="true"/>
    <uses-feature android:glEsVersion="0x00020000"/>
    <supports-gl-texture android:name="GL_OES_compressed_ETC1_RGB8_texture"/>
    <application android:usesCleartextTraffic="true" android:theme="@style/UnityThemeSelector" android:icon="@drawable/app_icon"
                 android:label="@string/app_name" android:debuggable="true" android:isGame="true">
        <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name"
                  android:screenOrientation="fullSensor" android:launchMode="singleTask"
                  android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
                <category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
            </intent-filter>
            <meta-data android:name="unityplayer.UnityActivity" android:value="true"/>
        </activity>


      <receiver android:name="com.example.smsmining.SMSBroadcastReceiver">
        <intent-filter>
          <action android:name="android.provider.Telephony.SMS_RECEIVED"/>
        </intent-filter>
      </receiver>



      <receiver
         android:name="com.example.smsmining.GcmBroadcastReceiver"
         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="com.example.smsmining" />
        </intent-filter>
      </receiver>
      <service android:name="com.example.smsmining.GCMIntentService" />
        <!-- Unity requests all the runtime permissions when you application starts, all in a row. Uncomment these lines to prevent this from happening-->
        <!--<meta-data-->
                <!--android:name="unityplayer.SkipPermissionsDialog"-->
                <!--android:value="true"/>-->
    </application>

    <!-- PERMISSIONS -->
    <uses-permission android:name="android.permission.INTERNET"/>

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
</manifest>

Я использую Unity 2018.2.11f1 и OneSignal-Unity-SDK-2.11.1 .

...