您好,我在控制台上收到了休眠错误:
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 bug,有什么解决方案吗?这是相同的错误:https://www.gitmemory.com/issue/unimodules/react-native-unimodules/58/530738183
发布于 2020-06-03 02:12:55
如果您使用react-native-unimodules,请检查您的package.json中是否也有"@unimodules/react-native-adapter“。如果是这样,请尝试删除它并重新构建。这对我很管用。
发布于 2020-06-24 21:35:47
在我的例子中,移除"expo-react-native-adapter“是可行的。
https://stackoverflow.com/questions/61705299
复制相似问题