英文:
React Native Build Failed - javax.xml.bind.UnmarshalException: Unable to create an instance of com.android.repository.impl.generated.v1.TypeDetails
问题
我使用以下命令创建了一个新项目:npx react-native init ShoppingList
我尝试在我的实体安卓设备上运行这个项目。
但是,当我运行项目时,我收到了这个错误:
(图片链接已省略)
以下是依赖版本和变量路径:
(图片链接已省略)
我在谷歌上搜索了这个错误,但没有找到任何相关内容。请帮忙看看。先行谢过。
英文:
I created a new project using: npx react-native init ShoppingList
I'm trying to run the project on my physical android device.
But, When I run the project I get this error:
These are the dependency's versions and variable paths:
I googled this error but couldn't find anything. Please help.
Thanks in Advance.
答案1
得分: 3
同样的事情发生在我身上,但我没有找出是什么原因导致了这个问题。我怀疑是在更新SDK管理器中的存储库类型之后发生的。
对我来说,解决方案是从Android SDK版本文件夹(在我的情况下是“C:\Program Files (x86)\Android\android-sdk\platforms\android-28”)中删除package.xml文件。当运行项目时,该文件会被重新创建,一切都能正常工作。我不得不终止Java进程才能删除package.xml文件。
英文:
The same thing happened to me, but I didn't find out what caused the problem. I suspect it was after updating the repository type in the SDK Manager.
The solution for me was to delete package.xml file from the android SDK version folder ("C:\Program Files (x86)\Android\android-sdk\platforms\android-28" in my case). The file was recreated when running the project and everything worked as it should. I had to kill the java process to be able to delete the package.xml file.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论