【发布时间】:2019-11-20 15:59:15
【问题描述】:
我目前正在将 React Native 与 React Navigation 和 React Native Maps 一起使用。在我从 Expo 更改为 React Native(以使用 Native 代码)后,在安装 React Native Maps & React Navigation 的依赖项后,我一直收到此错误。这是我得到的错误。
warn The following packages to use the deprecated "rpm" config that will stop working from next release:
- react-native-maps: https://npmjs.com/package/react-native-maps 请通知他们的维护人员。您可以在https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide 找到更多详细信息。 info JS 服务器已经在运行。 info 正在安装应用程序...
FAILURE:构建失败并出现异常。
在哪里: 脚本“/Users/blainefurman/Documents/sample2/project/node_modules/@react-native-community/cli-platform-android/native_modules.gradle”行:195
-
出了什么问题: 评估设置“项目”时出现问题。
无法确定当前字符,它不是字符串、数字、数组或对象
当前读取的字符是 'T',int 值为 84 无法确定当前字符,它不是字符串、数字、数组或对象 行号 1 索引号 0 TypeError:无法在发射时读取 SAXParser.parser_text [as ontext] (/Users/blainefurman/Documents/sample2/project/node_modules/xmldoc/lib/xmldoc.js:235:39) 处未定义的属性“_text”(/Users/ blainefurman/Documents/sample2/project/node_modules/xmldoc/node_modules/sax/lib/sax.js:639:35)在closeText(/Users/blainefurman/Documents/sample2/project/node_modules/xmldoc/node_modules/sax/lib/ sax.js:649:26) 在 emitNode (/Users/blainefurman/Documents/sample2/project/node_modules/xmldoc/node_modules/sax/lib/sax.js:643:26) 在 openTag (/Users/blainefurman/Documents/ sample2/project/node_modules/xmldoc/node_modules/sax/lib/sax.js:839:5) 在 SAXParser.write (/Users/blainefurman/Documents/sample2/project/node_modules/xmldoc/node_modules/sax/lib/sax. js:1289:15) 在新 XmlDocument (/Users/blainefurman/Documents/sample2/project/node_modules/xmldoc/lib/xmldoc.js:199:15) 在 readManifest (/Users/blainefurman/Documents/sample2/project/node_modules /@react-native-community/cli 平台m-android/build/config/readManifest.js:44:10) 在 Object.projectConfig (/Users/blainefurman/Documents/sample2/project/node_modules/@react-native-community/cli-platform-android/build/config /index.js:60:46) 在 Object.get 项目 [作为项目] (/Users/blainefurman/Documents/sample2/project/node_modules/@react-native-community/cli/build/tools/config/index.js :129:61) ^
尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
通过https://help.gradle.org获得更多帮助
1 秒内构建失败
错误 无法安装应用程序。确保您已设置 Android 开发环境:https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment。使用 --verbose 标志运行 CLI 以获取更多详细信息。 错误:命令失败:./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE:构建失败并出现异常。
在哪里: 脚本“/Users/blainefurman/Documents/sample2/project/node_modules/@react-native-community/cli-platform-android/native_modules.gradle”行:195
-
出了什么问题: 评估设置“项目”时出现问题。
无法确定当前字符,它不是字符串、数字、数组或对象
当前读取的字符是 'T',int 值为 84 无法确定当前字符,它不是字符串、数字、数组或对象 行号 1 索引号 0 TypeError:无法在发射时读取 SAXParser.parser_text [as ontext] (/Users/blainefurman/Documents/sample2/project/node_modules/xmldoc/lib/xmldoc.js:235:39) 处未定义的属性“_text”(/Users/ blainefurman/Documents/sample2/project/node_modules/xmldoc/node_modules/sax/lib/sax.js:639:35)在closeText(/Users/blainefurman/Documents/sample2/project/node_modules/xmldoc/node_modules/sax/lib/ sax.js:649:26) 在 emitNode (/Users/blainefurman/Documents/sample2/project/node_modules/xmldoc/node_modules/sax/lib/sax.js:643:26) 在 openTag (/Users/blainefurman/Documents/ sample2/project/node_modules/xmldoc/node_modules/sax/lib/sax.js:839:5) 在 SAXParser.write (/Users/blainefurman/Documents/sample2/project/node_modules/xmldoc/node_modules/sax/lib/sax. js:1289:15) 在新 XmlDocument (/Users/blainefurman/Documents/sample2/project/node_modules/xmldoc/lib/xmldoc.js:199:15) 在 readManifest (/Users/blainefurman/Documents/sample2/project/node_modules /@react-native-community/cli 平台m-android/build/config/readManifest.js:44:10) 在 Object.projectConfig (/Users/blainefurman/Documents/sample2/project/node_modules/@react-native-community/cli-platform-android/build/config /index.js:60:46) 在 Object.get 项目 [作为项目] (/Users/blainefurman/Documents/sample2/project/node_modules/@react-native-community/cli/build/tools/config/index.js :129:61) ^
尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
通过https://help.gradle.org获得更多帮助
1 秒内构建失败
at checkExecSyncError (child_process.js:629:11)
at execFileSync (child_process.js:647:13)
at runOnAllDevices (/Users/blainefurman/Documents/sample2/project/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:75:39)
at buildAndRun (/Users/blainefurman/Documents/sample2/project/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:137:41)
at then.result (/Users/blainefurman/Documents/sample2/project/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:103:12)
at process._tickCallback (internal/process/next_tick.js:68:7)
我试图查看这是一个链接错误(但不是),据我所知,我的所有依赖项都已正确设置。
此时我会接受任何建议,因为我完全被难住了。
另外,很抱歉造成混乱,第一次堆栈溢出(图片链接如下)。
【问题讨论】:
标签: android reactjs react-native