question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build failed for Android

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12

github_iconTop GitHub Comments

4reactions
blattmanncommented, Apr 27, 2016

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.

3reactions
RakeshKBcommented, Jan 1, 2018

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 android@6.3.0
  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 android@6.3.0
  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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to build project with Android studio - Stack Overflow
File->Other Settings->Default Project Structure · Under Project Settings: Project, set Project SDK as Android SDK. · Click Edit button · For Android SDK,...
Read more >
Why does a build fail in Android Studio even if I don't have any ...
There are several causes for gradle build fail in Android studio. Few reasons might be: * Dependencies added * Importing the project from...
Read more >
Different Ways to fix "Error running android: Gradle project ...
Method 1: Restarting your project using Invalidate Caches and Restart option · Method 2: Sync your project with Gradle files · Method 3:...
Read more >
Gradle build failed with unknown error. Please see logs for the ...
I was using expo build:android but after upgrading to eas-build It is showing me this error : Android build failed: Gradle build failed...
Read more >
Known issues with Android Studio and Android Gradle Plugin
Find out about current known issues with Android Studio and the Android Gradle Plugin.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found