首页 > 解决方案 > 构建时出错:没有源地图参考 + 删除哨兵科尔多瓦退出,退出代码为 1

问题描述

我正在尝试为 android 构建我的 ionic 应用程序,大多数用户在启动画面后都有一个白屏。我过去一周试图确定它可能会出现在哪里,但不知道......所以我试图摆脱我在构建时遇到的所有错误。(它仍然成功构建错误并在几乎一半的手机上工作)。

第一个在这里:

Building for Android...
[ERROR] An error occurred while running subprocess cordova.

        cordova.cmd plugin remove sentry-cordova exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.
> cordova.cmd plugin remove sentry-cordova Sentry: running before_plugin_rm - set SENTRY_SKIP_WIZARD=true to skip this angular.json build.json build_android.sh build-extras.gradle CertificateSigningRequest.certSigningRequest
...
 tslint.json www Uninstalling sentry-cordova from android Subproject Path: CordovaLib Subproject Path: app Uninstalling sentry-cordova from browser js-module uninstall called : plugins\sentry-cordova\dist\js\sentry-cordova.bundle.js Uninstalling sentry-cordova from ios Removing "sentry-cordova" Removing sentry-cordova from package.json doc.find is not a function

第二个是之后,有这样的多行:

- warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/1-es5.1922

我很确定我错过了一些信息。如有必要,请不要犹豫,但我确定我忘记做某事,但我现在有点绝望......

编辑:这是我用于构建的脚本的开头:

echo "Building for Android..."
#npm run android:build:prod
sentryRemove=$(ionic cordova plugin remove sentry-cordova)
echo $sentryRemove

sentryAdd=$(cordova plugin add sentry-cordova)

echo $sentryAdd

echo "successfully  added the sentry. \n Performing build now."

appBuildOut=$(ionic cordova build android --prod --release --source-map)

echo $appBuildOut

BUILD_MESSAGE='BUILD SUCCESSFUL'

谢谢你的帮助

标签: androidcordovabuildsentrysource-maps

解决方案


第一个问题是,如果我理解正确,您为什么在构建应用程序时运行插件删除​​命令。我会检查调用此命令的内容,因为before_plugin_rm 只有在删除插件时才应调用出错的脚本。

要使此脚本正常工作,请尝试使用环境变量运行SENTRY_SKIP_WIZARD=true并查看构建是否有效。我认为白屏的原因与 Sentry 无关,因为失败的步骤看起来与源地图上传有关。


推荐阅读