blythburgh
blythburgh

Reputation: 93

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?

Upvotes: 0

Views: 280

Answers (1)

ridoy
ridoy

Reputation: 6322

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.

Upvotes: 2

Related Questions