1

I'm having issues on pushing release via codepush.

Command 'codepush release-react -a [project] -d Development' failed with exception "No property named "getVersionNameFromNpm()" exists in the "android/gradle.properties" file."

On my android/app/build.gradle

def getVersionNameFromNpm() {
    //  Read and parse package.json file from project root
    def inputFile = new File("$rootDir/../package.json")
    def packageJson = new JsonSlurper().parseText(inputFile.text)

    // Return the version, you can get any value this way
    return packageJson["version"]
}

android {
   defaultConfig {
        ...
        versionName getVersionNameFromNpm()
    }
}

Thanks!

1 Answer 1

0

I added the version on the script using the $npm_package_version.

appcenter codepush release-react -a [Project] -d Development -t $npm_package_version
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.