Open joel-guti opened 2 years ago
same error, any solution?
I found a solution that works for me. Looks that you can download a ndk version, but, Unity, by default is using it own version. Check in Unity , Preferences / External Tools . Here you can find Android NDK installed with Unity. The solution for me was, download NDK 19 from https://developer.android.com/ndk/downloads/older_releases Go to the folder where Unity is using NDK, for example : /Applications/Unity/Hub/Editor/2020.3.15f2/PlaybackEngines/AndroidPlayer/NDK Delete this content and replace with the new NDK downloaded. Unity looks that only accept NDK version 19.0.5232133, so you can open the file source.properties in the new NDK folder and change the pkg.version with the accepted one: Pkg.Revision = 19.0.5232133 Rememeber that you need to have the same version of NDK in two files more: First on Android/local.properties: ndk.dir=/Applications/Unity/Hub/Editor/2020.3.15f2/PlaybackEngines/AndroidPlayer/NDK for example and on android/app/build.gradle: ndkVersion "19.0.5232133"
With all this, I can compile for Android. Hope this helps
Hi guys, I just fixed this problem by changing the version of NDK from 23 -> 19. You can find the version in Android Studio, choose Tools. -> SDK Manager -> Android SDK -> select SKD Tools tab -> click on Show package details checkbox -> then change the version of NDK. Good luck
Hello folks,
I faced the same situation using Unity version 2021.1.12f1. I downgraded to NDK 19 and did not work.
Upon further investigation it seems this is related to a mismatch of the Unity NDK version and the version installed with Android Studio, once the two version matched I was able to build fine.
Steps:
Hope this helps,
I followed the steps @CodeMinion mentioned, and moved from that error to another :)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:stripReleaseDebugSymbols'.
> No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi
* 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 1m 15s
Running Gradle task 'assembleRelease'... 81.7s
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1
Googling that issue I found that it may relate to build tools. But.. I can't get what exactly is wrong here.
and build.gradle
options seems correct
android {
ndkVersion '19.0.5232133'
compileSdkVersion 30
buildToolsVersion '30.0.0'
UPDATE
Hope this will help someone - in my case looks like ndkVersion '19.0.5232133'
was just ignored and removing all the rest NDK I had in AndroidStudio helped to solve the problem. Also, by some reason, I couldn't compile Flutter app using min API level 30 and target API level 30. Setting min API level to 28 and target API level to 30 worked fine.
To anyone still facing this issue, in my case it was a flutter error. Currently the flutter snap package seems broken and installing it manually fixed the issue for me.
I found a solution that works for me. Looks that you can download a ndk version, but, Unity, by default is using it own version. Check in Unity , Preferences / External Tools . Here you can find Android NDK installed with Unity. The solution for me was, download NDK 19 from https://developer.android.com/ndk/downloads/older_releases Go to the folder where Unity is using NDK, for example : /Applications/Unity/Hub/Editor/2020.3.15f2/PlaybackEngines/AndroidPlayer/NDK Delete this content and replace with the new NDK downloaded. Unity looks that only accept NDK version 19.0.5232133, so you can open the file source.properties in the new NDK folder and change the pkg.version with the accepted one: Pkg.Revision = 19.0.5232133 Rememeber that you need to have the same version of NDK in two files more: First on Android/local.properties: ndk.dir=/Applications/Unity/Hub/Editor/2020.3.15f2/PlaybackEngines/AndroidPlayer/NDK for example and on android/app/build.gradle: ndkVersion "19.0.5232133"
With all this, I can compile for Android. Hope this helps
I ensured the NDK referenced in my Flutter project's 'local.properties' file was pointing to the same NDK version used in Unity, and that solved it for me.
I found a solution that works for me. Delete the unityLibrary folder in Android Project and re-copy-paste from Unity;
Hi, I tries all the above mentioned methods for this issue, none of them worked. Any more ideas ?
Open your unity project go to Edit->Preferences->ExternalTool and copy NDK path, Now open your flutter project local.properties and paste that path at ndk.dir
like this - ndk.dir=C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.9f1\\Editor\\Data\\PlaybackEngines\\AndroidPlayer\\NDK
Open your unity project go to Edit->Preferences->ExternalTool and copy NDK path, Now open your flutter project local.properties and paste that path at ndk.dir
like this -
ndk.dir=C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.9f1\\Editor\\Data\\PlaybackEngines\\AndroidPlayer\\NDK
This work for me directly. Thank @arshad-dqot .
On March 29, 2023 2:01:28 AM PDT, Sai Lin Htut @.***> wrote:
Open your unity project go to Edit->Preferences->ExternalTool and copy NDK path, Now open your flutter project local.properties and paste that path at ndk.dir
like this -
ndk.dir=C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.9f1\\Editor\\Data\\PlaybackEngines\\AndroidPlayer\\NDK
This work for me directly. Thank @arshad-dqot .
I've been wondering if there it was likely to cause problems having Android Studio's SDK and tools and Unity's. I just began changing part of a shipping app to Unity. I keep having trouble with these lines the export adds in the unityLibrary/build.gradle file: buildToolsVersion '32.0.0'
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
I found a solution that works for me. Delete the unityLibrary folder in Android Project and re-copy-paste from Unity;
This worked for me thanks.
This other solution worked for me:
1- In Unity, go to Edit->Preferences->ExternalTool and copy NDK path,
2- Open from terminal cd <NDK path>
3- open the source.properties file vi source.properties
4- note the ndk version
5- add android { ndkVersion '<version>'
to your build.gradle in your unity/android/UnityLibrary
6- Create a file in your [Project root]/android/
and name it local.properties
7- Copy the SDK and NDK path from Unity Edit->Preferences->ExternalTool. You should have something like this :
sdk.dir = <the path to sdk>
ndk.dir = <the path to ndk>
8- Now you can run the build again
I found a solution that works for me. Looks that you can download a ndk version, but, Unity, by default is using it own version. Check in Unity , Preferences / External Tools . Here you can find Android NDK installed with Unity. The solution for me was, download NDK 19 from https://developer.android.com/ndk/downloads/older_releases Go to the folder where Unity is using NDK, for example : /Applications/Unity/Hub/Editor/2020.3.15f2/PlaybackEngines/AndroidPlayer/NDK Delete this content and replace with the new NDK downloaded. Unity looks that only accept NDK version 19.0.5232133, so you can open the file source.properties in the new NDK folder and change the pkg.version with the accepted one: Pkg.Revision = 19.0.5232133 Rememeber that you need to have the same version of NDK in two files more: First on Android/local.properties: ndk.dir=/Applications/Unity/Hub/Editor/2020.3.15f2/PlaybackEngines/AndroidPlayer/NDK for example and on android/app/build.gradle: ndkVersion "19.0.5232133"
With all this, I can compile for Android. Hope this helps
I have tried many ways to run simple unity android code but at last I am able to run the build properly good with ndkVersion 19.2.5345600 Nice Answering , Properly good working with sdk.dir=C\:\Users\huzai\AppData\Local\Android\Sdk ndk.dir=C\:\Users\huzai\AppData\Local\Android\Sdk\ndk\19.2.5345600
Following all steps, when I try to compile from Flutter to a real Android device, I´m getting this error:
I´m getting the same result using Mac OS with Catalina and tested as well in Mac Os with Big Sur.
I have NDK installed, and I have disabled the mac security with: sudo spctl --master-disable
Nothing works.
Unity (please complete the following information):
Smartphone (please complete the following information):