您好,我在控制台上收到了休闲错误:
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/Users/user/Desktop/.../android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:82: error: constructor ModuleRegistryAdapter in class ModuleRegistryAdapter cannot be applied to given types;
new ModuleRegistryAdapter(),
^
required: ReactModuleRegistryProvider
found: no arguments
reason: actual and formal argument lists differ in length
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
在安卓工作室:
/Users/username/.../project_name/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:82: error: constructor ModuleRegistryAdapter in class ModuleRegistryAdapter cannot be applied to given types;
new ModuleRegistryAdapter(),
^
required: ReactModuleRegistryProvider
found: no arguments
reason: actual and formal argument lists differ in length
“ react 原生”:“〜0.61.5”,
"react-native-unimodules": "^0.9.1",
似乎最近在 android 上出现了 react-native-unimodules 错误,有什么解决方案吗?
这是相同的错误:
https://www.gitmemory.com/issue/unimodules/react-native-unimodules/58/530738183
最佳答案
如果您使用 react-native-unimodules,请检查您的 package.json 中是否还有“@unimodules/react-native-adapter”。如果是这样,请尝试将其删除并重建。它对我有用。
关于android - 错误 : constructor ModuleRegistryAdapter in class ModuleRegistryAdapter cannot be applied to given types, 新 ModuleRegistryAdapter(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61705299/