简体   繁体   English

React Native 构建失败 - javax.xml.bind.UnmarshalException:无法创建 com.android.DetailType.impl.impl 的实例。

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

I created a new project using: npx react-native init ShoppingList我创建了一个新项目: npx react-native init ShoppingList
I'm trying to run the project on my physical android device.我正在尝试在我的物理 android 设备上运行该项目。
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.提前致谢。

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.我怀疑是在更新 SDK 管理器中的存储库类型之后。 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 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.我必须杀死 java 进程才能删除 package.xml 文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM