I want to upgrade my release gradle script to make android bundle instead android apk package, but I can't find the command to create bundle programmatically from gradle script instead apk.
This is what I have to convert. What is the particular command that create the apk? And what is the specified command to use to create bundle? I can't find.
// copy apk file
variant.outputs.each { output ->
if (output.outputFile != null) {
println "outputFile name ${output.outputFile.name}"
variant.assemble.doLast {
copy {
from output.outputFile
into destination
rename { String fileName ->
"app-${variant.productFlavors[0].name}-${buildType.name}-${versName}.apk"
}
}
}
}
}
}
}
I thought that was the
You can use the command:
./gradlew bundle
or in general ./gradlew bundle<VariantName>
.
The bundle can be found at: project-name/app/build/outputs/bundle/
More info in the official doc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With