FAILURE: Build failed with an exception. creating node js apps - node.js

I'm using cordova to create apps and when I used the command
cordova build android I got this error through the CLI:
c:\Apps\projeto_1>cordova build android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\Max\AppData\Local\Android\Sdk (DEPRECATED)
Using Android SDK: C:\Program Files (x86)\Android\android-sdk
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Starting Daemon
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 7s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
Where:
Script 'C:\Apps\projeto_1\platforms\android\CordovaLib\cordova.gradle' line: 75
What went wrong:
A problem occurred evaluating script.
No usable Android build tools found. Highest 30.x installed version is 29.0.3; minimum version required is 30.0.3.
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 3s
Command failed with exit code 1: c:\Apps\projeto_1\platforms\android\gradlew cdvBuildDebug -b c:\Apps\projeto_1\platforms\android\build.gradle
Example of build failure: Build failed with an exception.
Where:
Script 'C:\Apps\projeto_1\platforms\android\CordovaLib\cordova.gradle' line: 75
What went wrong:
A problem occurred evaluating script.
No usable Android build tools found. Highest 30.x installed version is 29.0.3; minimum version required is 30.0.3.
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 3s
Command failed with exit code 1: c:\Apps\projeto_1\platforms\android\gradlew cdvBuildDebug -b c:\Apps\projeto_1\platforms\android\build.gradle

Related

ionic cordova [ERROR] An error occurred while running subprocess

I am using the command ionic cordova build and I get the following errors and I don't find a clear answer on this. With this error I can not pass the application to android studio
cordova-plugin-androidx-adapter: Processed 14 source files in 635ms
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Users\andres\AppData\Local\Android\sdk (recommended setting)
ANDROID_HOME=C:\Users\andres\AppData\Local\Android\Sdk (DEPRECATED)
Using Android SDK: C:\Users\andres\AppData\Local\Android\sdk
FAILURE: Build failed with an exception.
What went wrong:
The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Program Files\Java\jdk-17.0.4\bin\java.exe
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
Command failed with exit code 1: C:\Program Files\gradle-7.5\bin\gradle.BAT -p C:\Users\andres\Desktop\aplicacion\platforms\android wrapper -b C:\Users\andres\Desktop\aplicacion\platforms\android\wrapper.gradle
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
enter image description here
The issue might be with you java version according to the question description.
C:\Program Files\Java\jdk-17.0.4\bin\java.exe
Java 11 is supported for cordova 10+ which allows for the same minimum Android versions as cordova 9. This should now be the preferred solution.
So you need to check your ionic, cordova and java version and set it accordingly.
I hope this helps.

Update gradle version from command line using Android command line tools

I have installed command-line tools (commandlinetools-linux-6200805_latest.zip) of Android Studio, and I want to update the gradle version to 6.2.
Any idea how I can do that?
In the UI I could just go to File -> Project structure.
Do I need the UI to do this?
tried to run: ./gradlew wrapper --gradle-version=6.2 --distribution-type=all
bash-4.2$ ./gradlew wrapper --gradle-version=6.2 --distribution-type=all
FAILURE: Build failed with an exception.
* Where:
Build file '/var/lib/jenkins/workspace/myapp/android/app/build.gradle' line: 3
* What went wrong:
An exception occurred applying plugin request [id: 'com.github.triplet.play', version: '2.7.5']
> Failed to apply plugin [class 'com.github.triplet.gradle.common.validation.RuntimeValidationPlugin']
> Gradle Play Publisher's minimum Gradle version is at least Gradle 6.2 and yours
is Gradle 5.6.4. Find the latest version at
https://github.com/gradle/gradle/releases/latest, then run
$ ./gradlew wrapper --gradle-version=$LATEST --distribution-type=ALL
* 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
If you are using the Gradle wrapper, you can simply run:
./gradlew wrapper --gradle-version=6.2
If you want to use a different distribution type than bin (default), you can add the distribution-type argument:
./gradlew wrapper --gradle-version=6.2 --distribution-type=all

Can not create workspace for Liferay 7.2-rc2

I am trying to create a workspace for 7.2-rc2 but fail to do so.
I created a normal workspace for 7.1 in Liferay Developer Studio (version 3.5.0) since there is no support for 7.2 yet. To test if I can run code correctly I created a new mvc-portlet in Developer Studio.
I then set liferay.workspace.target.platform.version=7.2.0 in gradle.properties. Gradle is not able to build my module:
15:16:04: Executing task 'deploy'...
Task :wrapper
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':modules:test:buildCSS'.
Could not resolve all dependencies for configuration ':modules:test:detachedConfiguration1'.
Could not find com.liferay.portal:release.portal.bom:7.2.0.
Searched in the following locations:
https://repo.maven.apache.org/maven2/com/liferay/portal/release.portal.bom/7.2.0/release.portal.bom-7.2.0.pom
https://repo.maven.apache.org/maven2/com/liferay/portal/release.portal.bom/7.2.0/release.portal.bom-7.2.0.pom
https://repository-cdn.liferay.com/nexus/content/groups/public/com/liferay/portal/release.portal.bom/7.2.0/release.portal.bom-7.2.0.pom
https://repository-cdn.liferay.com/nexus/content/groups/public/com/liferay/portal/release.portal.bom/7.2.0/release.portal.bom-7.2.0.pom
Required by:
project :modules:test
Could not find com.liferay.portal:release.portal.bom.compile.only:7.2.0.
Searched in the following locations:
https://repo.maven.apache.org/maven2/com/liferay/portal/release.portal.bom.compile.only/7.2.0/release.portal.bom.compile.only-7.2.0.pom
https://repo.maven.apache.org/maven2/com/liferay/portal/release.portal.bom.compile.only/7.2.0/release.portal.bom.compile.only-7.2.0.pom
https://repository-cdn.liferay.com/nexus/content/groups/public/com/liferay/portal/release.portal.bom.compile.only/7.2.0/release.portal.bom.compile.only-7.2.0.pom
https://repository-cdn.liferay.com/nexus/content/groups/public/com/liferay/portal/release.portal.bom.compile.only/7.2.0/release.portal.bom.compile.only-7.2.0.pom
Required by:
project :modules:test
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2s
Could not find com.liferay.portal:release.portal.bom:7.2.0.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/liferay/portal/release.portal.bom/7.2.0/release.portal.bom-7.2.0.pom
- https://repo.maven.apache.org/maven2/com/liferay/portal/release.portal.bom/7.2.0/release.portal.bom-7.2.0.pom
- https://repository-cdn.liferay.com/nexus/content/groups/public/com/liferay/portal/release.portal.bom/7.2.0/release.portal.bom-7.2.0.pom
- https://repository-cdn.liferay.com/nexus/content/groups/public/com/liferay/portal/release.portal.bom/7.2.0/release.portal.bom-7.2.0.pom
Required by:
project :modules:test
15:16:07: Task execution finished 'deploy'.
I do not think the deprecation warning is at fault.
Which settings do I actually have to set to get all the necessary dependencies for 7.2?
It seems that 7.2.0-rc2 or rc3 have not been uploaded into the apache maven central repository yet. I'm also looking for a maven repository that has these artifacts.
By updating existing eclipse, you can build 7.2 plugin. Use below URL from liferay to update eclipse.
Install Liferay IDE

Project is not running on android emulator

I've been trying to run my project on the android emulator for a while now but no results.
Posted several times and tried to re-link libraries. Below is the exposed error
What went wrong:
A problem occurred evaluating project ':expo-react-native-adapter'.
Project with path ':expo-core' could not be found in project ':expo-react-native-adapter'.
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.1/userguide/command_line_interface.html#sec:command_line_warnings

Android Gradle dependency compile doesn't work with Java 9

Friends,
I was trying to run gradle command (mentioned below) to resolve dependencies
gradlew -q dependencies app:dependencies --configuration compile
I am using JDK9 and and using gradle 4.4 but when run above mentioned command getting an error.
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring project ':app'.
Failed to notify project evaluation listener.
javax/xml/bind/annotation/XmlSchema
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 20s
Please help me on this.
It is an Android SDK problem with Java 9: Failed to run sdkmanager --list (Android SDK) with Java 9

Resources