ionic not generating android-build - ionic-framework

[WARN] Not performing Ionic build for project type: ionic1.
ionic cordova prepare android
cordova prepare android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\pini\Desktop\Drivercheckcall\hooks\after_prepare\010_add_platfo
rm_class.js C:\Users\pini\Desktop\Drivercheckcall
add to body class: platform-android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\pini\Desktop\Drivercheckcall\hooks\after_prepare\020_remove_sas
s_from_platforms.js C:\Users\pini\Desktop\Drivercheckcall
cordova build android --release
× Running command - failed!
[ERROR] An error occurred while running cordova build android --release (exit code 1):
Running command: "C:\Program Files\nodejs\node.exe"
C:\Users\pini\Desktop\Drivercheckcall\hooks\after_prepare\010_add_platform_class.js
C:\Users\pini\Desktop\Drivercheckcall
add to body class: platform-android
Running command: "C:\Program Files\nodejs\node.exe"
C:\Users\pini\Desktop\Drivercheckcall\hooks\after_prepare\020_remove_sass_from_platforms.js
C:\Users\pini\Desktop\Drivercheckcall
ANDROID_HOME=C:\Users\pini\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144
Subproject Path: CordovaLib
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_yewq1sjt6kzw92w3qmfn4wt0.run(C:\Users\pini\Desktop\Drivercheckcall\platforms\android\build.gradle:1
39)
FAILURE: Build failed with an exception.
* Where:
Script
'C:\Users\pini\Desktop\Drivercheckcall\platforms\android\phonegap-plugin-push\DriverCheckCall-push.gradle' line:
38
* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
> For input string: "+"
* 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: 23.062 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Script
'C:\Users\pini\Desktop\Drivercheckcall\platforms\android\phonegap-plugin-push\DriverCheckCall-push.gradle' line:
38
* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
> For input string: "+"
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I have seen this issue before with push plugin or maps plugin or google plugin, it's regarding cordova plugins and their dependencies, in your case this line it's helpful.
Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
For input string: "+"
:
So one fix will be: inside platforms/android open project.properties, you will have something like this
cordova.system.library.2=com.google.android.gms:play-services-maps:+
cordova.system.library.3=com.google.android.gms:play-services-location:+
Try to have the google play services to match in version, in my case after specifying the version I ended up with the file like this:
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-25
android.library.reference.1=CordovaLib
cordova.system.library.1=com.android.support:support-v4:24.1.1+
cordova.system.library.2=com.google.android.gms:play-services-maps:11.0.1
cordova.system.library.3=com.google.android.gms:play-services-location:11.0.1
cordova.system.library.4=com.google.android.gms:play-services-location:11.0.1
cordova.system.library.5=com.android.support:support-v13:25.1.0
cordova.system.library.6=me.leolin:ShortcutBadger:1.1.17#aar
cordova.system.library.7=com.google.firebase:firebase-messaging:11.0.1
cordova.gradle.include.1=phonegap-plugin-push/custodian-push.gradle
cordova.system.library.8=com.squareup.okhttp3:okhttp:3+

Related

How to resolve this error - No signature of method: build_bjbtdyvkyydgpgsmt9j2o0zxz.android()?

When I am trying to run my project on an emulator this error occurs
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\src\Projects\WebEmps\android\app\build.gradle' line: 28
* What went wrong:
A problem occurred evaluating project ':app'.
> No signature of method: build_bjbtdyvkyydgpgsmt9j2o0zxz.android() is applicable for argument types: (build_bjbtdyvkyydgpgsmt9j2o0zxz$_run_closure2) values: [build_bjbtdyvkyydgpgsmt9j2o0zxz$_run_closure2#40d855e]
* 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 7s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
in build.gradle on line no. 28 its 'android' block starts like this:
android
{
...
}
I don't understand what is getting wrong. Before running this project I changed my project name by selecting all "old project name" in files and replacing them all by "new project name".
I can run this on Windows but its throwing above error when tried to run on an emulator or a physical device.
Also, to check what may go wrong, I compared two different project's build.gradle files, my old file (where I was working and I got this error) does not contain these files: C:\src\Projects\online_selling_app\build\app\intermediates\manifest_merge_blame_file\debug\manifest-merger-blame-debug-report.txt
and some others in manifest_merge_blame_file folder.
What can I try next?

I've been taking an error in flutter and couldn't fix it

Even I remove and setup again nothing changed.
error
FAILURE: Build failed with an exception.
* What went wrong:
Could not open settings generic class cache for settings file 'C:\Users\Ozgur\Documents\flutterprojects\android\settings.gradle' (C:\Users\Ozgur\.gradle\caches\7.4\scripts\ea4ydi90mwjg9g63m7r6nimmx).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63
* 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 1s
Exception: Gradle task assembleDebug failed with exit code 1
I remove program and setup again added JAVA_HOME path and reinstall Java JDK-19 and didn't fix
it looks like gradle cache issues, remove the cache and re-install it via android studio, i will auto-install it based on the version you specified.
I recently fixed error it's happening due to gradle version and JDK version aren't capatible. There are 2 solution one of them is remove JDK 19 completelty and install JDK 17 instead of it. Or edit link in gradle-wrapper.properties like this gradle-7.4-all.zip

ionic 3: FAILURE: Build failed with an exception

I am trying to create Android App Bundle for an ionic 3 project. When running the command ./gradlew bundle I get the error below. In the .bash_profile file I have added the following:
export ANDROID_HOME=/Users/dome/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH/:$ANDROID_HOME/platform-tools
The Gradle version is: 4.4.1.
ERROR
iMac:android dome$ ./gradlew bundle
> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The onesignal-gradle-plugin MUST be before com.android.application!
Please put onesignal-gradle-plugin first OR update to com.android.tools.build:gradle:3.0.0 or newer!
An exception occurred while trying to find the Android build tools.
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
* Where:
Script '/Users/dome/myAPP/platforms/android/CordovaLib/cordova.gradle' line: 121
* What went wrong:
A problem occurred evaluating project ':app'.
> Unable to determine Android SDK directory.
* 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
iMac:android dome$
After adding the exports below, I didn't close and reopen the terminal hence the issues. Now sorted.
export ANDROID_HOME=/Users/dome/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH/:$ANDROID_HOME/platform-tools

Enable to execute command " ionic cordova run android " in Windows 10

FAILURE: Build failed with an exception.
Where:
Script 'C:\wamp64\www\ionic\spetinfo\platforms\android\CordovaLib\cordova.gradle' line: 64
What went wrong:
A problem occurred evaluating root project 'android'.
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.
[ERROR] An error occurred while running cordova run android (exit code 1).

Ionic Android build failed with an exception

I got the following error in the implementation of the Ionic. How do I fix this error?
windows: 10
ionic: 2.2.3
cordova: 6.5.0
Morteza#DESKTOP-ORPCJPP MINGW64 /d/ionic/Morteza (master)
$ ionic run android
> ionic-hello-world#0.0.0 ionic:build D:\ionic\Morteza
> ionic-app-scripts build
ANDROID_HOME=C:\Users\Morteza\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_25
Subproject Path: CordovaLib
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.2.1.
Required by:
:android:unspecified
> Could not resolve com.android.tools.build:gradle:2.2.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.pom'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/75.126.118.188] failed: Connection timed out: connect
* 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: 25.67 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
Try this:
Into your android sdk find sdk manager.
open sdk manager with Run as administrator.
now download android sdk build tools matching version with your ionic
also download android api->sdk platform matching version with your ionic