简体   繁体   English

一种在反应本机代码中包含android库的方法

[英]A way to include android libraries in react native code

I have built an Android library that works perfectly fine with Android Applications when used as an AAR in an Android Studio project. 我在Android Studio项目中用作AAR时构建了一个与Android应用程序完美配合的Android库。 Is it possible to use this same library in a React Native environment? 是否可以在React Native环境中使用相同的库? If not, will it take a lot of effort to make this library compatible with React Native? 如果没有,是否需要花费很多精力才能使这个库与React Native兼容?

You can use this library to create library for React Native react-native-create-library or 您可以使用此库为React Native react-native-create-libraryreact-native-create-library

the official way to integrate Native Modules which will be found in https://facebook.github.io/react-native/docs/native-modules-android 集成Native模块的官方方法,可在https://facebook.github.io/react-native/docs/native-modules-android中找到

我的回答是肯定的,有可能,react-native项目中的android文件夹实际上是一个android项目,你可以在这里集成一个AAR库,创建一个函数来调用它们,并在.js文件中调用这个函数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM