How to include AAR in React Native Android build?

前端 未结 3 696
南方客
南方客 2020-12-19 06:27

I\'m trying to include an AAR file with my React Native Android app so that I can access its features using native code. How can I bundle an AAR so that native code can impo

3条回答
  •  被撕碎了的回忆
    2020-12-19 07:24

    Copy the library.aar file into react-native-module-name/android/libs. Create the libs folder if it doesn't exists.

    In react-native-module-name/android/build.gradle:

    dependencies {
      implementation fileTree(dir: "libs", include: ["*.aar"])
      implementation 'com.facebook.react:react-native:+'  // From node_modules
    }
    

提交回复
热议问题