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

hard code ndk version and pub upgrade #1573

Merged
merged 2 commits into from
Oct 12, 2024

Conversation

gwbischof
Copy link
Contributor

@gwbischof gwbischof commented Oct 4, 2024

I just updated my flutter to the latest stable version. With the latest stable version, flutter.ndkVersion is 23.x.
This creates a bunch of warnings when launching thunder on android because a bunch of dependancies require ndkVersion 25.1.8937393 or greater. So I think the right way to handle this is to write the ndk version in the build.gradle file and not get it from flutter.

Also, I haven't been able to build the app for android after switching to flutter stable. flutter pub upgrade fixed it.

@gwbischof gwbischof changed the title hard code ndk version hard code ndk version and pub upgrade Oct 5, 2024
@gwbischof gwbischof force-pushed the ndkversion branch 2 times, most recently from 0c82ef1 to 05ee931 Compare October 6, 2024 17:40
Copy link
Member

@micahmo micahmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, although I'm a bit concerned about hard-coding the NDK version. How will we remember to keep it updated?

@hjiangsu
Copy link
Member

hjiangsu commented Oct 7, 2024

Are you able to confirm whether or not upgrading the packages fixes the build issue? Or does it require both the NDK version change and package upgrades?

If so, I'd lean more towards reverting the NDK version changes. I believe the NDK warnings are simply warnings, and they don't actually affect the final build!

@gwbischof
Copy link
Contributor Author

It works without updating the ndk version. It just creates warnings.

But I think the it may affect performance of the built app?
https://upstackhq.com/blog/software-development/how-to-use-android-ndk

A bunch of the dependancies require version 25.x:

Your project is configured with Android NDK 23.1.7779620, but the following plugin(s) depend on a different Android NDK version:
- android_intent_plus requires Android NDK 25.1.8937393
- background_fetch requires Android NDK 25.1.8937393
- connectivity_plus requires Android NDK 25.1.8937393
- device_info_plus requires Android NDK 25.1.8937393
- dynamic_color requires Android NDK 25.1.8937393
- flutter_custom_tabs_android requires Android NDK 25.1.8937393
- flutter_displaymode requires Android NDK 25.1.8937393
- flutter_file_dialog requires Android NDK 25.1.8937393
- flutter_icmp_ping requires Android NDK 25.1.8937393
- flutter_inappwebview_android requires Android NDK 25.1.8937393
- flutter_keyboard_visibility requires Android NDK 25.1.8937393
- flutter_local_notifications requires Android NDK 25.1.8937393
- flutter_native_splash requires Android NDK 25.1.8937393
- flutter_plugin_android_lifecycle requires Android NDK 25.1.8937393
- flutter_sharing_intent requires Android NDK 25.1.8937393
- gal requires Android NDK 25.1.8937393
- image_picker_android requires Android NDK 25.1.8937393
- package_info_plus requires Android NDK 25.1.8937393
- path_provider_android requires Android NDK 25.1.8937393
- permission_handler_android requires Android NDK 25.1.8937393
- share_plus requires Android NDK 25.1.8937393
- shared_preferences_android requires Android NDK 25.1.8937393
- sqflite requires Android NDK 25.1.8937393
- sqlite3_flutter_libs requires Android NDK 25.1.8937393
- uni_links requires Android NDK 25.1.8937393
- unifiedpush_android requires Android NDK 25.1.8937393
- url_launcher_android requires Android NDK 25.1.8937393
- video_player_android requires Android NDK 25.1.8937393
- webview_flutter_android requires Android NDK 25.1.8937393
Fix this issue by using the highest Android NDK version (they are backward compatible).

These dependancies might not get compiled if we don't meet the NDK version requirement, instead they will get run in an interpreter, making the performance worse. I don't really know, that's just my understanding after doing a few minutes of googling.

The warnings will remind us when we have to update the NDK version in the build.gradle file.

If we put the NDK version in build.gradle then thunder can pick which NDK version to use. If we don't then it will be up to someones flutter installation to pick the version.

I just updated to flutter stable and it looks like the NDK version is 23.x, which isn't new enough for the dependancies.

@gwbischof
Copy link
Contributor Author

I'm good with whatever, just let me know what you want to do, and ill update the PR.

@hjiangsu
Copy link
Member

Thanks for the reply - in this case, I think it might be okay if we hard-code the NDK version then (assuming that there will be warnings that show up if we require a higher NDK version).

@hjiangsu hjiangsu merged commit 335604b into thunder-app:develop Oct 12, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants