use*_*363 3 react-native react-native-android
这是在 RN0.62.2和 Nodejs上的新安装12.18.0。在yarn添加react-native-keychain后,npx react-native run-android的app启动失败,报错:
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:\D\code\js\xyz_app\node_modules\react-native-keychain\android\src\main\java\com\oblador\keychain\DeviceAvailability.java:30: error: cannot find symbol
return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE);
^
symbol: variable FEATURE_FACE
location: class PackageManager
C:\D\code\js\xyz_app\node_modules\react-native-keychain\android\src\main\java\com\oblador\keychain\DeviceAvailability.java:34: error: cannot find symbol
return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_IRIS);
^
symbol: variable FEATURE_IRIS
location: class PackageManager
2 errors
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-keychain:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Run Code Online (Sandbox Code Playgroud)
安装尝试了几次,错误都是一样的。该模块之前曾在其他应用中使用过,该错误可能与模块最近更新有关。操作系统是win10。react-native-keychain 是 6.1.1。这是 package.json:
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/native": "^5.5.1",
"@react-navigation/stack": "^5.5.1",
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-device-info": "^5.6.1",
"react-native-elements": "^2.0.2",
"react-native-gesture-handler": "^1.6.1",
"react-native-keychain": "^6.1.1",
"react-native-reanimated": "^1.9.0",
"react-native-safe-area-context": "^3.0.5",
"react-native-screens": "^2.8.0",
"react-native-vector-icons": "^6.6.0"
Run Code Online (Sandbox Code Playgroud)
use*_*363 14
在 build.gradle 中将 SDK 版本从 28 提高到 29 似乎有效。这是更改后的文件:
buildToolsVersion = "29.0.3"
minSdkVersion = 16
compileSdkVersion = 29
targetSdkVersion = 29
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1922 次 |
| 最近记录: |