android - 错误 : constructor ModuleRegistryAdapter in class ModuleRegistryAdapter cannot be applied to given types, 新 ModuleRegistryAdapter()

标签 android react-native expo

您好,我在控制台上收到了休闲错误:

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/

相关文章:

java - 升级Android项目以使用java 8并超出GC开销限制

react-native - 错误 : Unable to resolve module `react` from `index.js` : react could not be found within the project

android - 世博会不断停止安卓模拟器

ios - 如何修复“WKWebViewManager.evaluateJavaScript 不是函数”

javascript - React Native Elements ListItem.Accordion 项目导致 SectionList 滚动(远)超出预期

java - 更新库的 Gradle 同步项目

android - 如何使用 Facebook 3.0 SDK 处理 Android 应用程序中的 API 错误?

java - 电影海报未通过 TheMovieDB 显示

javascript - React native application release build install on Simulator 但不是设备

reactjs - onBlur 不适用于文本输入 react native