Error "cordova build android" - 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.

Related

FAILURE: Build failed with exception

> Executing tasks: [:app:assembleDebug]
>
> WARNING: The option 'android.enableAapt2' is deprecated and should not
> be used anymore. Use 'android.enableAapt2=true' to remove this
> warning. It will be removed at the end of 2018. :app:preBuild
> UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:compileDebugAidl
> UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE
> :app:checkDebugManifest UP-TO-DATE :app:generateDebugBuildConfig
> UP-TO-DATE :app:prepareLintJar UP-TO-DATE
> :app:mainApkListPersistenceDebug UP-TO-DATE
> :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources
> UP-TO-DATE :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT error: check logs for details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
> BUILD FAILED in 13s 9 actionable tasks: 1 executed, 8 up-to-date
In gradle.properties change android.enableAapt2=false to true
You can actually have problems in the resources but these will not be displayed if you do not correct this problem first:
The option 'android.enableAapt2' is deprecated and should not be used
anymore. Use 'android.enableAapt2 = true' to remove this warning. It
will be removed at the end of 2018.
within your gradle.properties file that is located in the root of the project, replace:
android.enableAapt2
with:
android.enableAapt2 = true
Try updating your gradle plugin. Fixed my error.
within gradle.properties file that is located in the root of the project,
I have just commented on this line, now works perfectly
android.enableAapt2 = true
Please make sure that the images and icons you included in your project is Imported by android studio or Drawable importer plugin.
to install this plugin you have to go File>setting> plugin.
then type Drawable importer
Your problem is with android.enableAapt2 .
You should check what's missing or the package is imported correctly.
Search for file android.enableAapt2 or that keyword.

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

Ionic build android fail on OSX El Capitan - :processDebugResources

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>

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.

com.phonegap.plugins.facebookconnect and phonegap-plugin-push not working together

I am building new Cordova app and can not make to work together com.phonegap.plugins.facebookconnect and phonegap-plugin-push plugins.
Here is cordova run output:
:com.phonegap.plugins.facebookconnect:FacebookLib:compileLint
:com.phonegap.plugins.facebookconnect:FacebookLib:copyDebugLint UP-TO-DATE
:com.phonegap.plugins.facebookconnect:FacebookLib:mergeDebugProguardFiles
:com.phonegap.plugins.facebookconnect:FacebookLib:preBuild
:com.phonegap.plugins.facebookconnect:FacebookLib:preDebugBuild
:com.phonegap.plugins.facebookconnect:FacebookLib:checkDebugManifest
:com.phonegap.plugins.facebookconnect:FacebookLib:preDebugTestBuild
:com.phonegap.plugins.facebookconnect:FacebookLib:prepareAndroidCordovaLibUnspecifiedDebugLibrary
:com.phonegap.plugins.facebookconnect:FacebookLib:prepareDebugDependencies
:com.phonegap.plugins.facebookconnect:FacebookLib:compileDebugAidl
:com.phonegap.plugins.facebookconnect:FacebookLib:compileDebugRenderscript
:com.phonegap.plugins.facebookconnect:FacebookLib:generateDebugBuildConfig
:com.phonegap.plugins.facebookconnect:FacebookLib:generateDebugAssets UP-TO-DATE
:com.phonegap.plugins.facebookconnect:FacebookLib:mergeDebugAssets
:com.phonegap.plugins.facebookconnect:FacebookLib:generateDebugResValues
:com.phonegap.plugins.facebookconnect:FacebookLib:generateDebugResources
:com.phonegap.plugins.facebookconnect:FacebookLib:mergeDebugResources
:com.phonegap.plugins.facebookconnect:FacebookLib:processDebugManifest
:com.phonegap.plugins.facebookconnect:FacebookLib:processDebugResources
:com.phonegap.plugins.facebookconnect:FacebookLib:generateDebugSources
:com.phonegap.plugins.facebookconnect:FacebookLib:compileDebugJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:com.phonegap.plugins.facebookconnect:FacebookLib:processDebugJavaRes UP-TO-DATE
:com.phonegap.plugins.facebookconnect:FacebookLib:packageDebugJar
:com.phonegap.plugins.facebookconnect:FacebookLib:compileDebugNdk
:com.phonegap.plugins.facebookconnect:FacebookLib:packageDebugJniLibs UP-TO-DATE
:com.phonegap.plugins.facebookconnect:FacebookLib:packageDebugLocalJar
:com.phonegap.plugins.facebookconnect:FacebookLib:packageDebugRenderscript UP-TO-DATE
:com.phonegap.plugins.facebookconnect:FacebookLib:packageDebugResources
:com.phonegap.plugins.facebookconnect:FacebookLib:bundleDebug
:prepareAndroidComPhonegapPluginsFacebookconnectFacebookLibUnspecifiedDebugLibrary
:prepareAndroidCordovaLibUnspecifiedDebugLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:compileDebugJava
C:\workspace\myApp\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:390: error: cannot find symbol
mBuilder.setColor(iconColor);
^
symbol: method setColor(int)
location: variable mBuilder of type Builder
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:compileDebugJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJava'.
> Compilation failed; see the compiler error output for details.
* 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: 27.011 secs
c:\workspace\myApp\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "c:\workspace\myApp\platforms\android\gradlew cdvBuildDebug -b c:\workspace\myApp\platforms\android\build.gradle -PcdvBuildArch=arm
-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
From https://github.com/phonegap/phonegap-plugin-push/issues/51 I understant that facebookconnect uses android-support-v4.jar which conflicts with android-support-v13.jar from phonegap-plugin-push.
I have tried to remove/replace android-support-v*.jar as suggested but that does not help.
Cordova version: 5.2.0
phonegap-plugin-push version: 1.2.0
com.phonegap.plugins.facebookconnect version: 0.11.0
UPDATE
This solution does not work with latest com.phonegap.plugins.facebookconnect plugin.
I replaced Facebook plugin with cordova-plugin-facebook4 fork. It uses v4 Android library and does not conflict with phonegap-plugin-push plugin.
Finally with some help in other forums I was able to make it work!
Here is what I did:
Remove
\plugins\com.phonegap.plugins.facebookconnect\platforms\android\FacebookLib\libs\android-support-v4.jar
file
Copy \plugins\phonegap-plugin-push\src\android\libs\android-support-v13.jar file to \plugins\com.phonegap.plugins.facebookconnect\platforms\android\FacebookLib\libs\
Open \plugins\com.phonegap.plugins.facebookconnect\platforms\android\FacebookLib\build.gradle file in text editor (use Notepad++ or any other new-lines friendly editor)
Under the dependencies block, replace support-v4 with support-v13. It should look like this:
dependencies {
compile 'com.android.support:support-v13:[20,21)'
compile 'com.parse.bolts:bolts-android:1.1.2'
}
Delete \platforms\android\build\ folder and compile project with cordova build
All paths are related to Cordova project's root.
One way will be to resolve problem through installing push plugin: cordova-plugin-push-notification , because it also uses android-support-v4.jar. Link to this version's documentation.
Run command to install:
cordova plugin add cordova-plugin-push-notification

Categories

Resources