Unable to instantiate receiver com.example.smsmining.GcmBroadcastReceiver: java.lang.ClassNotFoundException: - android

I am implementing one signal in unity. When i send notification from oneSignal in app the app crashes and gives this error that is in heading.I also tried .GcmBroadcastReceiver but it gives the same error. Here is my meifest file .
<?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>
i am using Unity 2018.2.11f1 and OneSignal-Unity-SDK-2.11.1.

Related

Increase compatibility list for Google Play Store

My published app has support for only 349 devices. I'd very much like to extend that. I realise the minimum sdk version of 16 negates quite a number. Is there anything else I could change in my AndroidManifest that might greatly increase the coverage? It doesn't support the Nexus 5x running Android 6.0.1 for example. I'd very much like to know why. Also is it possible to just update the manifest without updating/versioning the app?
<?xml version="1.0" encoding="UTF-8"?>
<manifest android:versionName="0.0.11" android:versionCode="114" android:hardwareAccelerated="true" package="com.theexample.example" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:targetSdkVersion="23" android:minSdkVersion="16"/>
<supports-screens android:xlargeScreens="true" android:smallScreens="true" android:resizeable="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<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="com.google.android.c2dm.permission.RECEIVE"/>
<permission android:name="com.theexample.example.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
<uses-permission android:name="com.theexample.example.permission.C2D_MESSAGE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<application android:hardwareAccelerated="true" android:supportsRtl="true" android:label="#string/app_name" android:icon="#drawable/icon">
<activity android:name="com.theexample.example.MainActivity" android:label="#string/activity_name" android:windowSoftInputMode="adjustResize" android:theme="#android:style/Theme.DeviceDefault.NoActionBar" android:screenOrientation="portrait" android:launchMode="singleTop" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale">
<intent-filter android:label="#string/launcher_name">
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="com.adobe.phonegap.push.PushHandlerActivity" android:exported="true"/>
<receiver android:name="com.adobe.phonegap.push.BackgroundActionButtonHandler"/>
<receiver android:name="com.google.android.gms.gcm.GcmReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<category android:name="com.theexample.example"/>
</intent-filter>
</receiver>
<service android:name="com.adobe.phonegap.push.GCMIntentService" android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
<service android:name="com.adobe.phonegap.push.PushInstanceIDListenerService" android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<service android:name="com.adobe.phonegap.push.RegistrationIntentService" android:exported="false"/>
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity" android:theme="#android:style/Theme.Translucent.NoTitleBar" android:exported="false"/>
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version"/>
<provider android:name="com.google.firebase.provider.FirebaseInitProvider" android:exported="false" android:initOrder="100" android:authorities="com.theexample.example.firebaseinitprovider"/>
</application>
</manifest>
The issue occurred as I had inadvertently built the install for x86. I modified the build.gradle file setting ext.cdvBuildMultipleApks = false and rebuilt it.

Android app not compatible by any device

We have published an iOS version of our app successfully, but Android is failing. We have deployed it into the Google Play store, but there we get the message that it is compatible with 0 Android devices (which is not a good thing obviously). The following file is the AndroidManifest.xml file found in the APK after compilation on PhonegapBuild (so this is the APK we send to the Google Play store).
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" android:windowSoftInputMode="adjustPan" package="com.myapp.mobileapp" platformBuildVersionCode="22" platformBuildVersionName="5.1.1-1819727">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.RECORD_VIDEO"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera"/>
<uses-feature android:name="android.hardware.camera.autofocus"/>
<uses-feature android:name="android.hardware.camera.setParameters"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<permission android:name="com.myapp.mobileapp.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
<uses-permission android:name="com.myapp.mobileapp.permission.C2D_MESSAGE"/>
<application android:hardwareAccelerated="true" android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:configChanges="locale|keyboard|keyboardHidden|orientation|screenSize" android:label="#string/app_name" android:name="com.myapp.mobileapp.myapp" android:screenOrientation="portrait" android:windowSoftInputMode="adjustUnspecified|stateUnspecified">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<data android:scheme="myapp"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
</activity>
<activity android:label="#string/app_name" android:name="com.keith.canvascameraplugin.CanvasCameraView" android:theme="#android:style/Theme.Black.NoTitleBar"/>
<receiver android:enabled="true" android:name="com.google.android.gms.analytics.AnalyticsReceiver">
<intent-filter>
<action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH"/>
</intent-filter>
</receiver>
<service android:enabled="true" android:exported="false" android:name="com.google.android.gms.analytics.AnalyticsService"/>
<receiver android:exported="true" android:name="com.google.android.gms.analytics.CampaignTrackingReceiver">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<service android:name="com.google.android.gms.analytics.CampaignTrackingService"/>
<activity android:exported="true" android:name="com.adobe.phonegap.push.PushHandlerActivity"/>
<receiver android:exported="true" android:name="com.google.android.gms.gcm.GcmReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<category android:name="com.myapp.mobileapp"/>
</intent-filter>
</receiver>
<service android:exported="false" android:name="com.adobe.phonegap.push.GCMIntentService">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
<service android:exported="false" android:name="com.adobe.phonegap.push.PushInstanceIDListenerService">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<service android:exported="false" android:name="com.adobe.phonegap.push.RegistrationIntentService"/>
<meta-data android:name="com.facebook.scom.ApplicationId" android:value="#string/fb_app_id"/>
<meta-data android:name="com.facebook.scom.ApplicationName" android:value="#string/fb_app_name"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize" android:label="#string/fb_app_name" android:name="com.facebook.FacebookActivity" android:theme="#android:style/Theme.Translucent.NoTitleBar"/>
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version"/>
<provider android:authorities="com.myapp.mobileapp.google_measurement_service" android:exported="false" android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"/>
<receiver android:enabled="true" android:name="com.google.android.gms.measurement.AppMeasurementReceiver">
<intent-filter>
<action android:name="com.google.android.gms.measurement.UPLOAD"/>
</intent-filter>
</receiver>
<service android:enabled="true" android:exported="false" android:name="com.google.android.gms.measurement.AppMeasurementService"/>
</application>
</manifest>
The funny thing is that a local build of the app works on my Android device, but it does not work after sending it to PhonegapBuild and then send it to Google Play store. Also worth mentioning is the fact that I can run it on my device from PhonegapBuild, but not from the Google Play store.
Some other facts: the app is build using Ionic (and PhonegapBuild).
What am I doing wrong here?

How to integrate AndroidManifest.xml?

So I need to integrate unity with android feature like connect to 3rd party app.
So I made .apk build after working at eclipse, but how to integrate between 2 AndroidManifest files?
First reference one is,
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mygame.plugin"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="ka67492508561297" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.kakao.unity.plugin.ThirdPartyPostStoryActivity" android:windowSoftInputMode="stateAlwaysVisible" android:theme="#android:style/Theme.Translucent.NoTitleBar"/>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
and the main one my game currently uses is
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mygame.mygame1"
android:installLocation="preferExternal"
android:theme="#android:style/Theme.NoTitleBar"
android:versionCode="2"
android:versionName="1.01">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="22" />
<application
android:allowBackup="true"
android:icon="#drawable/app_icon"
android:label="#string/app_name">
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version"/>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="ka7492508561297" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.unity3d.player.UnityPlayerProxyActivity"
android:launchMode="singleTask"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:launchMode="singleTask"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
android:launchMode="singleTask"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<activity android:name="org.onepf.openiab.UnityProxyActivity"
android:launchMode="singleTask"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.ka.unity.plugin.ThirdPartyPostStoryActivity" android:windowSoftInputMode="stateAlwaysVisible" android:theme="#android:style/Theme.Translucent.NoTitleBar"/>
</application>
<uses-permission android:name="com.android.vending.BILLING"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.sec.android.iap.permission.BILLING"/>
<uses-permission android:name="org.onepf.openiab.permission.BILLING"/>
So I merged reference one to my main one like above,
But error says,
[UnityException: Unable to start activity!
No activity in the manifest with action MAIN and category LAUNCHER. Try launching the application manually on the device.]
I still can make .apk file, and can run on my phone, but can't connect to 3rd party app when in-game button touched that should launch connection.
So strange... how should I fix?
Thanks.

PhoneGap Android orientation change takes the app one page back

I'm developing a simple Android app on PhoneGap where the users can calculate their GPA's and CGPA's.
I sense something strange happening. Whenever the user tilts the screen and shifts from portrait to landscape mode, the app goes back to the previous page as if the back button was pressed.
This is how my manifest file looks,
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.firstVersion"
android:versionCode="3"
android:versionName="1.2" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="17" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true"
android:resizeable="true"
android:anyDensity="true"
/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:configChanges="orientation|keyboardHidden"
android:allowBackup="true"
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.firstVersion.MainActivity"
android:label="#string/app_name" >
android:launchMode="singleTop"
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="org.apache.cordova.DroidGap"
android:label="#string/app_name"
android:configChanges="orientation|keyboardHidden">
<intent-filter></intent-filter>
</activity>
<receiver android:name="com.phonegap.plugin.localnotification.AlarmReceiver" >
</receiver>
<receiver android:name="com.phonegap.plugin.localnotification.AlarmRestoreOnBoot" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver android:name="com.bicrement.plugins.localNotification.AlarmReceiver" >
</receiver>
<receiver android:name="com.bicrement.plugins.localNotification.AlarmRestoreOnBoot" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
</manifest>
Add android:configChanges under each activity tag not in application tag as you written in application tag and skip it to MainActivity tag
Try This:-
<activity
android:name="com.example.firstVersion.MainActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard|locale"
android:label="#string/app_name">

ClassPathNotFound error at the beginning of install?

I keep getting this error at the beginning of install. Once its installed the application then works.
Here is the error if anyone is familiar with it please let me know.
java.lang.ClassNotFoundException: com.admob.android.ads.analytics.InstallReceiver in loader dalvik.system.PathClassLoader[/data/app/com.fttech.books-1.apk]
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fttech.books"
android:versionCode="2"
android:versionName="2.0">
<uses-sdk android:minSdkVersion="4" />
<uses-sdk android:targetSdkVersion ="11" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application android:icon="#drawable/bookicon" android:label="#string/app_name">
<activity android:name=".main"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.admob.android.ads.analytics.InstallReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<activity android:name=".creat"></activity>
<activity android:name=".view" ></activity>
<activity android:name=".shopFor" android:theme="#android:style/Theme.NoTitleBar"></activity>
<activity android:name=".DbAdapter"></activity>
<activity android:name=".Lookup" android:theme="#android:style/Theme.NoTitleBar" android:label="#string/app_name"></activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>
<activity android:name=".myAdmob"/>
</application>
<supports-screens android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />
</manifest>
From the error and your manifest it seams that the system doesn't know the com.admob.android.ads.analytics.InstallReceiver-Receiver.
I found this post, which treats the same error.

Categories

Resources