Unable to build ionic project - android

I'm trying to build my ionic project, but getting following error (compilation fails in gradle configuration):
PS C:\Workspace\mobileapp> ionic cordova build android
--debug
Running app-scripts build: --platform android --target cordova
[13:05:08] build dev started ...
[13:05:08] clean started ...
[13:05:08] clean finished in 7 ms
[13:05:08] copy started ...
[13:05:08] transpile started ...
[13:05:19] transpile finished in 11.49 s
[13:05:19] preprocess started ...
[13:05:19] deeplinks started ...
[13:05:20] deeplinks finished in 255 ms
[13:05:20] preprocess finished in 256 ms
[13:05:20] webpack started ...
[13:05:20] copy finished in 12.27 s
[13:05:37] webpack finished in 17.47 s
[13:05:37] sass started ...
[13:05:41] sass finished in 3.91 s
[13:05:41] postprocess started ...
[13:05:41] removed unused font files
[13:05:41] postprocess finished in 80 ms
[13:05:41] lint started ...
[13:05:41] build dev finished in 33.78 s
cordova build android --debug ANDROID_HOME=C:\Users\user\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_151 Starting a Gradle Daemon
(subsequent builds will be faster)
[13:06:05] lint finished in 23.73 s
:wrapper
BUILD SUCCESSFUL in 17s 1 actionable task: 1 executed 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_bbib3h28v2rns6xj5u95qezuw.run(C:\Workspace\mobileapp\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.
File C:\Users\user.android\repositories.cfg could not be loaded.
BUILD FAILED
Total time: 20.704 secs FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':_debugApkCopy'.
Could not find com.google.android.gms:play-services-auth:11.8.0.
Searched in the following locations:
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.pom
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.jar
file:/C:/Workspace/mobileapp/platforms/android/sdk-manager/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.jar
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.pom
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.jar
file:/C:/Workspace/mobileapp/platforms/android/sdk-manager/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.jar
Required by:
project :
Could not find com.google.android.gms:play-services-identity:11.8.0.
Searched in the following locations:
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.pom
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.jar
file:/C:/Workspace/mobileapp/platforms/android/sdk-manager/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.jar
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.pom
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.jar
file:/C:/Workspace/mobileapp/platforms/android/sdk-manager/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.jar
Required by:
project :
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. (node:15112) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit
code 1 Error output: FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':_debugApkCopy'.
Could not find com.google.android.gms:play-services-auth:11.8.0.
Searched in the following locations:
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.pom
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.jar
file:/C:/Workspace/mobileapp/platforms/android/sdk-manager/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.jar
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.pom
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.jar
file:/C:/Workspace/mobileapp/platforms/android/sdk-manager/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.jar
Required by:
project :
Could not find com.google.android.gms:play-services-identity:11.8.0.
Searched in the following locations:
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.pom
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.jar
file:/C:/Workspace/mobileapp/platforms/android/sdk-manager/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.jar
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.pom
file:/C:/Users/user/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.jar
file:/C:/Workspace/mobileapp/platforms/android/sdk-manager/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.jar
Required by:
project :
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
at ChildProcess.whenDone (C:\Workspace\mobileapp\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at ChildProcess.emit (events.js:159:13)
at maybeClose (internal/child_process.js:943:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) (node:15112)
UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function
without a catch block, or by rejecting a promise which was not handled
with .catch(). (rejection id: 1) (node:15112) [DEP0018]
DeprecationWarning: Unhandled promise rejections are deprecated. In
the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.
I'm having following version of tools:
Ionic: 3.20.0
Cordova: 8.0.0
Cordova-Android: 6.2.3
Any help would be very grateful.

Related

Ionic Cordova run failure for "ionic cordova run android"

I have an Ionic Cordova app that I have not touched in a few months. I wanted to make a small tweak to the app today and release it but when I did, I started having a dependency issue.
When I try to run 'ionic cordova run android' the build fails. Even without making any changes to the app (revert all changes and try to build what worked for the last APK) it still is failing. I have tried uninstalling the cordova intercom plugin and that changed nothing. I have also tried updating all of my npm packages and that did not help either.
This is the error log I get:
cordova run android
Android Studio project detected
cordova-android-firebase-gradle-release: Android platform: cordova-android#7
cordova-android-firebase-gradle-release: No custom version found in config.xml - using plugin default
cordova-android-play-services-gradle-release: Android platform: cordova-android#7
cordova-android-play-services-gradle-release: No custom version found in config.xml - using plugin default
cordova-android-support-gradle-release: Android platform: cordova-android#7
cordova-android-support-gradle-release: No custom version found in config.xml - using plugin default
Preparing Firebase on Android
ANDROID_HOME=C:\Users\Boogaloo\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_171
studio
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
cordova-android-firebase-gradle-release: 15.0.0
cordova-android-play-services-gradle-release: 15.0.0
cordova-android-support-gradle-release: 27.+
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
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_8vin5yy2zwz3fxyzepqpp0rqu.run(C:\Users\Boogaloo\WebstormProjects\IONIC\projects\myapp\platforms\android\app\build.gradle:151)
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\Boogaloo\WebstormProjects\IONIC\projects\myapp\platforms\android\cordova-plugin-intercom\savings-build-extras-intercom.gradle' line: 71
What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:compile'.
Could not find com.google.android.gms:strict-version-matcher-plugin:15.0.0.
Searched in the following locations:
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://maven.google.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://maven.google.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://repo1.maven.org/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://repo1.maven.org/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://dl.google.com/dl/android/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://dl.google.com/dl/android/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
Required by:
project :app > com.google.gms:google-services:4.2.0
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 3s
(node:3432) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\Boogaloo\WebstormProjects\IONIC\projects\myapp\platforms\android\cordova-plugin-intercom\savings-build-extras-intercom.gradle' line: 71
What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:compile'.
Could not find com.google.android.gms:strict-version-matcher-plugin:15.0.0.
Searched in the following locations:
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
file:/C:/Users/Boogaloo/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://maven.google.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://maven.google.com/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://repo1.maven.org/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://repo1.maven.org/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
https://dl.google.com/dl/android/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.pom
https://dl.google.com/dl/android/maven2/com/google/android/gms/strict-version-matcher-plugin/15.0.0/strict-version-matcher-plugin-15.0.0.jar
Required by:
project :app > com.google.gms:google-services:4.2.0
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 3s
at ChildProcess.whenDone (C:\Users\Boogaloo\WebstormProjects\IONIC\projects\myapp\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:3432) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3432) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Update
I tried updating the cordova android platform to 7.1.0 but it hasn't helped.
I can't seem to delete the cordova firebase plugin using the command
ionic cordova plugin remove cordova-plugin-firebase
Do you use cordova-plugin-firebase?
If so,
run ionic cordova plugin remove cordova-plugin-firebase and try building again.
If it works, ionic cordova plugin add cordova-plugin-firebase#2.0.5

ionic build cordova android gives error " UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 "

I am trying to build and ionic project as an apk. When I do ionic cordova build android it gives the following error
Running app-scripts build: --platform android --target cordova
[23:35:31] build dev started ...
[23:35:31] clean started ...
[23:35:31] clean finished in 20 ms
[23:35:31] copy started ...
[23:35:31] deeplinks started ...
[23:35:31] deeplinks finished in 75 ms
[23:35:31] transpile started ...
[23:35:35] transpile finished in 3.87 s
[23:35:35] preprocess started ...
[23:35:35] preprocess finished in 33 ms
[23:35:35] webpack started ...
[23:35:35] copy finished in 4.25 s
[23:35:40] webpack finished in 4.78 s
[23:35:40] sass started ...
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[23:35:41] sass finished in 1.02 s
[23:35:41] postprocess started ...
[23:35:41] postprocess finished in 77 ms
[23:35:41] lint started ...
[23:35:41] build dev finished in 10.20 s
> cordova build android --debug
You have been opted out of telemetry. To change this, run: cordova telemetry on.
Android Studio project detected
ANDROID_HOME=C:\Users\makarov\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144
studio
Subproject Path: CordovaLib
Subproject Path: app
[23:35:44] lint finished in 3.65 s
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\My_Files\Projects\MyNoteApp\platforms\android\CordovaLib\build.gradle' line: 84
* What went wrong:
A problem occurred evaluating project ':CordovaLib'.
> build_ihrdqe7fln9qjqpg3xt8ghgr$_run_closure3$_closure11$_closure12$_closure13$_closure14
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
(node:11172) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\My_Files\Projects\MyNoteApp\platforms\android\CordovaLib\build.gradle' line: 84
* What went wrong:
A problem occurred evaluating project ':CordovaLib'.
> build_ihrdqe7fln9qjqpg3xt8ghgr$_run_closure3$_closure11$_closure12$_closure13$_closure14
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
at ChildProcess.whenDone (C:\My_Files\Projects\MyNoteApp\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at ChildProcess.emit (events.js:159:13)
at maybeClose (internal/child_process.js:943:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
(node:11172) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11172) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
When I do cordova platform ls I get this output
Installed platforms:
android 7.0.0
Available platforms:
browser ~5.0.1
ios ~4.5.4
osx ~4.0.1
windows ~5.0.0
www ^3.12.0
My Ionic version is 3 and I have Android SDK Platform-Tools 27 installed.
I also tried to build this app using PhoneGap too. When testing by hosting the app using PhoneGap desktop and using PhoneGap app on my phone, the app works fine including any native API that I am using (i.e. Toasts). When I go to PhoneGap build website and build my app into APK and run it on my phone I only get a white screen and nothing comes up.

error when ionic cordova run android in ionic

error in my terminal
Android Studio project detected
ANDROID_HOME=C:\Users\FUJIN\AppData\Local\Android\Sdk\tools
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_161\
studio
Subproject Path: CordovaLib
Subproject Path: app
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\FUJIN\hilih\platforms\android\CordovaLib\cordova.gradle' line: 68
What went wrong:
A problem occurred evaluating project ':CordovaLib'.
No installed build tools found. Install the Android build tools version 19.1.0 or higher.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
(node:15572) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\FUJIN\hilih\platforms\android\CordovaLib\cordova.gradle' line: 68
What went wrong:
A problem occurred evaluating project ':CordovaLib'.
No installed build tools found. Install the Android build tools version 19.1.0 or higher.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
at ChildProcess.whenDone (C:\Users\FUJIN\hilih\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at ChildProcess.emit (events.js:180:13)
at maybeClose (internal/child_process.js:936:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) (node:15572)
UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function
without a catch block, or by rejecting a promise which was not handled
with .catch(). (rejection id: 1) (node:15572) [DEP0018]
DeprecationWarning: Unhandled promise rejections are deprecated. In
the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code. [02:00:48] lint finished
in 4.01 s
[OK] Your app has been deployed.
Did you know you can live-reload changes from your app with --livereload?

can´t create an apk with an ionic project

Hi im new in ionic and im trying to create an apk to in order to test my qr scanner project, but when I run the command ionic cordova build android --release
i got the following error output:
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
:processReleaseManifest FAILED
BUILD FAILED
Total time: 13.446 secs
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml:19:5-65 Error:
Element uses-permission#android.permission.CAMERA at AndroidManifest.xml:19:5-65 duplicated with element
declared at AndroidManifest.xml:16:5-90
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml:21:5-84 Error:
Element uses-feature#android.hardware.camera at AndroidManifest.xml:21:5-84 duplicated with element declared at
AndroidManifest.xml:17:5-85
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml Error:
Validation failed, exiting
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed with multiple errors, see logs
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml:19:5-65 Error:
Element uses-permission#android.permission.CAMERA at AndroidManifest.xml:19:5-65 duplicated with element
declared at AndroidManifest.xml:16:5-90
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml:21:5-84 Error:
Element uses-feature#android.hardware.camera at AndroidManifest.xml:21:5-84 duplicated with element declared at
AndroidManifest.xml:17:5-85
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml Error:
Validation failed, exiting
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed with multiple errors, see logs
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Could someone helpme with this?
output:
C:\Users\delacrga\Ionic projects\myApp>ionic cordova build android --prod --release -- -- --keystore=filename.keystore --alias=myalias
Running app-scripts build: --prod --iscordovaserve --externalIpRequired --nobrowser
[08:52:04] build prod started ...
[08:52:04] clean started ...
[08:52:04] clean finished in 10 ms
[08:52:04] copy started ...
[08:52:04] ngc started ...
[08:52:15] ngc finished in 11.48 s
[08:52:15] preprocess started ...
[08:52:16] deeplinks started ...
[08:52:16] deeplinks finished in 63 ms
[08:52:16] optimization started ...
[08:52:16] copy finished in 11.85 s
[08:52:26] optimization finished in 10.47 s
[08:52:26] preprocess finished in 10.54 s
[08:52:26] webpack started ...
[08:52:32] webpack finished in 5.46 s
[08:52:32] sass started ...
[08:52:32] uglifyjs started ...
[08:52:33] sass finished in 1.22 s
[08:52:33] cleancss started ...
[08:52:35] cleancss finished in 1.93 s
[08:52:42] uglifyjs finished in 10.23 s
[08:52:42] postprocess started ...
[08:52:42] postprocess finished in 15 ms
[08:52:42] lint started ...
[08:52:42] build prod finished in 37.83 s
> cordova build android --release -- --keystore=filename.keystore --alias=myalias
× 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 --release -- --keystore=filename.keystore --alias=myalias
(exit code 1):
ANDROID_HOME=C:\Users\delacrga\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\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_amlj4yw9chmdse17z8bfqqws2.run(C:\Users\delacrga\Ionic
projects\myApp\platforms\android\build.gradle:139)
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\delacrga\Ionic projects\myApp\platforms\android\build.gradle' line: 289
* What went wrong:
A problem occurred evaluating root project 'android'.
> Keystore file does not exist: C:\Users\delacrga\Ionic projects\myApp\platforms\android\..\..\filename.keystore
* 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: 4.175 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\delacrga\Ionic projects\myApp\platforms\android\build.gradle' line: 289
* What went wrong:
A problem occurred evaluating root project 'android'.
> Keystore file does not exist: C:\Users\delacrga\Ionic projects\myApp\platforms\android\..\..\filename.keystore
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
By any chance if you have two different plugins installed which asks permission for the camera i.e. cordova-plugin-qrscanner and phonegap-plugin-barcodescanner together, it will cause this issue.
Remove either of the plugin by
ionic cordova plugin remove phonegap-plugin-barcodescanner
or
ionic cordova plugin remove cordova-plugin-qrscanner
Yes.#Jay is right. Because my ionic project have two different plugins installed which asks permission for the camera. cordova-plugin-qrscanner and cordova-plugin-cszbar,Remove either of the plugin then working.

An issue occurred configuring root project 'android'

I've read all posts having same issue, none resolved this. I am totally new to Ionic (I have some knowledge about Crodova and intelXdk but not Ionic).
I followed some tutorials to get my first app running. Firstly, it was running fine (of course, it had only texts :D ) then I started trying to make facebook login in the App.
I wasn't able to test this in Chrome as the facebook and storage are both Native dependencies, and could be not tested in a computer. Thus , I started trying to build the android app in order to test this in my phone and everytime I launch "ionic run android" I get this :
ionic run android --stacktrace
> ionic-app-base#0.0.0 ionic:build /home/chaibi/Bureau/foody
> ionic-app-scripts build "--stacktrace"
[16:14:53] ionic-app-scripts 1.3.7
[16:14:53] build dev started ...
[16:14:53] clean started ...
[16:14:53] clean finished in 4 ms
[16:14:53] copy started ...
[16:14:53] transpile started ...
[16:14:55] transpile finished in 2.34 s
[16:14:55] preprocess started ...
[16:14:55] deeplinks started ...
[16:14:55] deeplinks finished in 19 ms
[16:14:55] preprocess finished in 21 ms
[16:14:55] webpack started ...
[16:14:55] copy finished in 2.64 s
[16:15:04] webpack finished in 8.52 s
[16:15:04] sass started ...
[16:15:05] sass finished in 1.10 s
[16:15:05] postprocess started ...
[16:15:05] postprocess finished in 6 ms
[16:15:05] lint started ...
[16:15:05] build dev finished in 12.07 s
[16:15:07] lint finished in 2.37 s
ANDROID_HOME=/home/chaibi/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_2h23ogq2gf6aqvti7pywfv5r2.run(/home/chaibi/Bureau/foody/platforms/android/build.gradle:137)
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> java.lang.NullPointerException (no error message)
* 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.822 secs
Error: /home/chaibi/Bureau/foody/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I am using Ionic 2.2, openjdk-8 and developping using WebStorm

Categories

Resources