IONIC apk Generate Issue - android

I have getting this error when I run ionic cordova build --release android
but yesterday it was running perfectly im not change anything about configuration only build distribution I think it is version issue but I unable to find how to resolve it please help
here is console log
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':app:releaseCompileClasspath'.
> Could not find any version that matches com.google.firebase:firebase-measurement-connector:[10.2.1,12.1.0[.
Versions that do not match:
17.0.0
16.0.0
15.0.0
Required by:
project :app > com.google.firebase:firebase-messaging:17.0.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 41s
11 actionable tasks: 11 executed
(node:15826) UnhandledPromiseRejectionWarning: Error: /home/chamikara/Projects/freelance/ionic/beachlines/notifications/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':app:releaseCompileClasspath'.
> Could not find any version that matches com.google.firebase:firebase-measurement-connector:[10.2.1,12.1.0[.
Versions that do not match:
17.0.0
16.0.0
15.0.0
Required by:
project :app > com.google.firebase:firebase-messaging:17.0.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 41s
at ChildProcess.whenDone (/home/chamikara/Projects/freelance/ionic/beachlines/notifications/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:15826) 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:15826) [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.

Related to this answer : https://stackoverflow.com/a/51779975/279326 I fixed by going back to ionic#4.0.3 npm i -g ionic#4.0.3

Related

ionic cordova build android --prod --release Error :app:transformDexWithDexForRelease

Yesterday I used this command and it was generated correctly, today I put sentry and now this command does not work,
is it because of the sing that applied yesterday?
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:transformDexWithDexForRelease'.
com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
com.android.dex.DexIndexOverflowException: Cannot merge new index
66590 into a non-jumbo instruction!
Try: 37 actionable tasks: 2 executed, 35 up-to-date 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 7s (node:13676) UnhandledPromiseRejectionWarning:
Error: cmd: Command failed with exit code 1 Error output: FAILURE:
Build failed with an exception.
What went wrong: Execution failed for task ':app:transformDexWithDexForRelease'.
com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
com.android.dex.DexIndexOverflowException: Cannot merge new index
66590 into a non-jumbo instruction!
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 7s
at ChildProcess.whenDone (C:\Goubun\Noediiler\neodiiler-ionic\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:13676)
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:13676) [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.
Run this command in the root of your project :
cordova plugin add https://github.com/jwall149/cordova-multidex --save
It will install cordova-multidex and your build will work fine.

Ionic Fails To build and deploy apk to physical device

I'm trying to build an app that I have tested on other devices and computers using ionic 2. I keep getting this error followed by build completed and app deployed even though it is not.
(node:11125) UnhandledPromiseRejectionWarning: Error: /Users/kieran/Desktop/finalyearproject/frontendrest/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> java.io.IOException: Could not delete path '/Users/kieran/Desktop/finalyearproject/frontendrest/platforms/android/app/build/intermediates/assets/debug/www/index.html'.
* 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 2s
at ChildProcess.whenDone (/Users/kieran/Desktop/finalyearproject/frontendrest/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:11125) 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:11125) [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.
[OK] Your app has been deployed.
Did you know you can live-reload changes from your app with --livereload?
MacOSs-MacBook-Pro:frontendrest kieran$
Sometimes I have similar problems.
Just delete intermediates folder in your path:
/Users/kieran/Desktop/finalyearproject/frontendrest/platforms/android/app/build/intermediates
Kill 'java' process in your task manager.

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?

Unable to build android app with phonegap/cordova

I am trying to build an android app with phonegap/cordova but it's failing. Below is the command
cordova build android
This is the result:
Android Studio project detected
ANDROID_HOME=/home/harish/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
studio
FAILURE: Build failed with an exception.
What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
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 0s
(node:26252) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /usr/lib/gradle/4.4.1/bin/gradle: Command failed with exit code 1
(node:26252) [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.

Cordova Failing To Build

I am a front-end developer and I am working on a app for a tech company. Because I do primarily front-end html/css/js work I'm somewhat unfamiliar on what to do when cordova fails to build, though I usually get through it by searching, I cannot find a solution to my problem. Any help is appreciated!
When I tried to run the app I got a console error informing me I needed to install the ai.api.apiai plugin so I installed it via the command line and it is appearing in the config.xml file.
This is where my trouble began.
When I run this in command line:
cordova build
I get this error:
:transformClassesWithDexForDebug FAILED
BUILD FAILED
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
Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Total time: 15.9 secs (node:6184) UnhandledPromiseRejectionWarning: Unhandled promise
rejection (rejection id: 1): 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
Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. (node:6184) [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.
Now I did try a couple of attempts such as adding to my gradle file this line of code:
defaultConfig{
multiDexEnabled true
}
But this caused another error during the build so I got rid of this line of code.
Please add this dependency if not present, in build.gradle -> compile 'com.android.support:multidex:1.0.0'

Categories

Resources