rive-app / rive-flutter

Flutter runtime for Rive
https://rive.app
MIT License
1.2k stars 190 forks source link

Update NDK version to latest #336

Closed fabienbranchel closed 1 year ago

fabienbranchel commented 1 year ago

The NDK version is not up to date.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':rive_common'.
> com.android.builder.errors.EvalIssueException: [CXX1104] NDK from ndk.dir at /Users/branchel/Library/Android/sdk/ndk/25.2.9519653 had version [25.2.9519653] which disagrees with android.ndkVersion [25.1.8937393]

Please update it to latest : https://developer.android.com/ndk/downloads?hl=fr#lts-downloads

The last version running fine with this NDK version is 0.9.1, I can't understand why.

HayesGordon commented 1 year ago

Hi @fabienbranchel , v0.9.1 did not make use of any native build instructions. Since v.10.0 there has been a requirement to perform these extra build steps for low level bindings, see platform considerations

It's not entirely clear from the error message you gave what the issue is. But it may just be that you need to add "25.1.8937393" ndk version.

Open the Android folder in Android Studio, go to Preferences/Settings and make sure the correct version is installed:

CleanShot 2023-07-31 at 11 25 24@2x

If you're still running into issues it'll be helpful if you can create a demo repository that reproduces the issue you're encountering, then I can help to debug. Or you can provide the logs you get when running --verbose

fabienbranchel commented 1 year ago

Hi @HayesGordon, adding "25.1.8937393" ndk version as you suggest didn't work.

However, I init a new Flutter project to create a demo, and it make me realize that there is a value flutter.ndkVersion used in build.gradle file that I removed from my own project to use a hardcoded value some time ago, resolving an other issue.

I tried to use it again, and it was running with this warning in console :

One or more plugins require a higher Android NDK version.
        Fix this issue by adding the following to /Users/branchel/project/android/app/build.gradle:
        android {
          ndkVersion "25.1.8937393"
          ...
        }

So, from what I understand, the flutter.ndkVersion is lower than 25.1.8937393. Therefore, I don't bother to use this version and not the last one if Flutter latest version don't use it either.

Thank you for your response.

HayesGordon commented 1 year ago

Okay thanks for the feedback. Closing this issue for now