我在运行应用程序时安装了react-native-location-enabler并抛出错误。
任务:react-native-android-location-enabler:compileDebugJavaWithJavac FAILED D:\ carrental \ node_modules \ react-native-android-location-enabler \ android \ src \ main \ java \ com \ heanoria \ library \ reactnative \ locationenabler \ RNAndroidLocationEnablerModule.java:15:错误:找不到符号 导入com.google.android.gms.common.api.ApiException; ^ 符号:类ApiException 位置:包com.google.android.gms.common.api D:\ carrental \ node_modules \ react-native-android-location-enabler \ android \ src \ main \ java \ com \ heanoria \ library \ reactnative \ locationenabler \ RNAndroidLocationEnablerModule.java:16:错误:找不到符号 导入com.google.android.gms.common.api.ResolvableApiException; ^ 符号:类ResolvableApiException 位置:包com.google.android.gms.common.api D:\ carrental \ node_modules \ react-native-android-location-enabler \ android \ src \ main \ java \ com \ heanoria \ library \ reactnative \ locationenabler \ RNAndroidLocationEnablerModule.java:63:错误:无法访问ReflectedParcelable LocationRequest locationRequest = LocationRequest.create(); ^ 找不到com.google.android.gms.common.internal.ReflectedParcelable的类文件 D:\ carrental \ node_modules \ react-native-android-location-enabler \ android \ src \ main \ java \ com \ heanoria \ library \ reactnative \ locationenabler \ RNAndroidLocationEnablerModule.java:64:错误:无法访问AbstractSafeParcelable locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); ^ 找不到com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable的类文件 D:\ carrental \ node_modules \ react-native-android-location-enabler \ android \ src \ main \ java \ com \ heanoria \ library \ reactnative \ locationenabler \ RNAndroidLocationEnablerModule.java:99:错误:找不到符号 task.getResult(ApiException.class); ^ 符号:类ApiException 位置:类RNAndroidLocationEnablerModule D:\ carrental \ node_modules \ react-native-android-location-enabler \ android \ src \ main \ java \ com \ heanoria \ library \ reactnative \ locationenabler \ RNAndroidLocationEnablerModule.java:102:错误:找不到符号 } catch(ApiException异常){ ^ 符号:类ApiException 位置:类RNAndroidLocationEnablerModule D:\ carrental \ node_modules \ react-native-android-location-enabler \ android \ src \ main \ java \ com \ heanoria \ library \ reactnative \ locationenabler \ RNAndroidLocationEnablerModule.java:104:错误:无法访问CommonStatusCodes 案例LocationSettingsStatusCodes.RESOLUTION_REQUIRED: ^ 找不到com.google.android.gms.common.api.CommonStatusCodes的类文件 D:\ carrental \ node_modules \ react-native-android-location-enabler \ android \ src \ main \ java \ com \ heanoria \ library \ reactnative \ locationenabler \ RNAndroidLocationEnablerModule.java:106:错误:找不到符号 ResolvableApiException resolvable =(ResolvableApiException)异常; ^ 符号:类ResolvableApiException 位置:类RNAndroidLocationEnablerModule D:\ carrental \ node_modules \ react-native-android-location-enabler \ android \ src \ main \ java \ com \ heanoria \ library \ reactnative \ locationenabler \ RNAndroidLocationEnablerModule.java:106:错误:找不到符号 ResolvableApiException resolvable =(ResolvableApiException)异常; ^ 符号:类ResolvableApiException 位置:类RNAndroidLocationEnablerModule
我尝试过 cd android && gradlew清洁 而且不起作用。 “ react-native”:“ ^ 0.58.5” “ react-native-android-location-enabler”:“ ^ 1.1.0” 我该怎么做才能解决它。