I have an android app with instant feature. I want to set versionCode 1 for instant app and versionCode 1000 for installable app.
I have 3 build.gradle for base, installed and instant feature.
base app
defaultConfig {
applicationId "com.mypackage"
minSdkVersion 16
targetSdkVersion 29
versionCode = 1
versionName = '1.0.0'
}
installed app
defaultConfig {
applicationId "com.mypackage"
minSdkVersion 16
targetSdkVersion 29
versionCode = 1000
versionName = '1.0.0'
}
instant app
defaultConfig {
applicationId "com.mypackage"
minSdkVersion 16
targetSdkVersion 29
versionCode = 1
versionName = '1.0.0'
}
When building android app bundle, I am getting versionCode 1 for both instant & installable version. versionCode is always picked from base variant build.gradle.
How can I set versionCode 1000 for installable version?
I am trying to achieve this as per android documents.
Restart the version codes for the Google Play Instant experience at 1.
Increase the version code of the installable APK by a large number, such as 1000, to ensure that there is enough space for your instant experience's version number to increase.
Related
I uploaded an android application. And one of the clients had the latest version of Android, and could not install it. I updated the SDK to version 33, will flutter automatically change my targetSdkVersion?
In the application level build.gradle you can set targetSdkVersion
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.test.appname"
minSdkVersion 21
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
Flutter is building apk on android API level 29 by default I want to upgrade it to 30 how can I? I am new to flutter I don't know, I tried to google it but it wasn't helpful
Open a Flutter project in Android Studio and you have to edit the build.gradle file. In a flutter project, it is found at the path ./android/app/build.gradle
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.projectname"
minSdkVersion 19
targetSdkVersion 28 // Set this to 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Inspiration from this answer and modified accordingly
Getting this error while building android app bundle -
Cannot find PROCESSED_RES output for Main{type=MAIN, fullName=debug,
filters=[], versionCode=-1, versionName=null}
I have just added a dynamic feature module in existing android studio project, Getting this error while building android app bundle
change versionName and versionCode increment with every release
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.company.app"
minSdkVersion 16
targetSdkVersion 28
versionCode 14 // increment with every release
versionName '1.4.8' // change with every release
}
}
My build.gradle default config:
android {
compileSdkVersion 27
defaultConfig {
applicationId "my.app"
minSdkVersion 19
targetSdkVersion 27
multiDexEnabled true
versionCode 1
versionName "1"
vectorDrawables.useSupportLibrary = true
}
...
}
But for a Samsung Galaxy J1 using Android version 6.0.1 it says that the device is not compatible.
Question: What can be a reason?
Note:
The project uses mixed Kotlin and Java code. What more data should I share to help find an answer?
Gradle2 4.2
My app/build.gradle:
android {
compileSdkVersion 26
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.myproject"
minSdkVersion 16
targetSdkVersion 23
versionCode 25
versionName "1.2.25"
}
}
My steps for deploy apk to Fabric (Beta by CrashLytics)
Manually increment versionCode and verionName. In this example: versionCode 26 and versionName "1.2.26"
Create distributive (apk) and deploy to CrashLytics by command:
gradlew assembleDebug crashlyticsUploadDistributionDebug
And as result my apk success deploy to Fabric with versionName = "1.2.26"
OK. It's work fine.
But I need to automatically increment versionCode and versionName BEFORE deploy to Fabric.
To do this I need to write custom Gradle task. Does my approach correct?