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

Add supports for RN 0.71 #305

Merged
merged 5 commits into from
Mar 3, 2023
Merged

Conversation

focux
Copy link
Contributor

@focux focux commented Jan 11, 2023

Starting from version 0.71, react native is not shipping the android folder (read more).

This library depends on the android folder to build correctly, so this PR adds support for 0.71 and above and it's not backward compatible with older versions. ⚠️ This is a breaking change.

DISCLAIMER: These changes were extracted from react-native-mmkv library, all credits to them.

@vercel
Copy link

vercel bot commented Jan 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
rnmmkv ❌ Failed (Inspect) Jan 18, 2023 at 3:50PM (UTC)

android/build.gradle Outdated Show resolved Hide resolved
android/build.gradle Outdated Show resolved Hide resolved
android/build.gradle Outdated Show resolved Hide resolved
@robrechtme
Copy link

Even with the changes of @JerakRus I'm still getting build errors:

Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
   > 2 files found with path 'lib/arm64-v8a/libjsi.so' from inputs:
      - /Users/robrechtme/code/my-app/node_modules/react-native-mmkv-storage/android/build/intermediates/library_jni/debug/jni/arm64-v8a/libjsi.so
      - /Users/robrechtme/.gradle/caches/transforms-3/9f48c0d87a8aa7490b90e5b452e6d297/transformed/jetified-react-android-0.71.0-debug/jni/arm64-v8a/libjsi.so
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

@focux
Copy link
Contributor Author

focux commented Jan 18, 2023

Fixed all the build issues and upgraded the example project to v0.71 as well to be sure that is working well on Android and iOS.

@JamesC159
Copy link

Fixed all the build issues and upgraded the example project to v0.71 as well to be sure that is working well on Android and iOS.

confirmed the build works now. App did not crash either

@ammarahm-ed
Copy link
Owner

ammarahm-ed commented Jan 19, 2023

Although this PR is great, the problem is that it won't work for older versions of this library after upgrading. It still has to be backward compatible some how because most projects are on older versions of react-native & we are still supporting both.

So we need to find a way to still keep it backward compatible.

Copy link
Contributor

@mmmoussa mmmoussa left a comment

Choose a reason for hiding this comment

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

This PR has duplicated mrousavy/react-native-mmkv#480 and mrousavy/react-native-mmkv#499 without mentioning that and has carried over a few changes that are not relevant to this library. I've flagged two but there may be others that I missed given my unfamiliarity with the build process.

android/build.gradle Show resolved Hide resolved
android/build.gradle Outdated Show resolved Hide resolved
@ammarahm-ed ammarahm-ed merged commit 729a85f into ammarahm-ed:master Mar 3, 2023
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.

6 participants