Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for cordova-android@7 #135

Closed
dpa99c opened this issue Dec 5, 2017 · 2 comments
Closed

Add support for cordova-android@7 #135

dpa99c opened this issue Dec 5, 2017 · 2 comments

Comments

@dpa99c
Copy link
Owner

dpa99c commented Dec 5, 2017

cordova-android@7.0.0 has been released and it makes backwardly-incompatible changes to the structure of the native Android project generated by Cordova.

Therefore current versions of this plugin (v4) are incompatible with cordova-android@7, so a new major version of this plugin will probably need to be released in order to support it.

However, if possible this plugin should maintain backward compatibility for cordova-android@6 and below.

@dpa99c
Copy link
Owner Author

dpa99c commented Dec 5, 2017

It seems cordova-android@7 also attempts to parse <config-file> blocks in the config.xml, so now <config-file> blocks that are intended for this plugin to parse are being picked up by Cordova and causing errors.

For a reproducible example, run the following:

cordova create test && cd test

cordova platform add android@7.0.0

cordova build android

sed -i '' 's/<platform name="android">/<platform name="android"><config-file parent=".\/application\/activity\/[@android:name=\x27MainActivity\x27]" target="AndroidManifest.xml"><meta-data android:name="foo" android:value="@string\/bar" \/><\/config-file>/' config.xml

cordova build android

The result will be an error:

Error: Unable to graft xml at selector "./application/activity/[@android:name='MainActivity']" 
from "cordova-android@7-test/platforms/android/app/src/main/res/xml/config.xml" during config install

So the next major version of this plugin (cordova-custom-config@5) is going to need to prefix element names in order that Cordova doesn't attempt to parse them:

<config-file> => <custom-config-file>
<preference> => <custom-preference>
<resource> => <custom-resource>

@millerbarros
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants