web-dev-qa-db-ja.com

エラー:クラスModuleRegistryAdapterのコンストラクタModuleRegistryAdapterを指定された型に適用できません。新しいModuleRegistryAdapter()

こんにちは私はコンソールで休閑エラーを取得します:

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.

Android studio:

/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-native": "〜0.61.5"、 "react-native-unimodules": "^ 0.9.1"、

最近のAndroidのreact-native-unimodulesバグのようですが、解決策はありますか?これは同じエラーです: https://www.gitmemory.com/issue/unimodules/react-native-unimodules/58/53073818

6

React-native-unimodulesを使用する場合は、package.jsonに "@ unimodules/react-native-adapter"もあるかどうかを確認してください。その場合は、削除して再構築してください。それは私のために働いた。

1
Oswaldo

私の場合、「expo-react-native-adapter」を削除して機能しました

0
Bruno Sousa