我是React Native的初学者,因此创建我使用expo的项目。 创建项目并使用导航和一些js页面后,我想在android模拟器上编译我的项目。
所以我安装了本机反应:
npm install -g react-native-cli
并根据其official site配置其他依赖项,例如Python2, a JDK, and Android Studio
。
要进行测试,我使用npx react-native init AwesomeProject
命令创建了一个新项目,然后使用npx react-native run-android
命令在模拟器上对其进行了编译。最终测试应用程序将在模拟器上运行。
现在,我想将我从expo弹出的主应用程序编译为 expo nude 。
expo eject
弹出后,我运行npx react-native run-android。这是完整的输出:
\AuditMngm> npx react-native run-android
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-gesture-handler (to unlink run: "react-native unlink react-native-gesture-handler")
- react-native-reanimated (to unlink run: "react-native unlink react-native-reanimated")
- react-native-screens (to unlink run: "react-native unlink react-native-screens")This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1766 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...
> Configure project :app
Installing unimodules:
unimodules-core@5.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\@unimodules\core
unimodules-react-native-adapter@5.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\@unimodules\react-native-adapter
expo-app-loader-provider@8.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\expo-app-loader-provider
expo-constants@8.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\expo-constants
expo-error-recovery@1.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\expo-error-recovery
expo-file-system@8.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\expo-file-system
expo-font@8.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\expo-font
expo-keep-awake@8.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\expo-keep-awake
expo-linear-gradient@8.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\expo-linear-gradient
expo-location@8.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\expo-location
expo-permissions@8.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\expo-permissions
expo-sqlite@8.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\expo-sqlite
expo-web-browser@8.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\expo-web-browser
unimodules-barcode-scanner-interface@5.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\unimodules-barcode-scanner-interface
unimodules-camera-interface@5.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\unimodules-camera-interface
unimodules-constants-interface@5.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\unimodules-constants-interface
unimodules-face-detector-interface@5.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\unimodules-face-detector-interface
unimodules-file-system-interface@5.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\unimodules-file-system-interface
unimodules-font-interface@5.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\unimodules-font-interface
unimodules-image-loader-interface@5.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\unimodules-image-loader-interface
unimodules-permissions-interface@5.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\unimodules-permissions-interface
unimodules-sensors-interface@5.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\unimodules-sensors-interface
unimodules-task-manager-interface@5.0.0 from F:\SafaProject\ReactNative\AuditMngm\node_modules\unimodules-task-manager-interface
The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build.
This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
Please add the Kotlin plugin to the common parent project or the root project, then
remove the versions in the subprojects.
If the parent project does not need the plugin, add 'apply false' to the plugin line.
See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl
The Kotlin plugin was loaded in the following projects: ':expo-error-recovery', ':expo-permissions'
> Task :app:installDebug
04:13:39 V/ddms: execute: running am get-config
04:13:39 V/ddms: execute 'am get-config' on 'emulator-5554' : EOF hit. Read: -1
04:13:39 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'Pixel_2_XL_API_27(AVD) - 8.1.0' for app:debug
04:13:39 D/app-debug.apk: Uploading app-debug.apk onto device 'emulator-5554'
04:13:39 D/Device: Uploading file onto device 'emulator-5554'
04:13:39 D/ddms: Reading file permision of F:\SafaProject\ReactNative\AuditMngm\android\app\build\outputs\apk\debug\app-debug.apk as: rwx------
04:13:39 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
04:13:42 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
04:13:42 V/ddms: execute: returning
04:13:42 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
04:13:42 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
04:13:42 V/ddms: execute: returning
Installed on 1 device.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 19s
471 actionable tasks: 1 executed, 470 up-to-date
info Connecting to the development server...
info Starting the app on "emulator-5554"...
Starting: Intent { cmp=com.auditproject/.MainActivity }
但是我在模拟器上遇到错误:
要测试每个配置是否正常,我创建ExpoBare
项目并运行它。一切正常,测试项目已完全编译并在android仿真器上启动,但我的项目遇到了以上错误。
您的建议是什么?
更新
我也在liteLinux上像上面一样运行我的项目,但是不幸的是我遇到了同样的错误。