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

Error in code example #770

Closed
John-Henrique opened this issue Dec 4, 2015 · 6 comments
Closed

Error in code example #770

John-Henrique opened this issue Dec 4, 2015 · 6 comments

Comments

@John-Henrique
Copy link

Can't run example because this error below
[phonegap] executing 'cordova build android'...
Error: ENOENT: no such file or directory, scandir 'c:[APP]\platforms\android\src\de\appplant\localnotification\example'

@khalid-hussain
Copy link

Reference

For reference of the complete error, running cordova build android on the kitchen sink example, gives the following error on my machine:

Error: ENOENT: no such file or directory, scandir 'C:\Users\Khalid\Desktop\cordova-plugin-local-notifications-example\platforms\android\src\de\appplant\localnotification\example'
    at Error (native)
    at Object.fs.readdirSync (fs.js:813:18)
    at android_parser.update_from_config (C:\Users\Khalid\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:266:25)
    at android_parser.update_project (C:\Users\Khalid\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:335:14)
    at C:\Users\Khalid\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\prepare.js:138:31
    at _fulfilled (C:\Users\Khalid\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
    at self.promiseDispatch.done (C:\Users\Khalid\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
    at Promise.promise.promiseDispatch (C:\Users\Khalid\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749:13)
    at C:\Users\Khalid\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:509:49
    at flush (C:\Users\Khalid\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)

Solution

Typing cordova platform list from the command line gives the following:

Installed platforms: android 4.0.2, ios 3.9.2, windows
Available platforms: amazon-fireos, blackberry10, browser, firefoxos, webos, windows8, wp8

To solve this issue:

  1. You will need to remove the android platform that comes with the project by running:
    cordova platform remove android
  2. Now install the default android platform by running:
    cordova platform add android
  3. You can now run cordova build android successfully.

Note: If you run cordova platform list again, you will get

Installed platforms: android 4.1.1, ios 3.9.2, windows
Available platforms: amazon-fireos, blackberry10, browser, firefoxos, webos, windows8, wp8

@John-Henrique
Copy link
Author

Well, now when phonegap build android result error

Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILED
FAILURE:
Build failed with an exception.

* What went wrong:

Execution failed for task ':compileDebugJava'.
> Compilation failed; see the compiler error output for details.

@khalid-hussain
Copy link

Do you have JDK and Ant installed?

@John-Henrique
Copy link
Author

Ant 1.9.6
SDK rev 23.3.4 API LEVEL 15, 22

I can compile only without plugin local notifications

katzer added a commit that referenced this issue Dec 8, 2015
@katzer katzer closed this as completed Dec 8, 2015
@John-Henrique
Copy link
Author

I try using the new 'update', remove android and add, so, when run phonegap build android this errors are displayed

First error

 :CordovaLib:compileDebugJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Second error

:mergeDebugResources
C:\xampp\htdocs\promocoes\Promocoes-de-Supermercado\platforms\android\res\drawab
le-mdpi\icon.png: libpng warning: iCCP: Not recognizing known sRGB profile that
has been edited 

Last error

Error code 1 for command: cmd with args: /s /c "C:\xampp\htdocs\promocoes\Promoc
oes-de-Supermercado\platforms\android\gradlew cdvBuildDebug -b C:\xampp\htdocs\p
romocoes\Promocoes-de-Supermercado\platforms\android\build.gradle -Dorg.gradle.d
aemon=true"

ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1 
phonegap platform list
Installed platforms: android 4.1.1
Available platforms: amazon-fireos, blackberry10, browser, firefoxos, webos, win
dows, windows8, wp8

@John-Henrique
Copy link
Author

Working with 0.8.2 version, but was necessary download release 0.8.2 and run local install by phonegap plugin add C:\download\0.8.2.zip and remove, add and rebuild android.

Thanks!

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

No branches or pull requests

3 participants