我正在使用React-Native创建应用程序,并在Android设备上对其进行测试。添加react-native-camera模块后,发生以下错误:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':react-native-camera:compileDebugJavaWithJavac'. 在“构建->运行任务”(Android Studio)中。
关于Java编译器,大约有20-30错误,所有这些都显示以下内容:error: package android.support.annotation does not exist,error: package android.support.v4.util does not exist,error: package android.support.media does not exist,等,或error: cannot find symbol class SparseArrayCompat,error: package Pools does not exist,error: cannot find symbol variable ExifInterface,这在错误文件检查时有做import android.support.v4.util.ArrayMap;-import样的语句。
我的android / build.gradle文件:
buildscript {
ext {
minSdkVersion = 26
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = 28
}
repositories {
google() …Run Code Online (Sandbox Code Playgroud) android gradle android-gradle-plugin react-native react-native-android