我正在尝试为React Native构建一个liblinphone的 Package 器(react-native-liblinphone)。我将从Android实现开始,并使用linphone提供的SDK的.aar文件。
React Native模块自己成功构建,但当它链接到RN应用程序(使用react native link
)时,应用程序构建无法找到SDK(Failed to resolve: :liblinphone-sdk:
)。
从react-native-liblinphone build.gradle:
repositories {
mavenCentral()
flatDir { dirs 'libs' }
}
dependencies {
compile 'com.facebook.react:react-native:+'
compile(name: 'liblinphone-sdk', ext: 'aar')
}
字符串
从应用程序设置.gradle:
include ':react-native-liblinphone'
project(':react-native-liblinphone').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-liblinphone/android')
include ':react-native-contacts'
project(':react-native-contacts').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-contacts/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':app'
型
从app build.gradle:
dependencies {
compile project(':react-native-liblinphone')
compile project(':react-native-contacts')
compile project(':react-native-vector-icons')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
型
1条答案
按热度按时间bkkx9g8r1#
无需更改应用的gradle或设置。gradle,只需对原生模块的gradle进行以下更改:
字符串
希望能帮上忙!