juicycleff / flutter-unity-view-widget

Embeddable unity game engine view for Flutter. Advance demo here https://github.com/juicycleff/flutter-unity-arkit-demo
BSD 3-Clause "New" or "Revised" License
2.13k stars 518 forks source link

NDK from ndk.dir {directory} had version [21.3.6528147] which disagrees with android.ndkVersion [25.1.8937393] #849

Closed abdo400 closed 1 year ago

abdo400 commented 1 year ago

Describe the bug I had the plugin working with my system before. However, after upgrading flutter to 3.10.6, I had to upgrade gradle 7.3.0. However, trying to run the project now I get this error

[CXX1104] NDK from ndk.dir at E:\Unity Versions\2022.1.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK had version [21.3.6528147] which disagrees with android.ndkVersion [25.1.8937393]
[CXX1104] NDK from ndk.dir at E:\Unity Versions\2022.1.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK had version [21.3.6528147] which disagrees with android.ndkVersion [25.1.8937393]
[CXX1104] NDK from ndk.dir at E:\Unity Versions\2022.1.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK had version [21.3.6528147] which disagrees with android.ndkVersion [25.1.8937393]

All my ndk versions are the same everywhere (this is why it used to work before) app/build.gradle: ndkVersion '21.3.6528147' local.properties: E:\\Unity Versions\\2022.1.1f1\\Editor\\Data\\PlaybackEngines\\AndroidPlayer\\NDK

Unity (please complete the following information):

Smartphone (please complete the following information):

RoyalCoder88 commented 1 year ago

Hi @abdo400 , try to use your system NDK from Android Studio, like this:

ndk.dir=C:\\Users\\YOURNAME\\AppData\\Local\\Android\\Sdk\\ndk\\25.1.8937393

timbotimbo commented 1 year ago

I've seen this before, but those were only warnings, not errors.

In my case removing or commenting the ndkVersion in app/build.gradle gets rid of the warnings.

abdo400 commented 1 year ago

Hey, sorry for the late reply. Turns out this is because of the rive package. The new version of it needs ndk version 25.1.8937393 but I am using ndk version 21.3.6528147 for Unity and the app. I fixed this by downgrading the rive version (not the best solution but works for now). I tried both solutions above but it didn't work.

theraply-vr commented 1 month ago

What should I do if I do not want to downgrade half of my packages? Unity is stubborn in their approach for latest JDK's, SDK's and NDK's so. in flutter I have ndk's 26.1 and in unity 21.3...