Reputation: 71
I am new to React-Native, I have an objective of creating React-Native based components that can be used in other Android native Apps . However, we would to export this react native component as an Android library (.aar) and then distribute to other consumers.
I have seen this question has been asked couple of times in SOF, however do not see a clear answer, hence Im posting again.
Upvotes: 7
Views: 2672
Reputation: 161
In the following project, their goal was to add react-native dependencies to a vanilla Android app:
https://github.com/glung/react-native-as-an-android-lib
They note some drawbacks that the user of the Android library will face:
React-native requires the application to implement the ReactApplication interface to run. This means that the app needs to add a dependency to 'com.facebook.react:react-native`.
Final APK size will be bigger. There is not much we can do about that since about 6M comes from react-native ndk libraries (compiled for arm64-v8a, armeabi, armeabi-v7a x86 , x86_64).
Upvotes: 5