当我尝试使用以下命令构建反应本机应用程序时,我不断收到错误消息npx expo run:android
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
> A problem occurred configuring project ':react-native-webview'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
> Namespace not specified. Please specify a namespace in the module's build.gradle file like so:
android {
namespace 'com.example.namespace'
}
Run Code Online (Sandbox Code Playgroud)
然而,在android/app/build.gradle
...
android {
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion
namespace 'com.wilburcoding.BirdSoundSearch'
...
Run Code Online (Sandbox Code Playgroud)
网上似乎没有任何答案对这个问题有有效/有效的答案。看来这个问题可能源自react-native-webview. 这是依赖问题还是 gradle 问题?