React Native Build Failed – javax.xml.bind.UnmarshalException: Unable to create an instance of com.android.repository.impl.generated.v1.TypeDetails

huangapple go评论77阅读模式
英文:

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:

React Native Build Failed – javax.xml.bind.UnmarshalException: Unable to create an instance of com.android.repository.impl.generated.v1.TypeDetails

These are the dependency's versions and variable paths:

React Native Build Failed – javax.xml.bind.UnmarshalException: Unable to create an instance of com.android.repository.impl.generated.v1.TypeDetails

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.

huangapple
  • 本文由 发表于 2020年7月27日 20:57:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/63115826.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定