apla / me.apla.cordova.app-preferences

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

Name attribute is regarded undefined during app build #40

Closed nikolasr200 closed 9 years ago

nikolasr200 commented 9 years ago

after fix 39 the code is successfully generated, bt during building the app i get this error during testing before issue 39 i had also skipped th loop with an if statement but reverted cause i thought that there was sth else wrong. btw i m testing this on android


mypath\platforms\android\build\intermediates\res\deb ug\xml\apppreferences.xml:4: error: Error: No resource found that matches the gi ven name (at 'entries' with value '@apppreferences_strings/measurementunit').

mypath\platforms\android\build\intermediates\res\deb ug\xml\apppreferences.xml:4: error: Error: No resource found that matches the gi ven name (at 'entryValues' with value '@apppreferences_strings/measurementunitValues') .

:processDebugResources FAILED

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 15.788 secs

mypath\platforms\android\cordova\node_modules\q\q.js :126 throw e; ^ Error code 1 for command: cmd with args: /s /c "mypath\MYAPP En\platforms\android\gradlew cdvBuildDebug -b mypath \platforms\android\build.gradle -Dorg.gradle.daemon=true" ERROR building one of the platforms: Error: cmd: Command failed with exit code 8

You may not have the required environment or OS to build this project Error: cmd: Command failed with exit code 8 at ChildProcess.whenDone (mypath\AppData\Roaming\npm\node_modules\co rdova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23) at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:766:16) at Process.ChildProcess._handle.onexit (child_process.js:833:5))

apla commented 9 years ago

I cannot confirm this. Just installed new version from npm, generated new preferences for android, everything is fine.

Please try following steps within project directory:

  1. cordova plugin rm cordova-plugin-app-preferences
  2. cordova plugin add cordova-plugin-app-preferences
  3. node plugins/cordova-plugin-app-preferences/bin/build-app-settings.js

Can you show generated platforms/android/res/values/apppreferences_strings.xml?

nikolasr200 commented 9 years ago

i have pulled the latest version, the plugin does generate files, but get the error above during build.. the generated apppreferences.xml is the following

xml version="1.0" encoding="UTF-8"?> resources> string-array name="measurementunit"> item>kilometers_litres item>miles_gallons /string-array> string-array name="measurementunitValues"> item>kilometers_litres item>miles_gallons /string-array> /resources>

removed from the begining the lt character cause githud removed the line

nikolasr200 commented 9 years ago

the problem as i see it is that.. at myapp\platforms\android\build\intermediates\res there is correctly these lines android:entries="@apppreferences_strings android:entryValues="@apppreferences_strings

BUT

in his path myapp\platforms\android\build\intermediates\res\debug\values

there is only values.xml which contains string-array name="measurementunit"> item>kilometers_litres item>miles_gallons /string-array> string-array name="measurementunitValues"> item>kilometers_litres item>miles_gallons /string-array>

but i guess android:entries="@apppreferences_strings android:entryValues="@apppreferences_strings

instructs to search at aaaappreferences.xml and not values.xml

nikolasr200 commented 9 years ago

are these any help? https://code.google.com/p/android/issues/detail?id=64960 http://stackoverflow.com/questions/14618852/no-resource-found-when-using-include-layout