Android Question [BUG] AdminReceiver2: Targeting S+ explicit value

Num3

Active Member
Licensed User
Longtime User
I am unable to install to device when using SDK 33 and targeting SDK33
Used code from Kiosk example, only changed targetSdkVersion="33"

B4X:
Dex code    (0.35s)
Dex merge    (0.76s)
Copying libraries resources    (0.07s)
ZipAlign file.    (0.03s)
Signing package file (private key).    (0.25s)
Installing file to device.    Error
adb: failed to install Kiosk.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl840120263.tmp/base.apk (at Binary XML file line #22): anywheresoftware.b4a.objects.AdminReceiver2: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]
 
Looks like the manifest is malformed.
Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]
To less information to help.

Post you manifesttext
 
Upvote 0
Looks like the manifest is malformed.

To less information to help.

Post you manifesttext
Here is the manifest, it's the one from the example, only changed targetsdk to 33:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="33"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.

'uncomment to set as home activity
'AddActivityText(Main,
'<intent-filter>
'   <action android:name="android.intent.action.MAIN" />
'   <category android:name="android.intent.category.HOME" />
'   <category android:name="android.intent.category.DEFAULT" />
'</intent-filter>
')

AddApplicationText(<receiver android:name="anywheresoftware.b4a.objects.AdminReceiver2"
        android:permission="android.permission.BIND_DEVICE_ADMIN">
    <meta-data android:name="android.app.device_admin"  
            android:resource="@xml/device_admin" />
    <intent-filter>
        <action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
    </intent-filter>
</receiver>)
CreateResource(xml, device_admin.xml,
<device-admin xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-policies>
        <limit-password />
        <reset-password />
        <force-lock />
    </uses-policies>
</device-admin>
)
 
Upvote 0
Back
Top