A problem occurred configuring project ':CordovaLib - node.js

When I try to compile using
ionic cordova build --release android
I get the following error message...What might be the reason..
BUILD FAILED in 0s
cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
* 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
[ERROR] An error occurred while running subprocess cordova.
cordova build android --release exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.

It depends on what version of the Android NDK you are using. The suppport for MIPS and MIPS64 abis was stopped in NDK r17 (see Android NDK official documentation). This is because MIPS-based Android devices are completely obsolete. You need to use NDK r16 or older for it to work. You can download older NDK releases here. Alternativeley, as suggested here, you can just copy the corresponding directories from the NDK r17 (or older) in the r18 ndk-bundle/toolchains. The ones in the r17 are actually empty with a little notice that says that the directories were left there for compatibility. This last option is what I have done and it worked for me.

Its the problem with NDK tool chains file missing in NDK bundle, to resolve this issue make sure you properly install the NDK bundle, still if you cant fine try to download externally and place in the right path.
If your not using NDK tools for your app you can remove the entire folder of NDk and it will work fine with a warning message that NDK tools files missed

Related

How to fix failing the sync project with Gradle files?

`FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
Invalid revision: 3.22.1-g37088a8-dirty
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
CONFIGURE FAILED in 54s
Invalid revision: 3.22.1-g37088a8-dirty
`
I am using 3.1.2 version of android studio software. gradle version is 4.6. I am getting above error when I going to build the project. I tried change the gradle version to 4.4 too in gradle-wrapper.properties file. But anything didn't work. Can anyone have any solution as well as a reason why this happen?
As well as i have not set gradle in environment >> system variable. Because I thougtht It is installing to project from android studio. (Please tell something if there any wrong)

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.

Gradle works with Android Studio but cmd script fails

I freshly installed Android Studio and created a HelloWorld project. It works fine. But when I tried to build it via commandline gradlew script found in the project directory it first gave me the error that java is not installed.
After installing the java its now giving me the error:
FAILURE: Build failed with an exception.
What went wrong: Could not determine java version from '11.0.1'.
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
Following image shows the java version and the command I executed:
Note: I am running it on a Mac with MacOS High Sierra (10.13.6)
This had something to do with my gradle version. I set the version to the latest by going to Project Structure selecting Project from side menu and set the Gradle version to 4.10.2.

Gradle build error using react native

I get this error when trying to run an app on an android emulator(Android Studio) from a console window:
$ react-native run-android
Scanning folders for symlinks in C:\Users\Brian\desktop\codervets\arrive-alive\aa_app\node_modules (27726ms)
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Starting a Gradle Daemon (subsequent builds will be faster)
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
The SDK directory 'c:\Users\eelia001\AppData\local\android\sdk1' does not exist.
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 4m 51s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
And yet my sdk directory in android studio has the following directory:
C:\Users\Brian\AppData\Local\Android\Sdk
Has anyone else ran into this issue? If so, how do I fix it?
The error states:
The SDK directory 'c:\Users\eelia001\AppData\local\android\sdk1' does not exist.
And you say your SDK is in:
C:\Users\Brian\AppData\Local\Android\Sdk
Since those aren't the same directory, my guess is that's the problem. Are you perhaps logged in as the wrong user? You're going to want to check that ANDROID_HOME is set correctly.
So I'm not sure why it was setup the way it was, but the way to fix it is to go to Advanced System Settings → Environment variables. Thank you to #Rich Churcher for the link to a proper tutorial (it's outdated but the steps worked).

java.security.NoSuchAlgorithmException while building a simple android app using Android Studio

I downloaded the Android Studio and trying to build a simple Login Activity. But the Make Project fails with this error.
Environment: Windows 7 64 bit
Gradle:
trouble writing output: java.security.NoSuchAlgorithmException: SHA-1 MessageDigest not available
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':MyApp:dexDebug'.
Running C:\Program Files (x86)\Android\android-studio\sdk\build-tools\android-4.2.2\dx.bat failed. See output
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I have made sure the Gradle zip was downloaded and installed properly
Any hints what else should I check for?
I was using IBM JDK. Switching to Sun/Oracle JDK fixed the problem.

Resources