Phonegap not building to android - android

I'm using Ubuntu 16.04 x64 to build my Phonegap project, I have installed Android Studio and SDK, updated all in the SDK Manager.
But when I try build with command phonegap build android, return fallowing error:
BUILD FAILED
Total time: 2.069 secs
phonegap build android --debug
[phonegap] executing 'cordova build android --debug ' ...
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/icon/android/drawable-ldpi-icon.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/icon/android/drawable-mdpi-icon.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/icon/android/drawable-hdpi-icon.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/icon/android/drawable-xhdpi-icon.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/icon/android/drawable-xxhdpi-icon.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/icon/android/drawable-xxxhdpi-icon.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/screen/android/drawable-land-ldpi-screen.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/screen/android/drawable-land-mdpi-screen.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/screen/android/drawable-land-hdpi-screen.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/screen/android/drawable-land-xhdpi-screen.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/screen/android/drawable-land-xxhdpi-screen.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/screen/android/drawable-land-xxxhdpi-screen.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/screen/android/drawable-port-ldpi-screen.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/screen/android/drawable-port-mdpi-screen.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/screen/android/drawable-port-hdpi-screen.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/screen/android/drawable-port-xhdpi-screen.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/screen/android/drawable-port-xxhdpi-screen.png
cp: no such file or directory: /home/lxuancheng/Documents/Projects/dont-press/www/res/screen/android/drawable-port-xxxhdpi-screen.png
ANDROID_HOME=/opt/android-sdk-linux
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
: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: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: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
:generateDebugAssets
UP-TO-DATE
:mergeDebugAssets
UP-TO-DATE
:generateDebugResValues
UP-TO-DATE
:generateDebugResources
UP-TO-DATE
:mergeDebugResources
UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources
/home/lxuancheng/Documents/Projects/dont-press/platforms/android/build/intermediates/res/merged/debug/values/values.xml:4 : AAPT: Apostrophe not preceded by \ (in Don't Press!)
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 '/opt/android-sdk-linux/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: 2.408 secs
Error: Error code 1 for command: /home/lxuancheng/Documents/Projects/dont-press/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/lxuancheng/Documents/Projects/dont-press/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

values.xml line 4 :
AAPT: Apostrophe not preceded by \ (in Don't Press!)
Please update your string to Don\'t Press! to escape the apostrophe.

When you open up your project in Android Studio, it uses its own version of gradle and this version differs with the version that phonegap build uses most of the time.
Try this, it should work :
Delete android build files : phonegap clean
And then : phonegap build android

I has create Phonegap project in another computer.
I resolved this problem re-created Phonegap project in my actual pc, and merged wwwfolder.
And I have REPLACED www folder with my project, so it has not www/res folder, this maybe turn my project no build.

Related

React-Native run android error java is not incremential and react-native upgrade dismatch version with node_module

I just started my project with the init command create-react-native-app and I installed all prerequires.
I have some problems with the command react-native run-android I got this error
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComFacebookFrescoDrawee081Library UP-TO-DATE
:app:prepareComFacebookFrescoFbcore081Library UP-TO-DATE
:app:prepareComFacebookFrescoFresco081Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipeline081Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineOkhttp081Library UP-TO-DATE
:app:prepareComFacebookReactReactNative0201Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:bundleDebugJsAndAssets SKIPPED
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
I tried to search about it and people are talking about upgrading react-native but when I try to "react-native-git-upgrade" i got an error with version of my "package.json".
git-upgrade info Check for updates
git-upgrade info Read package.json files
git-upgrade info Check declared version
git-upgrade info Check matching versions
git-upgrade ERR! An error occurred during upgrade:
git-upgrade ERR! Error: react-native version in "package.json" (https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz) doesn't match the installed version in "node_modules" (0.55.4).
Try running "npm install" to fix this.
at checkMatchingVersions (/usr/local/lib/node_modules/react-native-git-upgrade/checks.js:24:11)
at Object.<anonymous> (/usr/local/lib/node_modules/react-native-git-upgrade/cliEntry.js:253:5)
at Generator.next (<anonymous>)
at step (/usr/local/lib/node_modules/react-native-git-upgrade/cliEntry.js:171:191)
at /usr/local/lib/node_modules/react-native-git-upgrade/cliEntry.js:171:361
at tryCallOne (/usr/local/lib/node_modules/react-native-git-upgrade/node_modules/promise/lib/core.js:37:12)
at /usr/local/lib/node_modules/react-native-git-upgrade/node_modules/promise/lib/core.js:123:15
at flush (/usr/local/lib/node_modules/react-native-git-upgrade/node_modules/asap/raw.js:50:29)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
When I do npm install nothing change, I tried to delete my node_modules directory and create new one with npm install but it doesn't change.
I'm on Ubuntu and I'm struggling with this since few days ...
I think these steps will help you.
Go to your project directory and run this command [Ubuntu: cd
android && ./gradlew clean]
Delete build folder from android directory, assuming you are in android directory [rm -rf build in Ubuntu]
If this steps doesn’t produce any result then follow steps [1,2]
and then remove node_modules directory and run npm install after
following [1,2] from the root directory of your project .
Finally, go with this command react-native run-android from project root.

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.

Errors while building the android platfom with IONIC After adding icons and splash screen

Running command: /home/vimal/vimal/Attendance/hooks/after_prepare/010_add_platform_class.js /home/vimal/vimal/Attendance
add to body class: platform-android
ANDROID_HOME=/opt/android-sdk
JAVA_HOME=/usr/lib/jvm/default-java
: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
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:compileDebugAidl
:CordovaLib:generateDebugBuildConfig
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets
:CordovaLib:processDebugManifest
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:prepareAndroidCordovaLibUnspecifiedDebugLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
AAPT: libpng error: Read Error
AAPT: libpng error: Read Error
AAPT: libpng error: Read Error
AAPT: libpng error: Read Error
AAPT: libpng error: Read Error
AAPT: libpng error: Read Error
:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':mergeDebugResources'.
Some file crunching failed, see logs 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: 16.436 secs
Error: Error code 1 for command: /home/vimal/vimal/Attendance/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/vimal/vimal/Attendance/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
There is no a single answer to that. Some tips (possible solutions) are:
1) rename every filename who content a special character (image, html, template, javascript file, css)
2)
ionic platform remove android
ionic platform add android
3) check in /resources/android/splash folder to see for broken images
4)
ionic platform remove android
ionic platform add android
ionic state restore
ionic resources

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