Android, apk installation INSTALL_FAILED_POLICY_REJECTED_PERMISSION - java

I'm trying to install application using Android Studio, I manage to install other apps except this app, when I try to install it I get few errors within the Logcat following by INSTALL_FAILED_POLICY_REJECTED_PERMISSION alert, I'm not sure what error relates to the main problem(not able to install the app) but here they are:
2 times the following error:
com.example.appName has no certificates at entry AndroidManifest.xml; ignoring!
after that there are 2 times:
getAuthToken called with non existant account: myoldemail#gmail.com
Failed to get auth token: no such account
android.accounts.AuthenticatorException: no such account
And finally I get an alert with INSTALL_FAILED_POLICY_REJECTED_PERMISSION.
To be precise(there was an app with the same name long ago so it might make sense, but anyway clicking ok fail to install the apk):
Installation failed with message INSTALL_FAILED_POLICY_REJECTED_PERMISSION.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.
WARNING: Uninstalling will remove the application data!
Do you want to uninstall the existing application?
Edit:
I factory reset the device, and btw, it's an 4.4.4 Note 4 device and same error, so it should be the app or something with the build.
Furthermore, I removed all my accounts, removed the email app, I did probably everything online but still, same error.
Edit:
First, it's working on emulators, now, here are some more details, the manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.appName">
<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.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<permission
android:name="com.example.appName.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.appName.permission.C2D_MESSAGE" />
<application
android:name=".AppClass"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<!-- https://github.com/ParsePlatform/Parse-SDK-Android/issues/39 -->
<meta-data
android:name="com.parse.push.gcm_sender_id"
android:value="id:1057382563338" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<activity
android:name=".activities.MainActivity"
android:label="AppName"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.RegistrationActivity"
android:label="Registration"
android:parentActivityName=".activities.MainActivity"
android:theme="#style/AppTheme.NoActionBar">
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.MainActivity" />
</activity>
<activity
android:name=".activities.TouActivity"
android:label="Terms of use"
android:parentActivityName=".activities.MainActivity"
android:theme="#style/AppTheme.NoActionBar">
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.MainActivity" />
</activity>
<activity
android:name=".activities.PPActivity"
android:label="Privacy policy"
android:parentActivityName=".activities.MainActivity"
android:theme="#style/AppTheme.NoActionBar">
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.MainActivity" />
</activity>
<activity
android:name=".activities.DashboardActivity"
android:label="Dashboard"
android:launchMode="singleTop"
android:theme="#style/AppTheme.NoActionBar" />
<activity
android:name=".activities.PassChangeActivity"
android:label="Password change"
android:parentActivityName=".activities.DashboardActivity"
android:theme="#style/AppTheme.NoActionBar">
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.DashboardActivity" />
</activity>
<receiver android:name=".gps.GpsLocationReceiver">
<intent-filter>
<action android:name="android.location.PROVIDERS_CHANGED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<receiver
android:name=".utils.CustomPushReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
<service android:name="com.parse.PushService" />
<!-- This receiver calling PushService defined above -->
<receiver
android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<!-- Receive the actual message -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receive the registration id, http://stackoverflow.com/questions/22217601/is-com-google-android-c2dm-intent-registration-deprecated -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example.appName" />
</intent-filter>
</receiver>
</application>
</manifest>
As for my dependencies:
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.facebook.android:facebook-android-sdk:4.15.0'
compile 'com.parse:parsefacebookutils-v4-android:1.10.4#aar'
compile 'com.parse:parse-android:1.13.1'
compile 'com.parse:parsetwitterutils-android:1.10.5'
compile 'com.android.support:cardview-v7:24.2.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.jakewharton.rxbinding:rxbinding-appcompat-v7:0.4.0'
compileSdkVersion+targetSdkVersion is set to 24 and minSdkVersion is set to 19

First thing that comes to mind is a device admin application is on your phone. This is usually the case for phones used in enterprise setting. The app forces certain policies for your phone. https://developer.android.com/reference/android/app/admin/DevicePolicyManager.html
As you already removed all your (exchange) email, my next guess is could be a problem within your app. There are few libraries/tools out there that require developer phones to work properly. Would you be able to share your manifest or/and dependencies to give us a better picture of your app?

Do you have Knox installed on the device? I had a similar issue and Samsung Knox was the reason why I was getting the rejection. After I disabled Knox, I was allowed to install the .apk.
Also, have you checked that you have 'Unknown Sources' allowed? I assume you do since you have been able to install other apps, but I am curious what it is set to.
Do you know if the .apk is properly signed and aligned and all that?

After I updated Android Studio and Gradle it's working, I assume it was Gradle(was v2.1.3 and now v2.2.0).
Btw, after I updated android studio I was requested(by the new android studio version) to download API 19(minSdkVersion) platform tools, I don't know if it's relates but just wanted to point that out.
Edit: after I checked with the old gradle version v2.1.3 the problem is back so it looks like the problem was gradle(v2.1.3), when upgraded to v2.2.0 there is no problem at all.

Related

App is not compatible with TVs on closed testing in the Google Play. This item is not compatible with your device

I'm developing an app for Android TV and TV-boxes.
My problem is that Android TV devices are available for installing my app from Google Play for internal testing, but NOT available for closed testing (but it still can be installed on the smartphones).
Screenshot: Google Play install dialog
My app starting from StartScreenActivity (it's splash screen).
The QUERY_ALL_PACKAGES is required for my app and declared.
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />
<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:banner="#mipmap/appbanner">
<activity
android:name=".ui.presentation.StartScreenActivity"
android:exported="true"
android:launchMode="singleTask"
android:screenOrientation="landscape"
android:theme="#style/SplashTheme">
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.presentation.MainActivity"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="landscape"
android:exported="false">
</activity>
</application>
</manifest>
On the internal testing it works like expected, but no one can to install an app to TV on the close testing. Setting the android.software.leanback as required not helped - it just making all others devices not available for install.
What am I doing wrong? Please advise.
It was non-obvious, but all you need is to add Android TV form factor to the Google Play Console:
Release -> Advanced Settings -> Form Factors -> Add
How to add the form factor to the Play Console
I waited over 24 hours before my application was approved.
Now all TV devices are available.

Reason for not being able to search the app-specific files in Android and solution

I am building a react native app which includes pdf file download and image upload functionality.
For doing file download, I am using react-native-fs and react-native-html-to-pdf and for image upload, I am using the axios and react-native-image-crop-picker.
I have already implemented the image upload functionality long time ago and it worked like charm.
In these days, I have implemented the pdf file download functionality and also it works well.
PROBLEM
Image upload does not work anymore.
Error message which is logged by react-native log-android looks like this:
Network error
_response: 'Could not retrieve file for uri /storage/emulated/0/Android/data/packageName/files/Pictures/75a08b1a-98de-4811-8b44-453f6f2f9bf8.jpg',
Downloaded pdf file is exist in app-specific folder but not discoverable in Android file manager.
Download pdf file path is like this: /storage/emulated/0/Android/data/packageName/files/data/user/0/packageName/files/fileName.pdf and I have checked this is definitely exist in exact directory.
Other apps(apks) specific files are discoverable in Android file manager.
What I am wondering is
Why only my react native package directory is not able to discoverable in file manager while even other app specific files are able?
Which setup I have missed or done incorrect?
What I did for test image upload
This functionality worked well so I have downloaded old committed version from Github and rebuild all of app. and tried to upload the image, but the same issue appeared.
What I assumed is
I can remember I have run command line related with adb with tcp port for fix issues long time ago.(I cannot remember what that command line is, I did google and run command line), I am assuming if that might be a problem.
All of the problem files are exist in the same directory: app specific directory which is allocated by android. I have read this android development documentation.
so what I think is First, react native request an image to android phone and Second, android phone have no access to the package folder, Third, so android phone could not get that image and return Network error: could not retrieve image file.
Android phone has no permission to access the react native package directory so could not find the pdf file in file manager.
Actual codes
AndroidMainfest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="packageName">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front" android:required="false"/>
<application android:name=".MainApplication" android:label="#string/app_name" android:icon="#mipmap/ic_launcher" android:roundIcon="#mipmap/ic_launcher_round" android:allowBackup="false" android:theme="#style/AppTheme" android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true">
<activity android:exported="true" android:name=".MainActivity" android:label="#string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<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="invitation"/>
</intent-filter>
<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:host="deeplinkUrl"
android:scheme="https"/>
</intent-filter>
</activity>
<!-- Facebook login -->
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<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="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="#string/facebook_client_token"/>
<!-- Facebook login -->
</application>
<queries>
<intent>
<action android:name="android.intent.action.VIEW"/>
<data android:mimeType="*/*"/>
</intent>
</queries>
</manifest>
android\app\src\main\res\xml\filepaths.xml (this is for android 11: this also copied from github issues forum)
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="appdownloads" path="Download/" />
<external-path name="files" path="/" />
<root-path name="root" path="." />
</paths>
I think this is related to Android and local pc device.
it would be nice if you can let us know about your development environment

Map activity does not show up in my phone because I have many activities [duplicate]

This question already has answers here:
Ensure that the "Google Maps Android API v2" is enabled. I am getting this error when I try to Implement Google Maps
(15 answers)
Closed 5 years ago.
I created new activity which is map activity. I think I have problem in AndroidManofest.xml.
My phone works perfectly if I create new project with just map activity. If I add it to my project, which has a lot of activities, it does not work. I do not know why.
the problem is about the activities
AndroidManofest.xml
I checked every thing APU is enable
AndroidManofest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.abdullahalhajri.smarttutor">
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".activities.LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.RegisterActivity"
android:screenOrientation="portrait" />
<activity
android:name=".activities.HomePage"
android:screenOrientation="portrait" />
<activity
android:name=".activities.SearchPage"
android:screenOrientation="portrait" />
<activity
android:name=".activities.SearchRating"
android:screenOrientation="portrait" />
<activity
android:name=".activities.SearchSubject"
android:screenOrientation="portrait" />
<activity
android:name=".activities.MathTutor"
android:screenOrientation="portrait" />
<activity
android:name=".activities.ReviewComment"
android:screenOrientation="portrait" />
<activity
android:name=".activities.TutorProfile"
android:screenOrientation="portrait" />
<activity
android:name=".activities.UsersActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
<activity
android:name=".activities.MapsActivity"
android:label="#string/title_activity_maps">
</activity>
</application>
</manifest>
Error
12-04 04:31:22.639 25820-26431/com.example.abdullahalhajri.smarttutor E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
API Key: <<redacted>>
change your google Map API key. you cant use Same Api key in different projects
Use backup key:
<meta-data
android:name="com.google.android.backup.api_key"
android:value="backupkey" />
Go to the Google Developer console then click on the 'Enable API's and Services' option along with plus icon on the top of the Dashboard tab.Then there is a 'Google Maps Api' option under the Maps Category,select that then there is 'Manage' option which will enable your google maps apis.
After then you can create the map key for your project using your package name and then use it in your manifest.
Note- After using key please reinstall your app ones to reflect the map changes.

GCM receiver package not found

I'm studying GCM (Google Cloud Messaging, old deprecated name is C2DM). I use different devices . operations run well , even if app is closed . but on nexus tablet, an error occurs when app is closed. if app is in progress , my GCM codes works on all devices that I try .
Now : I looked for these problem and I found there was an error manifests of others . If my manifest is wrong , why do ohter devices except nexus tablet, execute my codes properly ?
Could I think that my manifest is wrong?
this is my manifests :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.borda.C2DM"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<permission android:name="android.borda.C2DM.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="android.borda.C2DM.permission.C2D_MESSAGE" />
<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.google.android.gcm.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="android.borda.C2DM" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
</application>
</manifest>
an error occurs when app is closed
What kind of error?
If you just can't receive gcm messages in your app (android 3.1+) when app is closed - take look on that question.

How to fix INSTALL_PARSE_FAILED_MANIFEST_MALFORMED in my android application

Hi I am trying to experiment with gcm but unable to make it work. Don't know where I am messing with it, below is the error I am getting. I am trying to deploy my application directly on device and debug from there but when ever I try to deploy it gives this error
Waiting for device.
Target device: HT24LW108632
Uploading file
local path: D:\Data\Android\AndroidTest\out\production\AndroidTest\AndroidTest.apk
remote path: /data/local/tmp/Android.Test
Installing Android.Test
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/Android.Test"
pkg: /data/local/tmp/Android.Test
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Android.Test"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="14"/>
<permission
android:name="Android.Test.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="Android.Test.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application android:label="#string/app_name" android:icon="#drawable/ic_launcher">
<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>
</activity>
<receiver
android:name="com.google.android.gcm.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="Android.Test" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
</application>
</manifest>
My Device is HTC OneX
Android Version: 4.03
HTC Sense Version: 4.0
Software number: 1.29.110.11
HTC SDK API Level: 4.12
HTC Extension version: HTCExtension_403_1_GA_7
Please guide as I am new fish in Android Sea.
Edit-1:
I have noticed that if I comment this below line then application does deploy and execute but obviously I cant go forward without below mentioned permission ... please help....
<permission android:name="Android.Test.permission.C2D_MESSAGE" android:protectionLevel="signature" />
Change name package with Caps letters to little letters.
Change your
android:name="MainActivity"
TO
android:name=".MainActivity"
OR add the fully qualified package name in lowercase before your class name
android:name="thepackage.MainActivity"
Do change all the attributes named as android:name inside the activity tags as I suggested.
Instead of:
<permission android:name="android.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
to:
<uses-permission android:name="android.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
Try that.
<activity android:name="MainActivity"
should be formed like
<activity android:name="com.company.appname"
to do this without errors go to package (right click) > android tools > rename app package
try to write activity name follow by "."
Instead of
<activity android:name="MainActivity"
android:label="#string/app_name">
use
<activity android:name=".MainActivity"
android:label="#string/app_name">
I met this same issue in android studio
what solve this is to let company domain to be all small letters,
There's issue about this: http://code.google.com/p/android/issues/detail?id=37658
Capital letters can't be used in package names within permissions. You got (same as me) into difficult situation when you have deployed application with package name like this and you need to use GCM.
I tried to use some kind of short form of permission:
<permission android:name=".permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name=".permission.C2D_MESSAGE" />
I also defined service in the same way. It had to be in application package.
It worked on Android 4.3. Probably on 4.2 also. I know that on 4.0.3 it didn't.
make sure your package name is in small letters...
worked for me
write the java package name and all folders name in lowercase, it will work fine...
In my case I was mentioned the package name in small letters only. But for few of the activities I named it with partial name i.e android:name=".ContactUs" . After I solved it by prefixing full package name before all the activity name, service name and broadcast provider name in Manifest file.
Working code
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="vcan.doit.com">
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.DesignDemo">
<activity
android:name="vcan.doit.com.LoginActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="vcan.doit.com.MainActivity"
android:theme="#style/Theme.DesignDemo" />
<activity
android:name="vcan.doit.com.CheeseDetailActivity"
android:parentActivityName="vcan.doit.com.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="vcan.doit.com.MainActivity" />
</activity>
<service android:name="vcan.doit.com.PushNotification.MyAndroidFirebaseMsgService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name="vcan.doit.com.PushNotification.MyAndroidFirebaseInstanceIdService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<activity
android:name="vcan.doit.com.AboutUs"
android:label="#string/abt_us"
android:parentActivityName="vcan.doit.com.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="vcan.doit.com.MainActivity" />
</activity>
<activity
android:name="vcan.doit.com.ContactUs"
android:label="#string/contact_us"
android:parentActivityName="vcan.doit.com.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="vcan.doit.com.MainActivity" />
</activity>
<activity android:name="vcan.doit.com.WriteToUs"
android:label="#string/write_us"
android:parentActivityName="vcan.doit.com.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="vcan.doit.com.MainActivity" />
</activity>
</application>
I had this problem. My device memory was full. I solved my problem with freeing device memory.
For Android 12 (Android ", API Level 31) you can find this same error because of behavioural changes.
To get rid of it you must add android:exported="true" (or false*) to any <activity>, <activity-alias>,<service>, or <receiver> components that have <intent-filter>s declared in the app’s AndroidManifest.xml file.
* More info: Related official documentation

Categories