React native React本机链接失败,未找到包

React native React本机链接失败,未找到包,react-native,react-native-cli,React Native,React Native Cli,我不确定到底发生了什么,但我无法在没有错误发生的情况下运行react native link CLI输出: react-native link --verbose debug Available platforms: iOS, Android debug Targeted platforms: iOS, Android debug Getting project config for iOS... debug Getting project config for Android... error

我不确定到底发生了什么,但我无法在没有错误发生的情况下运行react native link

CLI输出:

react-native link --verbose
debug Available platforms: iOS, Android
debug Targeted platforms: iOS, Android
debug Getting project config for iOS...
debug Getting project config for Android...
error No package found. Are you sure this is a React Native project?
error Unexpected close tag
Line: 22
Column: 24
Char: >
debug Error: Unexpected close tag
Line: 22
Column: 24
Char: >
    at error (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:666:10)
    at strictFail (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:692:7)
    at closeTag (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:885:9)
    at SAXParser.write (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:1447:13)
    at new XmlDocument (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/lib/xmldoc.js:199:15)
    at readManifest (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/@react-native-community/cli/build/tools/android/readManifest.js:44:10)
    at Object.projectConfig (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/@react-native-community/cli/build/tools/android/index.js:66:46)
    at Object.keys.forEach.platform (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/@react-native-community/cli/build/commands/link/getProjectConfig.js:25:62)
    at Array.forEach (<anonymous>)
    at getProjectConfig (/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/@react-native-community/cli/build/commands/link/getProjectConfig.js:22:35)
react本机链接--详细
调试可用平台:iOS、Android
调试目标平台:iOS、Android
调试正在获取iOS的项目配置。。。
调试获取Android的项目配置。。。
错误:找不到包。你确定这是一个React本地项目吗?
错误:意外的关闭标记
电话号码:22
栏目:24
字符:>
调试错误:意外的关闭标记
电话号码:22
栏目:24
字符:>
出现错误(/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:666:10)
在strictFail(/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:692:7)
在closeTag(/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:885:9)
在SAXParser.write(/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/node_modules/sax/lib/sax.js:1447:13)
在新的XmlDocument(/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/xmldoc/lib/xmldoc.js:199:15)
在readManifest(/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/@react native community/cli/build/tools/android/readManifest.js:44:10)
在Object.projectConfig(/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/@react native community/cli/build/tools/android/index.js:66:46)
位于Object.keys.forEach.platform(/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/@react native community/cli/build/commands/link/getProjectConfig.js:25:62)
在Array.forEach()处
在getProjectConfig(/Users/Dellybro/Desktop/App/AppReactNativeApp/node_modules/@react native community/cli/build/commands/link/getProjectConfig.js:22:35)
这是在尝试npm安装react native firebase后随机发生的

我尝试过的

  • 清除缓存
  • 卸下节点_模块并安装npm
  • 将代码签出回上一次提交
  • 将我的包名添加到/android/app/src/debug/AndroidManifest.xml中的清单中
  • 从我的计算机上删除应用程序并从github克隆它
  • 在另一个项目上运行react-native链接是可行的,但我无法在这个特定项目上运行react-native链接

  • 所以我的问题的答案是,在我的android清单xml文件中,我的一个意图过滤器的右括号不正确


    因此,对于任何人来说,发生这种情况都是为了确保您的所有Android文件都有正确的语法。

    我也有类似的问题,但我没有发现清单文件有任何问题。您能提到您遇到问题的那一行吗?因为我可能没有注意到语法问题我在AndroidManifest.xml文件中有一个输入错误。问题解决