App installation fails in Android 12 devices - android

Our app fails to install after migrating to the targetSdkVersion 31. On trying to find the issue we found that a library was using FLASHLIGHT permission and we were getting this error while installing:
Installation failed due to: 'Failed to commit install session
130765275 with command cmd package install-commit 130765275. Error:
-127: Package com.xxxx.yyyy.zzzz attempting to declare permission android.permission.FLASHLIGHT in non-existing group
android.permission-group.HARDWARE_CONTROLS'
Permissions used in the manifest file of library:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<permission
android:name="android.permission.FLASHLIGHT"
android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
android:protectionLevel="normal" />
Is there any workaround to this issue?

android.permission-group.HARDWARE_CONTROLS is deprecated in targetSdkVersion 31 . The work around is to remove the permission used by library in your manifest by
<permission
android:name="permissionOne"
tools:node="remove"
tools:selector="com.example.lib1">
tools:node="remove"
will remove the permission from the App if its used in any of your libraries

Related

while using flutter `esc_pos_bluetooth` showing error `Error starting scan. ` only in android 12. no problem below android 10

Showing error while running in esc_pos_bluetooth in flutter I added permission in manifest page like this.
<uses-permission android: name="android.permission.BLUETOOTH" android:maxSdkVersion="31" tools:targetApi="donut" /> <uses-permission android: name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="31" tools:targetApi="donut" /> <uses-permission android: name="android.permission.BLUETOOTH_SCAN" tools:targetApi="31" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="31" tools:targetApi="donut" /> <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" /> <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" android:maxSdkVersion="31" tools:targetApi="donut" /> <uses-permission android: name="android.permission.ACCESS_COARSE_LOCATION" />.
And still having the error.
Error starting scan. E/flutter (16326): [ERROR: flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: Platform Exception(startscan, Need android.permission.BLUETOOTH_SCAN permission for android.content.AttributionSource#8a7ab34e: GattService register Scanner, null, null).
this problem is only showing in android 10 or above devices only. under android 10 version phones support this smoothly and showing near devices also.
Using 0.4.1 with the following manifest on a real device works for me:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-feature android:name="android.hardware.bluetooth" android:required="true"/>
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
What you are missing is the uses-feature flag. Check it out here
You can also read about hickups für Bluetooth < 12.0 on Android here

Google Play Console - Android Bundle Permissions problem

I created my first android app in Expo, that i made the eject later on. I created the bundle and uploaded to the Google Play console, but in the list permissions appears:
android.permission.ACCESS_BACKGROUND_LOCATION,
android.permission.ACCESS_COARSE_LOCATION,
android.permission.ACCESS_FINE_LOCATION,
android.permission.ACCESS_NETWORK_STATE,
android.permission.ACCESS_WIFI_STATE,
android.permission.CAMERA,
android.permission.FOREGROUND_SERVICE,
android.permission.INTERNET,
android.permission.READ_APP_BADGE,
android.permission.READ_EXTERNAL_STORAGE,
android.permission.RECEIVE_BOOT_COMPLETED,
android.permission.SYSTEM_ALERT_WINDOW,
android.permission.WAKE_LOCK,
android.permission.WRITE_EXTERNAL_STORAGE,
android.permission.WRITE_SETTINGS,
com.anddoes.launcher.permission.UPDATE_COUNT,
com.android.vending.CHECK_LICENSE,
com.google.android.c2dm.permission.RECEIVE,
com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE,
com.google.android.gms.permission.ACTIVITY_RECOGNITION,
com.google.android.providers.gsf.permission.READ_GSERVICES,
com.htc.launcher.permission.READ_SETTINGS,
com.htc.launcher.permission.UPDATE_SHORTCUT,
com.huawei.android.launcher.permission.CHANGE_BADGE,
com.huawei.android.launcher.permission.READ_SETTINGS,
com.huawei.android.launcher.permission.WRITE_SETTINGS,
com.majeur.launcher.permission.UPDATE_BADGE,
com.oppo.launcher.permission.READ_SETTINGS,
com.oppo.launcher.permission.WRITE_SETTINGS,
com.sec.android.provider.badge.permission.READ,
com.sec.android.provider.badge.permission.WRITE,
com.sonyericsson.home.permission.BROADCAST_BADGE,
com.sonymobile.home.permission.PROVIDER_INSERT_BADGE,
me.everything.badger.permission.BADGE_COUNT_READ,
me.everything.badger.permission.BADGE_COUNT_WRITE
But in my AndroidManifest.xml i only have this:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission tools:node="remove" android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.camera.front" android:required="false" />
Can anybody help me? Thanks!
Ok, I checked that the permissions that appear are merged with my AndroidManifest.xml in the build. These are permissions required by packages that I added to my project. To help check which packages are needed I go to android > app > build > outputs > logs > manifest-merger-release-report.txt.
Hope it help others with the same problem :)

The Play Console asks me to remove the location permission in every version

I have a special application for kids on the Play Console. I'm trying to update with the new version. However, I keep getting the following error.
I'm even trying to submit a pre-approved version from the library for review, but it shows the same error without submitting for review.
If your target audience only includes children under 13, you should remove the request for location permission from your app. Please go to the app content section.
I searched for my application code and sub-libraries, but location information is not accessed in any way.
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
This is the case with permissions perceived for apk in the app package explorer on the Play Console.
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
tools:node="remove" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"
tools:node="remove"/>
add this to your manifest then try it will solve your problem.

cordova build android AndroidManifest.xml bad lines

I'm extending an ios app to the android platform - I'm unfamiliar with the android tools but following the tuts.
I have added the platform but when I run the 'cordova build android' I get errors on the AndroidManifest.xml
When I trace this it seems that lines are being added in the uses-permission section (see the last 3) that have no android namespace
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission name="android.permission.READ_PHONE_STATE" />
if I add the namespace and rebuild, the error becomes one of duplication. If I delete the offending lines, then the rebuild just re-writes them.
The ios version of my app works perfecto, so I'm assuming its something to do with how the plugins write to this file on android build.
Before I start to debug by unpicking the plugins, has anyone else been here before and resolved it, and are hungry for upvotes?
I am afraid you need to setup the issue manually as that is not resolved yet, its still alive.
You have to open your plugins/android.json and remove the duplicate keys in there. In your case search for WRITE_EXTERNAL_STORAGE, MODIFY_AUDIO_SETTINGS, READ_PHONE_STATE in android.json and remove the duplicates.
Then open up platforms/android/AndroidManifest.xml and remove the duplicate <uses-permission... /> tags. And then rebuild and try again.

Android : INSTALL_FAILED_MISSING_FEATURE

I got error INSTALL_FAILED_MISSING_FEATURE while installing my apps in emulator. I am unable to find out the where is the error. My app consists of both GPS & Camera features.
I am not getting where I am wrong. Is it problem with ANDROID MANIFEST????
Please Help me out due to this I am unable to deliver my app.Thank you
Updated
I am getting this error while installing in CONSOLE
[2012-03-16 11:24:50 - DemoCamGPS] Installation error: INSTALL_FAILED_MISSING_FEATURE
[2012-03-16 11:24:50 - DemoCamGPS] Please check logcat output for more details.
[2012-03-16 11:24:50 - DemoCamGPS] Launch canceled!
Here My logcat output details
03-16 11:24:49.351: W/PackageManager(59): Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone
03-16 11:24:49.361: W/PackageManager(59): Not granting permission android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS to package com.android.browser (protectionLevel=2 flags=0x1be45)
03-16 11:24:49.361: W/PackageManager(59): Unknown permission com.google.android.gm.permission.WRITE_GMAIL in package com.android.settings
03-16 11:24:49.370: W/PackageManager(59): Unknown permission com.google.android.gm.permission.READ_GMAIL in package com.android.settings
03-16 11:24:49.381: W/PackageManager(59): Unknown permission com.android.providers.im.permission.READ_ONLY in package com.google.android.apps.maps
03-16 11:24:49.381: W/PackageManager(59): Unknown permission com.google.android.pushmessaging.permission.RECEIVE in package com.google.android.apps.maps
Here My ANDROID MANIFEST file
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.CAMERA" />
<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.VIBRATE" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" >
</uses-permission>
<uses-feature android:name="android.hardware.camera" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.flash"
android:required="false" />
<uses-feature android:name="android.hardware.screen.landscape" />
<uses-feature
android:name="android.hardware.wifi"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-library android:name="com.google.android.maps" />
Please find out any wrong uses-feature ..
Can you post your manifest file? You're trying to use a feature( <uses-feature> ) the emulator doesn't have. My guess would be the camera.
Debug this by removing each uses-feature line one at a time until it installs without the error. The last line you removed will be the one causing this.
Are you using Google Maps, geocoding or anything related to that? If so, you should go to Project Properties > Android and link against the Google APIs for your desired API level.
If not using maps, what is the full error trace?
REMOVE BELOW USES FROM YOUR MANIFEST FILE & TRY IT.
<uses-feature android:name="android.hardware.screen.landscape" />
THIS HAPPENS COZ YOUR EMULATOR DOES'NT SUPPORT THIS FEATURES, OR TRY THIS FEATURES IT IN HIGHER VERSION API EMULATOR.
in android manifest add features android.hardware.screen.landscape to make app in horizontal view.

Categories

Resources