-
Notifications
You must be signed in to change notification settings - Fork 533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Receiving "NDK is not installed" error despite using NDK installed with Unity #832
Comments
I have the same issue too. You can fix it by specifying the ndkVersion within the build.gradle in the generated unity project. However, it will be overriden every time you export the project, so I wrote a command that overrides the generated version with the one that includes the ndkVersion line.
|
That did not exactly work for me @weidenbach , but gave me a hint as to how the problem might be solved. As I have only limited experience with flutter and almost none with vanilla android development, or at least I have never engaged in projects that requires me to look deeper into the project structure, I never realized that there might be more than one In my case, the solution is this: I manually replaced line 69 in commandLineArgs.add("--tool-chain-path=" + android.ndkDirectory) with the line below: commandLineArgs.add("--tool-chain-path=" + "C:/Installed/UnityEditor/2022.2.0f1c1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK") where the path within the quotation marks is where my NDK is installed. |
Just ran into the same error while testing a build on Unity 2022.3.4. These newer Unity versions add a ndkPath variable to android {
+ ndkPath "C:/Program Files/Unity/Hub/Editor/..... This conflicts with the Simply removing ndk.dir from local.properties solved this error for me. |
<img width="1119" alt="image" src="https://github.com/flutter/flutter/assets/66480156/e2e8eed1-3bef-436c-b21f-3891bdbe05bb"> In most cases, a FFI plugin doesn't need its own specific Android NDK version. Just following the Flutter app project's NDK version is enough. If a Flutter app project depends on multiple FFI plugins that use different Android NDK versions, it can be quite wasteful and use excessive disk space due to multiple NDK installations. Using Flutter app project's NDK version is also less error-prone because upgrading the Flutter SDK would be enough when upgrading FFI plugins(If project's `ndkVersion` is `flutter.ndkVersion`), without messing with Android NDK installations. This problem was discussed in some actual FFI plugin repositories, and they are striving to find their own solutions: - superlistapp/super_native_extensions#143 (comment) - cunarist/rinf#60 (comment) - rive-app/rive-flutter#320 - juicycleff/flutter-unity-view-widget#832
<img width="1119" alt="image" src="https://github.com/flutter/flutter/assets/66480156/e2e8eed1-3bef-436c-b21f-3891bdbe05bb"> In most cases, a FFI plugin doesn't need its own specific Android NDK version. Just following the Flutter app project's NDK version is enough. If a Flutter app project depends on multiple FFI plugins that use different Android NDK versions, it can be quite wasteful and use excessive disk space due to multiple NDK installations. Using Flutter app project's NDK version is also less error-prone because upgrading the Flutter SDK would be enough when upgrading FFI plugins(If project's `ndkVersion` is `flutter.ndkVersion`), without messing with Android NDK installations. This problem was discussed in some actual FFI plugin repositories, and they are striving to find their own solutions: - superlistapp/super_native_extensions#143 (comment) - cunarist/rinf#60 (comment) - rive-app/rive-flutter#320 - juicycleff/flutter-unity-view-widget#832
<img width="1119" alt="image" src="https://github.com/flutter/flutter/assets/66480156/e2e8eed1-3bef-436c-b21f-3891bdbe05bb"> In most cases, a FFI plugin doesn't need its own specific Android NDK version. Just following the Flutter app project's NDK version is enough. If a Flutter app project depends on multiple FFI plugins that use different Android NDK versions, it can be quite wasteful and use excessive disk space due to multiple NDK installations. Using Flutter app project's NDK version is also less error-prone because upgrading the Flutter SDK would be enough when upgrading FFI plugins(If project's `ndkVersion` is `flutter.ndkVersion`), without messing with Android NDK installations. This problem was discussed in some actual FFI plugin repositories, and they are striving to find their own solutions: - superlistapp/super_native_extensions#143 (comment) - cunarist/rinf#60 (comment) - rive-app/rive-flutter#320 - juicycleff/flutter-unity-view-widget#832
Unity version: 2022.2.0f1c1 on Windows 11
android/local.properties
Where the above ndk path is what I directly copied from Unity's preference settings.
Despite having done this, after using
Flutter run
, I keep receiving the error below:This is kind of frustrating, since I have done exactly what the instructions from the README dictates. Is there anything I can do to solve this?
The text was updated successfully, but these errors were encountered: