This message was deleted.
# community-support
s
This message was deleted.
c
script is setting a property multiple times, likely one of those is during task execution which is not allowed.
a
thank you for replying. How do i know which value? this code was working fine until i upgrade react native version.
c
perhaps track it through the full stack trace to where it’s being set
please add that as a file, not separate messages, very hard to follow.
a
Also am using this script to build and publish the release
Copy code
"android-release": " yes | sdkmanager --licenses && cd android/ && ./gradlew publishRelease --stacktrace",
    "android-bundle": "react-native bundle --platform android --dev false --entry-file ./index.js --bundle-output ./android/app/src/main/assets/index.bundle --sourcemap-output ./android/app/src/main/assets/index.map --assets-dest ./android/app/src/main/res/",
    "android-pre-release": "npm run android-clean && npm run android-bundle",
c
The below show what property is being set and who is setting it at execution time:
Copy code
>>> property being set: at com.android.build.gradle.[MASKED].api.ApkVariantOutputImpl.setVersionCodeOverride(ApkVariantOutputImpl.java:96)
	at com.android.build.gradle.[MASKED].api.ApkVariantOutputImpl_Decorated.setVersionCodeOverride(Unknown Source)
>>> calling code that is setting it: at com.github.triplet.gradle.play.tasks.ProcessArtifactMetadata.process(ProcessArtifactMetadata.kt:33)
a
yes thank you for finding it. I already suspected that and couldnt find a solution for it till now.
Copy code
applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // <https://developer.android.com/studio/build/configure-apk-splits.html>
            // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
            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 =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }

        }
    }
Any ideas?
c
not following the specifics but would try and avoid calling .get() on properties during the configuration phase. This may mean using property.map { your logic here } to create a derived provider that is then used.
you’ll need to review where that whole code snippet is called from, as
output.versionCodeOverride =
is the culprit, may need to call this code sooner.
a
that part of code was working normally until recently. It is mentioned here in the react native template https://github.com/facebook/react-native/blob/main/template/android/app/build.gradle#L246-L257
if found something else, my gradle config still works with react native 0.63.4 but with 0.67.4 is failing. still looking for a solution, any ideas?
@Chris Lee thank you for helping, unfortunately i still didnt find any solutions yet. can you help me debug this again ?
v
How about a simple google search / GitHub search for the problem?
a
i wish it was that simple. found that also, but the issue is mentioned as fixed. also tried upgrading to 7.4 and downgrading to 6.9 and still same issue. Am i missing something
v
What version of that plugin are you using?
a
Copy code
dependencies {
        classpath("com.android.tools.build:gradle:4.2.0")
        // classpath "com.android.tools.build:gradle:3.5.0"
        classpath "com.github.triplet.gradle:play-publisher:2.4.1"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
v
What's your question then? You are using 2.4.1, but the error is fixed for 3.0.0
a
ok let me explain, i retried again with v3.0.0 until v3.4 with agp 4.1, 4.2 and followed the releases published for play-publisher, and got other type of errors like
Copy code
Failed to notify project evaluation listener.
   > java.lang.StackOverflowError (no error message)
would be great if we can check it together
v
Maybe better check together with the developer of that plugin? I'm not even an Android developer and also never heard of that plugin. I just found it from your stacktrace and a quick search.