Cannot Build, Run or emulate Android :(


#1

Hi Can someone please help me, I have been trying to figure out what the issue is all day. IOS building is working fine, but when I try to build or run android with Ionic through terminal I receive these errors below:

sudo ionic build android
Updated the hooks directory to have execute permissions
Running command: /Users/anthonysinclair/nodesass/hooks/before_prepare/01_jshint.js /Users/anthonysinclair/nodesass
Linting www/js/app.js
File www/js/app.js has no errors.

Linting www/js/config.js
File www/js/config.js has no errors.

Linting www/js/controllers.js
File www/js/controllers.js has no errors.

Linting www/js/directives.js
File www/js/directives.js has no errors.

Linting www/js/factories.js
File www/js/factories.js has no errors.

Linting www/js/filters.js
File www/js/filters.js has no errors.

Linting www/js/services.js
File www/js/services.js has no errors.

Linting www/js/templates.js
File www/js/templates.js has no errors.

Running command: /Users/anthonysinclair/nodesass/hooks/after_prepare/010_add_platform_class.js /Users/anthonysinclair/nodesass
add to body class: platform-android
Running command: /Users/anthonysinclair/nodesass/hooks/after_prepare/020_remove_sass_from_platforms.js /Users/anthonysinclair/nodesass
Running command: /Users/anthonysinclair/nodesass/platforms/android/cordova/build
ANDROID_HOME=/Users/anthonysinclair/library/android/sdk
JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Running: /Users/anthonysinclair/nodesass/platforms/android/gradlew cdvBuildDebug -b /Users/anthonysinclair/nodesass/platforms/android/build.gradle -Dorg.gradle.daemon=true
:preBuild
:compileDebugNdk UP-TO-DATE
:preDebugBuild
:checkDebugManifest
:CordovaLib:compileLint FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:CordovaLib:compileLint’.

Unable to create lint output directory.

  • 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: 1.905 secs

/Users/anthonysinclair/nodesass/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/anthonysinclair/nodesass/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/anthonysinclair/nodesass/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/anthonysinclair/nodesass/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/anthonysinclair/nodesass/platforms/android/cordova/build: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

I am using Mac Yosemite, IOS Build works fine its just android.

I use Android Studio. and have set these in the .bash_profile

export ANDROID_HOME=/Users/anthonysinclair/library/android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export PATH=$HOME/usr/local/bin:$PATH

:frowning:

Been trying to get it to work all day


#2

I have changed som chmod permissions to 777 to fix some of the problems above but now have these issues:

sudo ionic build android
Updated the hooks directory to have execute permissions
Running command: /Users/anthonysinclair/nodesass/hooks/before_prepare/01_jshint.js /Users/anthonysinclair/nodesass
Linting www/js/app.js
File www/js/app.js has no errors.

Linting www/js/config.js
File www/js/config.js has no errors.

Linting www/js/controllers.js
File www/js/controllers.js has no errors.

Linting www/js/directives.js
File www/js/directives.js has no errors.

Linting www/js/factories.js
File www/js/factories.js has no errors.

Linting www/js/filters.js
File www/js/filters.js has no errors.

Linting www/js/services.js
File www/js/services.js has no errors.

Linting www/js/templates.js
File www/js/templates.js has no errors.

Running command: /Users/anthonysinclair/nodesass/hooks/after_prepare/010_add_platform_class.js /Users/anthonysinclair/nodesass
add to body class: platform-android
Running command: /Users/anthonysinclair/nodesass/hooks/after_prepare/020_remove_sass_from_platforms.js /Users/anthonysinclair/nodesass
Running command: /Users/anthonysinclair/nodesass/platforms/android/cordova/build
ANDROID_HOME=/Users/anthonysinclair/library/android/sdk
JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Running: /Users/anthonysinclair/nodesass/platforms/android/gradlew cdvBuildDebug -b /Users/anthonysinclair/nodesass/platforms/android/build.gradle -Dorg.gradle.daemon=true
:preBuild
:compileDebugNdk UP-TO-DATE
:preDebugBuild
:checkDebugManifest
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:preBuild
:CordovaLib:preDebugBuild
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:compileDebugJava UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:packageDebugJar UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:packageDebugJniLibs UP-TO-DATE
:CordovaLib:packageDebugLocalJar UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:com.google.playservices:ionFullApp-google-play-services_lib:compileLint
:com.google.playservices:ionFullApp-google-play-services_lib:copyDebugLint UP-TO-DATE
:com.google.playservices:ionFullApp-google-play-services_lib:mergeDebugProguardFiles
:com.google.playservices:ionFullApp-google-play-services_lib:preBuild
:com.google.playservices:ionFullApp-google-play-services_lib:preDebugBuild
:com.google.playservices:ionFullApp-google-play-services_lib:checkDebugManifest
:com.google.playservices:ionFullApp-google-play-services_lib:preDebugTestBuild
:com.google.playservices:ionFullApp-google-play-services_lib:prepareAndroidCordovaLibUnspecifiedDebugLibrary
:com.google.playservices:ionFullApp-google-play-services_lib:prepareDebugDependencies
:com.google.playservices:ionFullApp-google-play-services_lib:compileDebugAidl
:com.google.playservices:ionFullApp-google-play-services_lib:compileDebugRenderscript
:com.google.playservices:ionFullApp-google-play-services_lib:generateDebugBuildConfig
:com.google.playservices:ionFullApp-google-play-services_lib:generateDebugAssets UP-TO-DATE
:com.google.playservices:ionFullApp-google-play-services_lib:mergeDebugAssets
:com.google.playservices:ionFullApp-google-play-services_lib:generateDebugResValues
:com.google.playservices:ionFullApp-google-play-services_lib:generateDebugResources
:com.google.playservices:ionFullApp-google-play-services_lib:mergeDebugResources
:com.google.playservices:ionFullApp-google-play-services_lib:processDebugManifest
:com.google.playservices:ionFullApp-google-play-services_lib:processDebugResources
:com.google.playservices:ionFullApp-google-play-services_lib:generateDebugSources
:com.google.playservices:ionFullApp-google-play-services_lib:compileDebugJavawarning: java/lang/Object.class(java/lang:Object.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
warning: java/lang/String.class(java/lang:String.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
warning: java/lang/Boolean.class(java/lang:Boolean.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
3 warnings

:com.google.playservices:ionFullApp-google-play-services_lib:processDebugJavaRes UP-TO-DATE
:com.google.playservices:ionFullApp-google-play-services_lib:packageDebugJar
:com.google.playservices:ionFullApp-google-play-services_lib:compileDebugNdk
:com.google.playservices:ionFullApp-google-play-services_lib:packageDebugJniLibs UP-TO-DATE
:com.google.playservices:ionFullApp-google-play-services_lib:packageDebugLocalJar
:com.google.playservices:ionFullApp-google-play-services_lib:packageDebugRenderscript UP-TO-DATE
:com.google.playservices:ionFullApp-google-play-services_lib:packageDebugResources
:com.google.playservices:ionFullApp-google-play-services_lib:bundleDebug
:prepareAndroidComGooglePlayservicesIonFullAppGooglePlayServices_libUnspecifiedDebugLibrary
:prepareAndroidCordovaLibUnspecifiedDebugLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest/Users/anthonysinclair/nodesass/platforms/android/AndroidManifest.xml:26:13 Error:
Missing one of the key attributes ‘action#name,category#name’ on element intent-filter at AndroidManifest.xml:26:13
/Users/anthonysinclair/nodesass/platforms/android/AndroidManifest.xml:0:0 Error:
Validation failed, exiting
FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:processDebugManifest’.

Manifest merger failed with multiple errors, see logs

  • 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: 14.197 secs

/Users/anthonysinclair/nodesass/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/anthonysinclair/nodesass/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/anthonysinclair/nodesass/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/anthonysinclair/nodesass/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/anthonysinclair/nodesass/platforms/android/cordova/build: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
Anthonys-MacBook-Pro:nodesass anthonysinclair$


#3

This forum is extremely engadging. Thanks Ionic