bugsnag/bugsnag-js

no versionCode when splitting Abis on Android in react-native

efstathiosntonas opened this issue · 2 comments

Hi, when Android is splitting Abis in a react-native project I get this error on my CI:

build.gradle:

    splits {
        abi {
            reset()
            enable true
            universalApk false
            include(* reactNativeArchitectures())
        }
    }

applicationVariants.all {
        variant ->
            variant.outputs.each {
                output ->
                    // For each separate APK per architecture, set a unique version code as described here:
                    // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
                    def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
                    def abi = output.getFilter(OutputFile.ABI)
                    if (abi != null) { // null for the universal-debug, universal-release variants
                        output.versionCodeOverride =
                                defaultConfig.versionCode * 1048576 + versionCodes.get(abi)
                    }
            }
    }
> Bugsnag: Your AndroidManifest.xml is missing one or more of
[10:30:46]: ▸ apiKey/versionCode/buildUuid/versionName/package, which are required to upload to bugsnag.
[10:30:46]: ▸ apiKey=XXXXXX
[10:30:46]: ▸ versionCode=null
[10:30:46]: ▸ buildUUID=XXXXX
[10:30:46]: ▸ versionName=2.1.17
[10:30:46]: ▸ applicationId=com.XXXX
[10:30:46]: ▸ Manifest file = /Users/XXXXX/actions-runner/_work/XXXXX/XXXXX/android/app/build/intermediates/merged_manifest/staging/processBugsnagArmeabi-v7a-stagingManifest/AndroidManifest.xml

"react-native": "0.74.1"
"@bugsnag/react-native": "7.23.0"

If I set enable false in abi split it uploads just fine.

Hi @efstathiosntonas

Thanks for reaching out.

The Bugsnag.versionCode variable is automatically pulled from the versionCode field in your App Manifest file. Can you please confirm that this field has been set at runtime and confirming that this is not equal to a null value?

Hi @efstathiosntonas

As this thread has not seen any activity for some time I am going to close this issue out.
If you would like to continue this investigation please reach out and we can reopen this issue.