apla / me.apla.cordova.app-preferences

App preferences plugin for cordova
Apache License 2.0
201 stars 210 forks source link

Installation error on cordova-android@7 (latest), due to hook scripts #142

Open brodybits opened 5 years ago

brodybits commented 5 years ago

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:

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 cordova-android@7.1.2
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:

I can think of the following possible options:


Please specify your environment

Plugin version:

Toolchain:

Platforms affected:

What the scope of your problem: