Errors when building : no source map reference + remove sentry-cordova exited with exit code 1

I'm trying to build my ionic app for android and most users have a white screen after the splashscreen. I've past the past week to try to determine where it could come but got no idea... So I'm trying to get rid of all the errors I have when building. (it still succed to build with the errors and worked on almost half phones).

First one is here :

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

Second one is after, there is multiples lines like this :

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

I'm pretty sure I miss some informations. Don't hesitate to ask if necessary but I'm sure I forget to do something, but i'm kinda desperate now...

EDIT : Here is the begining of the script I'm using for build :

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'

Thanks for your help

1 answer

  • answered 2021-05-04 08:48 jennmueng

    The first question is why are you running a plugin remove command when building your app, if I understand correctly. I would check what is calling this command because the script that is erroring before_plugin_rm should only be called when the plugin is being removed.

    To get this script to just work, try running with the environment variable SENTRY_SKIP_WIZARD=true and see if the build works. I don't think the reason for the white screen is related to Sentry as the step that is failing looks to be related to source map uploading.