Skip to content
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

[NDK] [Build Failed] A problem occurred configuring project ':rive_common'. #320

Open
RoyalCoder88 opened this issue May 30, 2023 · 9 comments
Labels
bug Something isn't working triage

Comments

@RoyalCoder88
Copy link

I'm using rive 0.11.1, and I'm not able to build on Android, with the error:

[CXX1104] NDK from ndk.dir at C:\Program Files\Unity\Hub\Editor\2022.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK had version [23.1.7779620] which disagrees with android.ndkVersion [25.1.8937393]
[CXX1104] NDK from ndk.dir at C:\Program Files\Unity\Hub\Editor\2022.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK had version [23.1.7779620] which disagrees with android.ndkVersion [25.1.8937393]
[CXX1104] NDK from ndk.dir at C:\Program Files\Unity\Hub\Editor\2022.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK had version [23.1.7779620] which disagrees with android.ndkVersion [25.1.8937393]

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':rive_common'.
> [CXX1104] NDK from ndk.dir at C:\Program Files\Unity\Hub\Editor\2022.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK had version [23.1.7779620] which disagrees with android.ndkVersion [25.1.8937393]

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.

flutter --version

Flutter 3.10.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 9cd3d0d9ff (7 days ago) • 2023-05-23 20:57:28 -0700
Engine • revision 90fa3ae28f
Tools • Dart 3.0.2 • DevTools 2.23.1

flutter doctor -v

[√] Flutter (Channel stable, 3.10.2, on Microsoft Windows [Version 10.0.22621.1702], locale en-GB)
    • Flutter version 3.10.2 on channel stable at C:\tools\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9cd3d0d9ff (7 days ago), 2023-05-23 20:57:28 -0700
    • Engine revision 90fa3ae28f
    • Dart version 3.0.2
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at C:\Users\burac\AppData\Local\Android\sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.4.33213.308
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2021.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[√] VS Code (version 1.78.2)
    • VS Code at C:\Users\burac\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.64.0

[√] Connected device (4 available)
    • SM A908B (mobile) • RFCMA02W5WT • android-arm64  • Android 12 (API 31)
    • Windows (desktop) • windows     • windows-x64    • Microsoft Windows [Version 10.0.22621.1702]
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 113.0.5672.127
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 113.0.1774.42

[√] Network resources
    • All expected network resources are available.
@RoyalCoder88 RoyalCoder88 added the bug Something isn't working label May 30, 2023
@HayesGordon
Copy link
Contributor

Hi @RoyalCoder88, you'll need to update the NDK version in your Android app, see here: https://github.com/rive-app/rive-flutter/blob/master/platform_considerations.md#android

Please also make sure that CMake is up to date on your Windows system, see here: https://github.com/rive-app/rive-flutter/blob/master/platform_considerations.md#windows

@RoyalCoder88
Copy link
Author

Hi @HayesGordon , thanks for the quick reply, but I can't update the NDK because Unity widget depends on this specific NDK version :( thanks!

@ben55j
Copy link

ben55j commented Jun 29, 2023

Having the same issue.. : ( Still no solution ?

@user97116
Copy link

same issues still

@kcrebound
Copy link

Having same problem with integration with Unity

@RoyalCoder88 did you have temporarily solution?

auto-submit bot pushed a commit to flutter/flutter that referenced this issue Jul 31, 2023
<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
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this issue Jul 31, 2023
<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
vashworth pushed a commit to vashworth/flutter that referenced this issue Aug 2, 2023
<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
@Joseph-Nathan
Copy link

any news ?

@ShadrackOngera
Copy link

any news ?

nothing works for me still :(

@river2202
Copy link

river2202 commented Aug 21, 2023

I manage to find two workarounds:

  1. use a wrapper to wrap Android native SDK, here is the poc: https://pub.dev/packages/rive_mobile
    tested in our project and it does work. but don't have time (and my not worth it) to use federated plugin so iOS can still use flutter version. Otherwise, iOS native version will require iOS 14 or above (which still ok).
    this workaround does work but only support Android and iOS and will have to manually wrap function needed, not a scalable way. If anyone want to go further with the method, feel free to clone or submit PR to https://github.com/onlifeltd/rive_mobile.

  2. In our case it is conflict with Unity flutter NDK r23 requirement. Manage to update unityLibrary/build.gradle line 11 (ish) from

ndkVersion = rootProject.ext.ndkVersion

to

ndkVersion = 23.1.7779620

so unityLibrary project doesn't force main project to use NDK r23, and main project can use NDK 25.1.8937393 that rive ask for.

But come with http version conflict that already fix there but not released in latest nor prerelease (as in 21 Aug 2023). Have to walk around it with your own risk. We simply dependency_overrides http version to 1.11.0, full regression test still in pipeline to verify the impact for all these workarounds.

@jamesncl
Copy link

jamesncl commented May 22, 2024

In case this is useful to anyone else, an alternative workaround I'm using is to use an older version of rive (version 0.8.4 or earlier) which targets NDK 23.1.7779620. Unfortunately this older version depends on an old version of http which caused a dependency conflict in my project, so you may have to fork it to updated the dependencies. And of course you can't take advantage of any features added to rive after 0.8.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

9 participants