Cordova-plugin-local-notifications: Build failed for Android

Created on 5 Apr 2016  Â·  12Comments  Â·  Source: katzer/cordova-plugin-local-notifications

the reports

╰─➤  ionic build android
Running command: /Users/SupeRodv2/dev4living/RodLab/HeyCommunity/frontend/hooks/after_prepare/010_add_platform_class.js /Users/SupeRodv2/dev4living/RodLab/HeyCommunity/frontend
add to body class: platform-android
ANDROID_HOME=/Users/SupeRodv2/android-sdk-macosx
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
   > Could not find any version that matches com.android.support:support-v4:+.
     Searched in the following locations:
         https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml
         https://repo1.maven.org/maven2/com/android/support/support-v4/
     Required by:
         :android:unspecified

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 13.091 secs
ERROR building one of the platforms: Error code 1 for command: /Users/SupeRodv2/dev4living/RodLab/HeyCommunity/frontend/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/SupeRodv2/dev4living/RodLab/HeyCommunity/frontend/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
You may not have the required environment or OS to build this project
Error: Error code 1 for command: /Users/SupeRodv2/dev4living/RodLab/HeyCommunity/frontend/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/SupeRodv2/dev4living/RodLab/HeyCommunity/frontend/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

build iOS success
build android failed

help me

Most helpful comment

SOLVED (on OSX):

I was updating Android again via command line:
android update sdk --no-ui --filter extra
android update sdk --no-ui --all --filter "extra-android-m2repository

Then I removed the plugin cordova-plugin-android-support-v4:
ionic plugin remove cordova-plugin-android-support-v4 --save

Now my build is SUCCESSFUL again!

I just get some hints now, but this is not blocking the build:

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

All 12 comments

the android sdk
2016-04-05 23 04 49

Having the same issue, can't build android for android with the latest version, if I remove the plugin, it works again

Looks like a dependency problem.
You're compilating with a plugin (or something else) that requires this other plugin :
https://www.npmjs.com/package/cordova-plugin-android-support-v4

try adding it to see if your build errors. I do not need it with cordova local notifications, make sure you're running local notifications 0.8.4 and debugging is set to false .

You must manually install the "Android Support Repository" by the Android SDK Manager.

I am having the same issue, and I am sure it comes from this library.
Does anybody found a solution?

PS: Have Android Support Repository 23.2.1 installed. That npm plugin did not help :(

You all have hte latest android device plugin ?

Solved the issue by upgrading to Android Support Repository v30 on SDK manager.
Also end up installing the dependency @wicktus mentioned.

I have the same issue.
I upgraded Ionic, Cordova, Android Support Repository to v30 and installed the cordova-plugin-android-support-v4 plugin mentioned by @wicktus .

I still cannot build.

I also tried it with version 0.8.3 and receive the same build error.

I am on a mac.

I made on Linux, perhaps you could try restarting your mac. On Ionic forum they said that there was a name update on android. So the problem is not really from this project. Try installing or updating more "Extras" on SDK

Did you try using cordova plugin device ??

SOLVED (on OSX):

I was updating Android again via command line:
android update sdk --no-ui --filter extra
android update sdk --no-ui --all --filter "extra-android-m2repository

Then I removed the plugin cordova-plugin-android-support-v4:
ionic plugin remove cordova-plugin-android-support-v4 --save

Now my build is SUCCESSFUL again!

I just get some hints now, but this is not blocking the build:

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

I had the same issue: The steps below solved the issue for me. Give a try:

  1. cordova platform rm android
  2. rm -rf platforms/
  3. rm -rf plugins/
  4. cordova platform add [email protected]
  5. cordova plugin list
  6. cordova plugin rm cordova-android-support-v4
  7. cordova plugin rm android.support.v4
  8. cordova platform rm android
  9. cordova platform add [email protected]
  10. cordova build android
    I had to remove and add the platform twice to see which plugin is redundant. I found that there were two versions of android support v4 plugins.

Finally, the build was successful.

Happy coding :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daniele-sartiano picture daniele-sartiano  Â·  4Comments

neshke89 picture neshke89  Â·  4Comments

ibnbd picture ibnbd  Â·  4Comments

bhumin3i picture bhumin3i  Â·  5Comments

tverilytt picture tverilytt  Â·  4Comments