me.apla.cordova.app-preferences
me.apla.cordova.app-preferences copied to clipboard
Installation error on cordova-android@7 (latest), due to hook scripts
Issue:
As reported in https://github.com/apache/cordova-android/issues/547#issuecomment-438325344:
If I would do the following in a new Cordova project:
-
cordova plugin add cordova-plugin-app-preferences
-
cordova platform add cordova-android@latest
Then I get the following output with an error message:
Using cordova-fetch for cordova-android@latest
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: io.cordova.hellocordova
Name: HelloCordova
Activity: MainActivity
Android target: android-27
Android project created with [email protected]
Android Studio project detected
Android Studio project detected
Installing "cordova-plugin-app-preferences" for android
app-settings.json not found: creating a sample file
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
will push strings array {"name":"lang","titles":["English (US)","English (UK)"],"values":["en-us","en-gb"]}
unhandled exception { [Error: ENOENT: no such file or directory, mkdir 'platforms/android/res/xml']
errno: -2,
code: 'ENOENT',
syscall: 'mkdir',
path: 'platforms/android/res/xml' }
ENOENT: no such file or directory, mkdir 'platforms/android/res/xml'
I can install and build on cordova-android@latest (7.1.2) if I do the following steps:
- Comment hooks scripts out of
plugin.xml
in https://github.com/brodybits/me.apla.cordova.app-preferences/tree/test1 - do
cordova plugin add https://github.com/brodybits/me.apla.cordova.app-preferences#test1
- do
cordova platform add cordova-android@latest
- do
cordova build android
I can think of the following possible options:
- get rid of hook scripts
- update hook scripts to work with new cordova-android project structure
- improved support by the Cordova framework
Please specify your environment
Plugin version:
- [x] released version: 0.99.3 (latest)
- [ ] repository master
Toolchain:
- [x] Cordova cli
- [ ] Phonegap cli
- [ ] Phonegap cloud
- [ ] Ionic
- [ ] Other: _____
Platforms affected:
- [x] Android
- [ ] iOS/macOS
- [ ] LocalStorage fallback for browser and blackberry
- [ ] Windows and Windows Phone 8.1 and later
- [ ] Windows Phone 8 and earlier (deprecated)
What the scope of your problem:
- [x] General functionality ~~(store/fetch/remove/clearAll)~~ installation with cordova-android@7 fails
- [ ] Suites
- [ ] Cloud synchronization and events
- [ ] Preferences pane generation and display