Android Question AndroidManifest.xml:16: error: Error parsing XML: duplicate attribute

wineos

Member
Licensed User
Longtime User
I got this error when I compile:

B4A Version: 9.50
Java Version: 8
Parsing code. (0.15s)
Building folders structure. (0.08s)
Compiling code. (0.47s)
Compiling layouts code. (0.02s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. Error
AndroidManifest.xml:16: error: Error parsing XML: duplicate attribute

I don't know how to fix it, please help!

Here is my code in Manifest Editor:

B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>
<uses-permission
    android:name="android.permission.READ_CALENDAR"
    android:name="android.permission.WRITE_CALENDAR"
      android:maxSdkVersion="26"/>)
AddPermission(android.permission.READ_CALENDAR)
AddPermission(android.permission.WRITE_CALENDAR)
SetApplicationAttribute(android:icon, "@drawable/biblecal")
SetApplicationAttribute(android:label, "$LABEL$")
 

DonManfred

Expert
Licensed User
Longtime User
<uses-permission android:name="android.permission.READ_CALENDAR" android:name="android.permission.WRITE_CALENDAR"
remove this lines. AddPermission is the correct way to add them.

Also please post the generated manifest.xml so we can check which entries are duplicated...
 
Last edited:
Upvote 0

wineos

Member
Licensed User
Longtime User
I can't remove that line. After I remove it, it fail to run with the following error message:

B4A Version: 9.50
Java Version: 8
Parsing code. (0.15s)
Building folders structure. (0.12s)
Compiling code. (0.49s)
Compiling layouts code. (0.09s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. Error
c:\users\winnie chan\appdata\local\android\sdk\tools\..\extras\b4a_remote\androidx\core\core\1.0.2\unpacked-core-1.0.2\res\values-v21\values-v21.xml:7: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Material.Notification'.
c:\users\winnie chan\appdata\local\android\sdk\tools\..\extras\b4a_remote\androidx\core\core\1.0.2\unpacked-core-1.0.2\res\values-v21\values-v21.xml:8: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Material.Notification.Info'.
c:\users\winnie chan\appdata\local\android\sdk\tools\..\extras\b4a_remote\androidx\core\core\1.0.2\unpacked-core-1.0.2\res\values-v21\values-v21.xml:9: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Material.Notification.Time'.
c:\users\winnie chan\appdata\local\android\sdk\tools\..\extras\b4a_remote\androidx\core\core\1.0.2\unpacked-core-1.0.2\res\values-v21\values-v21.xml:10: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Material.Notification.Title'.

Besides, where can I find the manifest.xml file?

Thank you DonManfred.
 
Upvote 0

wineos

Member
Licensed User
Longtime User
Thank you Erel and DonManfred.

After I changed the Configure Paths, i.e. select android.jar from android-28 platform, it works!

My problem has been solved. Thank you so much!
 
Upvote 0
Top