反应本机地理定位服务构建问题



问题:

我有一个反应本机应用程序,在那里我正在使用反应本机地理位置服务。安装 npm 后,我尝试使用 android 工作室在那里构建项目 它失败了,导致我出现这样的错误。

错误:找不到符号变量活动兼容

这是我的构建 Gradle 文件。

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.4.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}

我尝试了很多在互联网上找到解决这个问题的方法,但我无法做到这一点。那么有人可以帮助我解决这个问题吗?谢谢

react native 0.60+ 迁移到 Android X 因此,添加新库时需要将文件转换为AndroidX 为此使用喷射器

npm install --save-dev jetifier
npx jetify (may take a while)
npx react-native run-android 

最新更新