Android Question [CLOSED] B4A V4 : Tag <uses-permission> attribute name has invalid character '-'.

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,

While compiling, I've got an error

AndroidManifest.xml:33: Tag <uses-permission> attribute name has invalid character '-'.


B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="20"/>
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
<supports-screens android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true"/>)

SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")

SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddApplicationText(<activity android:name="anywheresoftware.b4a.objects.preferenceactivity"/>)
AddPermission(android.permission.CALL_PHONE)
AddPermission(android.permission.MODIFY_AUDIO_SETTINGS)
AddPermission(com.android.vending.CHECK_LICENSE)
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.CHANGE_NETWORK_STATE)
AddPermission(android.permission.ACCESS_COARSE_UPDATES)
AddPermission(android.permission.READ_PHONE_STATE)
AddPermission(android.permission.BLUETOOTH)
addpermission(android.permission.GET_ACCOUNTS)
addpermission(android.permission-group.MICROPHONE)
AddReceiverText(bluetooth, <intent-filter>
    <action android:name="android.bluetooth.device.action.ACL_CONNECTED"/>
    </intent-filter>)
AddReceiverText(bluetooth, <intent-filter>
    <action android:name="android.bluetooth.device.action.ACL_DISCONNECTED"/>
    </intent-filter>)
AddReceiverText(sc1, <intent-filter>
    <action android:name="android.intent.action.BOOT_COMPLETED"/>
    </intent-filter>)


AddApplicationText(<receiver android:name="anywheresoftware.b4a.objects.AdminManager$AdminReceiver"
        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>)

SetActivityAttribute(Main, "android:excludeFromRecents", "true")

At line 33 in the Manifest Editor, there is : </intent-filter>)
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
You are using a SDK >=17?
Nope I am using SDK Tools 24.0.1 and Platform Tools 21

Why do you need this permission?
I am needing it to be able to inject some audio into phone calls on "restricted" devices (I mean some devices which accept this).

But, that error did not appear before. Have you added some controls ? If it is the only solution I'd remove this of course but I'd loose some functionalities
 
Upvote 0

francoisg

Active Member
Licensed User
Longtime User
Hi, maybe this can help someone else with the same problem. I used the ICOS* libraries in one of my projects and kept getting this error (Tag <uses-permission> attribute name has invalid character '-'.). It seems that there is a typo in the ICOS .xml files (ICOSLibrary.xml & ICOSPhone.xml in the B4A libraries directory) where the value "android.permission-group.HARDWARE_CONTROLS" should be "android.permission_group.HARDWARE_CONTROLS" (see underscore instead of hyphen).

I edited the .xml files, restarted B4A and the issue seems to have dissapeared.
 
Upvote 0
Top