Error information: NDK solution Result: Project settings: Gradle model version = 6.1, NDK version UNKNOWN
However, the NDK has been defined in the Project Structure > SDK location > Android NDK location: android \ sdk \ ndk \ 21.0.6113669.
What is the cause of the error?
If the synchronization is normal, the compilation is successful. However, if the synchronization is performed only, the APK file is not packed and generated. In this case, try Build->Build Bundle(s)/APK(s)->Build APK(s). The generated APK file is stored in the project directory\build\outputs\apk\debug directory.
The error message "NDK Resolution Outcome: Project settings: Gradle model version=6.1, NDK version is UNKNOWN" should be displayed in the Event Log, which does not affect the compilation of the project.
If the project fails to be compiled, provide the build error information.
If an error occurs, click Run build in the Build window to display the detailed error information.
Related
I have a simple react-native project when I try to build an android release version of the application, I face this error message:
Caused by: java.lang.RuntimeException:
org.gradle.api.InvalidUserDataException: NDK not configured. Download
it with SDK manager. Preferred NDK version is '21.4.7075529'
I made a Keystore and set password like android studio to get a release and debug apk.
I tried this until now:
I tried to set NDK in android studio but couldn't build the project.
I also modified build.gradle to build the project but was unsuccessful.
I put my singingConfig and buildTypes and also stackTrace below.
my keystore data
singingConfig and buildTypes
What went wrong:
A problem occurred evaluating project ':expo'.
A problem occurred configuring project ':expo-modules-core'.
Failed to notify project evaluation listener.
> org.gradle.api.InvalidUserDataException: NDK not configured. Download it with SDK manager. Preferred NDK version is '21.4.7075529'.
> Could not get unknown property 'release' for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.
Open root folder projectname > android > open local.properties > copy and paste below lines after sdk.dir (if you don't have a local.properties file copy the below file and change SDK path according to your operating system.)
sdk.dir=/Users/yourusername/Library/Android/sdk
ndk.dir=/Users/yourusername/Library/Android/sdk/ndk/21.4.7075529 (You should find this version in the NDK folder and the path will vary depending on your operating system.);
I solved this problem using another way to get release version of the apk.
I used eas build -p android or expo build:android and finally after a really long time expo generates apk on his website. But it was too large application about 60mg and I'm trying to reduce it's size.
eas build -p android this command is for abb version
expo build:android this is for apk release.
but unfortunately, I Couldn't use gradle in order to release apk.
Recently I started with Flutter and made an app, now I am trying to sign the APK for the release version as documented in: https://developer.android.com/studio/publish/app-signing
I have searched a lot on the internet but I have absolutely no clue what I am doing wrong..
When I try to generate the signed APK with my Keystore I am running into an error:
Information:java: Errors occurred while compiling module 'vista_presentie'
Information:javac 1.8.0_242-release was used to compile java sources
Information:Module "vista_presentie" was fully rebuilt due to project configuration/dependencies changes
Information:28-10-2020 19:42 - Build completed with 1 error and 0 warnings in 5 s 852 ms
** Error:java: invalid source release: 14
If I need to give some more information from the code I will update this question as soon as possible, please just ask me :)
Kind Regards,
Kevin
It seems you're using Java 1.8 to compile but in your android studio project you may have set the java language level to 14.
In Android Studio, go to Project Structure -> Modules -> Properties and
set Source Compatibility and Target Compatibility to 1.8 (Java 8)
I have tried the Crystax sample on IDEA, and I have compiled it successfully, got it to run on my phone.
However, when I try to modify the project, IDEA throws an error about Gradle version:
Error:The project is using an incompatible version of the Android Gradle "experimental" plugin.
Please update your project to use version 0.9.0.
Then I updated it and met new problems:
Gradle version 3.3 is required. Current version is 4.1.
Please fix the project's Gradle settings.
I choose to Fix Gradle wrapper and re-import project
Then the next error appears:
Cannot set readonly property: proguardFiles for class: com.android.build.gradle.managed.BuildType
Please, is there anyone who knows how to use Crystax on IDEA IDE?
I found an alternative way, which does not relies on AS to build.
Just set your system PATH to Crystax-ndk folder, set up your Application.mk and Android.mk, and run command:
ndk-build
then you will get the result lib or executable file, then, link it to your Android project.
My Application is built successfully on Eclipse but fails to Build on android studio.
It returns the error code Ndk is not Configured.
Then I've added ndk path to build.gradle then its showing the following error:
Information:Gradle tasks [:nano:assembleDebug]
WARNING [Project: :nano] Current NDK support is deprecated. Alternative will be provided in the future.
:nano:preBuild UP-TO-DATE
:nano:preDebugBuild UP-TO-DATE
:nano:compileDebugNdk
make.exe: *** No rule to make target `C:\Users\admin\nano\nano\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/la_audio_processing_android/C_\Users\admin\nano\nano\src\main\jni', needed by `C:\Users\admin\nano\nano\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/la_audio_processing_android/C_\Users\admin\nano\nano\src\main\jni\LA_PostProcessing.o'. Stop.
Error:Execution failed for task ':nano:compileDebugNdk'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\admin\AppData\Local\Android\ndk\ndk-build.cmd'' finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 3.449 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
This is the problem faced by Android studio users in Windows environment.
First for NDK not Configured problem
Go to local.properties file and give ndk path...
for ex :
#Wed Mar 18 14:10:33 IST 2015
sdk.dir=C\:\\Users\\admin\\AppData\\Local\\Android\\sdk1
ndk.dir=C\:\\Users\\admin\\AppData\\Local\\Android\\ndk
Then for the Next Problem or Error...
Goto JNI Folder and create an empty c file by any name...
Then your problem will be solved...
Some Quick links about this are
http://ph0b.com/android-studio-gradle-and-ndk-integration/
And
https://code.google.com/p/android/issues/detail?id=66937
Go to option File->Project Structure
Select SDK Location->Android NDK Location and choose NDK listed in dropdown
For whatever reason, setting ndk.dir on the properties file is not working for me. However, setting/exporting the variable ANDROID_NDK_HOME prior to launching android studio did the trick.
Bash syntax (paths below are specific to my installation)
export ANDROID_HOME=/opt/android-sdk-linux
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk-bundle
Environment
Ubuntu Linux x64/GNU bash, version 4.4/Android Studio 2.2.3
Goto Files -> Project Structure -> SDK Location
Android NDK Location is at the bottom right of the window.
I use Android Studio 1.4.1.
Below is my local.properties
ndk.dir=C:\Users\BestQ\AppData\Local\Android\Sdk\ndk-bundle
sdk.dir=C:\Users\BestQ\AppData\Local\Android\Sdk
It work well.
In build.gradle use
android {
ndkVersion '21.1.6352462'
}
and use android.useDeprecatedNdk=true in gradle.properties
In some cases, you need to point exact version of ndk version on the local.properties file like that:
ndk.dir=/Users/ali6p/Library/Android/sdk/ndk/21.3.6528147
If you need to install a specific version of ndk bundle, open Android Studio preferences and install the version (Preferences > Appearance & Behaviour > System Settings > Android SDK > SDK Tools: Show Package Details > NDK (Side by side): check the version:
My issue was caused by the target file not being found (in my case, a git sub-module needed to be checked out), so ensure all the referenced files exist on the specified path.
Maybe the NDK is not installed.
If it's the case, go to SDK Manager (top-right icon).
Go to Android SDK > SDK Tools
Check NDK (Side by side) and install it.
I cannot build the project using Idea, I get following message right after launch:-
Error:Android Gradle Build Target: org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle installation 'C:\Users\username\.gradle\wrapper\dists\gradle-1.11-bin\4h5v8877arc3jhuqbm3osbr7o7\gradle-1.11'.
content of following directory:
c:\Users\malousek\.gradle\wrapper\dists\gradle-1.11-bin\4h5v8877arc3jhuqbm3osbr7o7\gradle-1.11\
is following:
bin
init.d
lib
media
changelog, license, notice,
IDEA Settings for Gradle:
Use Default Gradle Wrapper (recommended)
Last time I tried Intellij 13 It had many problems with Gradle (1.11+), use Intellij EAP 14 or switch to Android Studio.
You can try removing "C:\Users\username.gradle\wrapper\dists\" directory and resync your gradle project.