Ionic build android fail on OSX El Capitan - :processDebugResources - android

Well, I have a Mac with El Capitan and I need emulate and build a Android application created with Ionic/cordova but all time have problems like to Execution failed for task ':processDebugResources'.
My configuration is:
sh-3.2# ionic info
Your system information:
Cordova CLI: 6.3.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 1.2.4
Ionic CLI Version: 1.7.16
Ionic App Lib Version: 0.7.3
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v6.3.1
Xcode version: Xcode 7.3.1 Build version 7D1014
On my ~/.bash_profile
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home
export ANT_HOME=/usr/local/Cellar/ant/1.9.7/libexec
export ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1_1
export PATH=${PATH}:${PATH}/tools:${PATH}/platform-tools:${ANT_HOME}/bin
Application installed:
Android SDK 24.4.1
Java SE Development Kit 8 (1.8.0)
Ant 1.9.7
Android Studio 2.1.2
Android SDK API Level list installed: 24, 23, 22, 21, 20, 19, 18, 17, 16, 15 and 14
My problem:
When i run commands ionic emulate android or ionic build android this return output:
Running command: /Users/MyMacPro/Desktop/MyApp/hooks/after_prepare/010_add_platform_class.js /Users/MyMacPro/Desktop/MyApp
add to body class: platform-android
ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1_1
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
Incremental java compilation is an incubating feature.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:mergeDebugShaders UP-TO-DATE
:compileDebugShaders UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/local/Cellar/android-sdk/24.4.1_1/build-tools/24.0.1/aapt'' finished with non-zero exit value 1
* 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: 18.044 secs
Error: /Users/MyMacPro/Desktop/MyApp/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/local/Cellar/android-sdk/24.4.1_1/build-tools/24.0.1/aapt'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
So, i don't know what is my error because I have install all application required.
Thanks!

My solution:
This solution solved Android problems, if you need solved iOS
problems, maybe you need learn about ios-sim
# First, Install nodejs
brew install node
# install cordova
sudo npm install -g cordova
# install cordova
sudo npm install -g ionic
sudo npm install -g ionic
# install android sdk: android, adb, etc
brew install android-sdk
# Execute android
android
# after run android you need install
# Tools: Andoird SDK Tools, Android SDK Platform-tools, Android SDK Build-tools
# Android 4.4.2 (API 19)
# Extras: Android Support Library
# install ant
brew install ant
Then, after install all dependencies, you can create a new ionic project
like to
ionic start <YouAppNameHere> blank
Then you need add android platform support with
ionic platform add android
And finally, you can build and emulate you project for android devices with
ionic build android
or
ionic emulate android
You can move/copy you old www folder data to you new www folder, and
the old plugins can be installed manually using ionic plugin add <YouPluginNameHere>

Related

ionic native fcm plugin issue

I want to implement firebase push notification in my ionic 3 application. I've added ionic natice fcm plugin. But when i build application using following command
ionic cordova build android
but it gives me an error as below:
ionic cordova build android
Running app-scripts build: --iscordovaserve --externalIpRequired --nobrowser
[12:22:34] build dev started ...
[12:22:34] clean started ...
[12:22:34] clean finished in 31 ms
[12:22:34] copy started ...
[12:22:34] transpile started ...
[12:22:52] transpile finished in 17.82 s
[12:22:52] preprocess started ...
[12:22:52] deeplinks started ...
[12:22:52] deeplinks finished in 250 ms
[12:22:52] preprocess finished in 297 ms
[12:22:52] webpack started ...
[12:22:55] copy finished in 20.24 s
[12:23:15] webpack finished in 22.49 s
[12:23:15] sass started ...
[12:23:19] sass finished in 4.08 s
[12:23:19] postprocess started ...
[12:23:19] postprocess finished in 32 ms
[12:23:19] lint started ...
[12:23:19] build dev finished in 44.83 s
> cordova build android
✖ Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit code 1):
(truncated) ... aLib:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseShaders UP-TO-DATE
:CordovaLib:compileReleaseShaders UP-TO-DATE
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:compileReleaseRenderscript UP-TO-DATE
:CordovaLib:generateReleaseResValues UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
:CordovaLib:packageReleaseResources UP-TO-DATE
:CordovaLib:processReleaseManifest UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig UP-TO-DATE
:CordovaLib:processReleaseResources UP-TO-DATE
:CordovaLib:generateReleaseSources UP-TO-DATE
:CordovaLib:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileReleaseJavaWithJavac UP-TO-DATE
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:CordovaLib:mergeReleaseJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
:CordovaLib:bundleRelease UP-TO-DATE
:prepareComAndroidSupportSupportCompat2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUi2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportFragment2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportV42600Alpha1Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesAds900Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesAdsLite900Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBase900Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBasement1102Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesTasks1102Library UP-TO-DATE
:prepareComGoogleFirebaseFirebaseAnalytics1102Library UP-TO-DATE
:prepareComGoogleFirebaseFirebaseAnalyticsImpl1102Library UP-TO-DATE
:prepareComGoogleFirebaseFirebaseCommon1102Library UP-TO-DATE
:prepareComGoogleFirebaseFirebaseCore1102Library UP-TO-DATE
:prepareComGoogleFirebaseFirebaseIid1102Library UP-TO-DATE
:prepareComGoogleFirebaseFirebaseMessaging1102Library UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:processDebugGoogleServices
Parsing json file: D:\Projects\Code\Other\DailySheet\DailySheetMobileApp\platforms\android\google-services.json
:generateDebugResources
:mergeDebugResources
:processDebugManifest UP-TO-DATE
:processDebugResources
:generateDebugSources
:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:compileDebugJavaWithJavac UP-TO-DATE
:compileDebugNdk UP-TO-DATE
:compileDebugSources UP-TO-DATE
:mergeDebugShaders UP-TO-DATE
:compileDebugShaders
:generateDebugAssets
:mergeDebugAssets UP-TO-DATE
:transformClassesWithDexForDebug FAILED
BUILD FAILED
Total time: 1 mins 48.75 secs
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define
Lcom/google/android/gms/internal/zzee;
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define
Lcom/google/android/gms/internal/zzee;
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
It was all working fine before i added FCM plugin. My project information is as below:
global packages:
#ionic/cli-utils : 1.4.0
Cordova CLI : 6.5.0
Ionic CLI : 3.4.0
local packages:
#ionic/app-scripts : 1.3.12
#ionic/cli-plugin-cordova : 1.4.0
#ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : android 6.1.2
Ionic Framework : ionic-angular 3.5.0
System:
Node : v7.8.0
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
npm : 4.2.0
Also i tried to remove all plugins and platform and readded it. But no solution! :(
Solution found here: https://forum.ionicframework.com/t/ionic-native-fcm-plugin-issue/96601/6
Finally, i found solution, here what i’ve done: Replace
android.gms:play-services-ads with firebase:firebase-ads in below
files:
build.gradle project.properties plugin.xml Also check that if any
version is provided after android.gms:play-services-ads:X.X.X, then
replace it with android.gms:play-services-ads:+
Before adding the Ionic native FCM plugin to your app, you need to configure your app on google firebase console and add to GoogleService-info.plist & google-services.json in your app's root folder.
Try removing the plugin, adding the files and then re-adding the plugin again.

Error "cordova build android"

OS: Linux Mint
Android Stubio 2.3.3
Cordova: 6.5.0
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) Server VM (build 25.121-b13, mixed mode)
All settings are registered, but the build does not work.
# cordova requirements android
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25,android-24,android-23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14,android-13,android-12,android-11,android-10,android-9,android-8,android-7
Gradle: installed /usr/share/gradle/bin/gradle
All settings are registered, but the build does not work.
# cordova build
ANDROID_HOME=/home/mark/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_5o0xmdzdvkp7hxld5azt4w1sx.run(/home/mark/helloBook/platforms/android/build.gradle:137)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint UP-TO-DATE
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:processDebugResources/home/mark/Android/Sdk/build-tools/26.0.0/aapt: 1: /home/mark/Android/Sdk/build-tools/26.0.0/aapt: Syntax error: ")" unexpected
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* 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: 9.749 secs
Error: /home/mark/helloBook/platforms/android/gradlew: Command failed with exit code 1 Error output:
/home/mark/Android/Sdk/build-tools/26.0.0/aapt: 1: /home/mark/Android/Sdk/build-tools/26.0.0/aapt: Syntax error: ")" unexpected
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Help to solve the problem. It's already the 4th day that you can not create a .apk file.
Thank you.
UPD: All my way.
mark mark # cordova create myBoo org.apache.cordova.myBoo myBoo
Creating a new cordova project.
mark mark # cd myBoo
mark myBoo # cordova platform add android
Using cordova-fetch for cordova-android#~6.2.2
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: org.apache.cordova.myBoo
Name: myBoo
Activity: MainActivity
Android target: android-25
Subproject Path: CordovaLib
Android project created with cordova-android#6.2.3
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving android#~6.2.3 into config.xml file ...
mark myBoo # cordova requirements android
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25,android-24,android-23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14,android-13,android-12,android-11,android-10,android-9,android-8,android-7
Gradle: installed /usr/share/gradle/bin/gradle
mark myBoo # cordova build android --verbose
No scripts found for hook "before_build".
No scripts found for hook "before_prepare".
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform android
Checking config.xml for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at /home/mark/myBoo/platforms/android/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/assets/www
Wrote out android application name "myBoo" to /home/mark/myBoo/platforms/android/res/values/strings.xml
android-versionCode not found in config.xml. Generating a code based on version in config.xml (1.0.0): 10000
Wrote out Android package name "org.apache.cordova.myBoo" to /home/mark/myBoo/platforms/android/src/org/apache/cordova/myBoo/MainActivity.java
This app does not have launcher icons defined
This app does not have splash screens defined
This app does not have additional resource files defined
Prepared android project successfully
No scripts found for hook "after_prepare".
No scripts found for hook "before_compile".
ANDROID_HOME=/home/mark/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Running command: /usr/share/gradle/bin/gradle -p /home/mark/myBoo/platforms/android wrapper -b /home/mark/myBoo/platforms/android/wrapper.gradle
:wrapper
BUILD SUCCESSFUL
Total time: 21.872 secs
This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.10/userguide/gradle_daemon.html
Command finished with error code 0: /usr/share/gradle/bin/gradle -p,/home/mark/myBoo/platforms/android,wrapper,-b,/home/mark/myBoo/platforms/android/wrapper.gradle
Subproject Path: CordovaLib
Running command: /home/mark/myBoo/platforms/android/gradlew cdvBuildDebug -b /home/mark/myBoo/platforms/android/build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pandroid.useDeprecatedNdk=true
Starting a Gradle Daemon (subsequent builds will be faster)
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_4oytre40bj110004xk7skx6js.run(/home/mark/myBoo/platforms/android/build.gradle:137)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:processDebugResources/home/mark/Android/Sdk/build-tools/26.0.0/aapt: 1: /home/mark/Android/Sdk/build-tools/26.0.0/aapt: Syntax error: ")" unexpected
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* 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 mins 9.742 secs
Command finished with error code 1: /home/mark/myBoo/platforms/android/gradlew cdvBuildDebug,-b,/home/mark/myBoo/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true
Error: /home/mark/myBoo/platforms/android/gradlew: Command failed with exit code 1 Error output:
/home/mark/Android/Sdk/build-tools/26.0.0/aapt: 1: /home/mark/Android/Sdk/build-tools/26.0.0/aapt: Syntax error: ")" unexpected
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

when i type ionic cordova build android

th ionic info
global packages:
#ionic/cli-utils : 1.0.0
Cordova CLI : 7.0.1
Ionic CLI : 3.0.0
local packages:
#ionic/cli-plugin-cordova : 1.0.0
#ionic/cli-plugin-ionic1 : 1.0.0
Ionic Framework : ionic1 1.3.3
System:
Node : v7.9.0
OS : Linux 4.4
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
✖ Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit code 1):
Running command: /home/mohamed/Bureau/IonicApp/PFE/hooks/after_prepare/010_add_platform_class.js /home/mohamed/Bureau/IonicApp/PFE
ANDROID_HOME=/home/mohamed/Android/Sdk
JAVA_HOME=/usr/lib/java/jdk1.8.0_131
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_5epix5or8n8ltg7s8l8l2lith.run(/home/mohamed/Bureau/IonicApp/PFE/platforms/android/build.gradle:137)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint UP-TO-DATE
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:processDebugResources/home/mohamed/Android/Sdk/build-tools/25.0.3/aapt: 3: /home/mohamed/Android/Sdk/build-tools/25.0.3/aapt: Syntax error: Unterminated quoted string
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* 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.848 secs
Error: /home/mohamed/Bureau/IonicApp/PFE/platforms/android/gradlew: Command failed with exit code 1 Error output:
/home/mohamed/Android/Sdk/build-tools/25.0.3/aapt: 3: /home/mohamed/Android/Sdk/build-tools/25.0.3/aapt: Syntax error: Unterminated quoted string
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Please update the local packages and the global package to the latest versions and try again.
global packages:
#ionic/cli-utils : 1.3.0
Cordova CLI : 7.0.1
Ionic CLI : 3.3.0
local packages:
#ionic/app-scripts : 1.3.0
#ionic/cli-plugin-cordova : 1.2.1
#ionic/cli-plugin-ionic-angular : 1.2.0
Cordova Platforms : android 6.1.2
Ionic Framework : ionic-angular 3.0.1
System:
Node : v6.10.2
OS : Windows 7
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed

Cordova BUILD FAILED : specified for property 'resDir' does not exist

I'm new using cordova, I have create project
$cordova create helloworld
$cordova platform add android
And I changed project properties target=android-22 to target=android-19 on C:\android_project\helloworld\platforms\android\project.properties and also C:\android_project\helloworld\platforms\android\CordovaLib\project.properties
And then I try to run on emulator but get this error:
c:\android_project\helloworld>cordova emulate --target=android_19 android
Running command: cmd "/s /c "c:\android_project\helloworld\platforms\android\cor
dova\run.bat""
ANDROID_HOME=C:\cordova\android\android-sdk-windows
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_60
WARNING : No target specified, deploying to emulator
Running: c:\android_project\helloworld\platforms\android\gradlew cdvBuildDebug -
b c:\android_project\helloworld\platforms\android\build.gradle -PcdvBuildArch=x8
6 -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 FAILED
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':CordovaLib:processDebugReso
urces'.
> Directory 'C:\android_project\helloworld\platforms\android\CordovaLib\build\in
termediates\bundles\debug\res' specified for property 'resDir' does not exist.
* 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: 6.375 secs
c:\android_project\helloworld\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "c:\android_project\helloworld\pl
atforms\android\gradlew cdvBuildDebug -b c:\android_project\helloworld\platforms
\android\build.gradle -PcdvBuildArch=x86 -Dorg.gradle.daemon=true"
ERROR running one or more of the platforms: Error: cmd: Command failed with exit
code 1
You may not have the required environment or OS to run this project
Have I missed something? I have googled it for hours but can't seem to find a solution.
In case this helps anyone else...
I determined that I could resolve this problem by creating the
android/CordovaLib/build/intermediates/bundles/debug/res
directory mentioned in the error - just empty.
Then I could proceed with that error disappearing.
some of Cordova Java files need api 21 or above.when you want to change target you can use android manifest xml file.

How to disable gradle in cordova?

I Upgraded my cordova from 4.3 to 5.0.0 few days ago.
After that I'm facing with various errors and build fails!
Every time I want to build my app, I have to follow this long instruction to get successful build:
cordova platform remove android
cordova platform add android
exit and reopen node.js command prompt as administrator
cordova build android
I want to pull out my hairs!
I think problem is from gradle. Is there any way to disable gradle in Cordova?
Update:
Sample error message:
D:\Projects\funny-app\funny-app>cordova build android --debug
Running command: "C:\Program Files (x86)\nodejs\node.exe" D:\Projects\funny-app\
funny-app\hooks\after_prepare\010_add_platform_class.js D:\Projects\funny-app\fu
nny-app
add to body class: platform-android
Running command: D:\Projects\funny-app\funny-app\platforms\android\cordova\build
.bat --debug
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files (x86)\java\jdk1.8.0_25
Running: D:\Projects\funny-app\funny-app\platforms\android\gradlew cdvBuildDebug
-b D:\Projects\funny-app\funny-app\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
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mergeDebugAssets'.
> Executor Singleton not started
* 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: 2.813 secs
D:\Projects\funny-app\funny-app\platforms\android\cordova\node_modules\q\q.js:12
6
throw e;
^
Error code 1 for command: cmd with args: /s /c "D:\Projects\funny-app\funny-app\
platforms\android\gradlew cdvBuildDebug -b D:\Projects\funny-app\funny-app\platf
orms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: D:\Projects\funny-app\funny-app\plat
forms\android\cordova\build.bat: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: D:\Projects\funny-app\funny-app\platforms\android\cordova\build.bat: Comm
and failed with exit code 1
at ChildProcess.whenDone (C:\Users\Ali\AppData\Roaming\npm\node_modules\cord
ova\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)
You can force CLI to use Ant during a build with the following command:
cordova build android -- --ant
I had the same problem. My solution was to run cordova clean.

Categories

Resources