Skip to content Skip to sidebar Skip to footer

Pass Local.properties In Build.gradle Android Through Git Hub Secret

I am trying to automate build process of android app, I have stored baseUrl in local.properties file, and passing file content through Github secret, but Github action is keep fail

Solution 1:

I solved my problem, I was passing wrongly argument from Github secret, it should be like

\"http://fakeapi.com"\

and also i was doing wrong in action file, instead of ./gradlew build it should be

./gradlew assembleDebug --stacktrace

then only it will invoke below part from build.gradle and replace the BaseUrl with new value from local.properties

debug {
            buildConfigField 'String', "BASEURL", baseUrl
            resValue 'string', "base_url", baseUrl
        }

I also used https://github.com/juliangruber/read-file-action to see the content of the local.properties and verified everything is fine in this file or not.

Post a Comment for "Pass Local.properties In Build.gradle Android Through Git Hub Secret"