I have to build an apps, it support until android 9 with the gradle setting look like
compileSdkVersion 25
buildToolsVersion "26.0.0"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.sdept.company.starmobile"
minSdkVersion 19
targetSdkVersion 26
versionCode 6
versionName "1.6"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.google.code.gson:gson:2.4'
// implementation 'com.google.firebase:firebase-core:16.0.1'
compile 'org.apache.httpcomponents:httpcore:4.2.4'
compile 'org.apache.httpcomponents:httpmime:4.3'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.google.zxing:core:3.2.1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
compile 'com.google.firebase:firebase-messaging:11.0.4'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
with above setting it running well when app-debug version, but when I try to upload in Google Play, google play required me to change min targetSDKVersion to 28. so I change it to this
compileSdkVersion 25
buildToolsVersion "26.0.0"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.sdept.company.starmobile"
minSdkVersion 19
targetSdkVersion 28
versionCode 6
versionName "1.6"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.google.code.gson:gson:2.4'
// implementation 'com.google.firebase:firebase-core:16.0.1'
compile 'org.apache.httpcomponents:httpcore:4.2.4'
compile 'org.apache.httpcomponents:httpmime:4.3'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.google.zxing:core:3.2.1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
compile 'com.google.firebase:firebase-messaging:11.0.4'
testCompile 'junit:junit:4.12'
// compile 'com.squareup.retrofit2:retrofit:2.1.0'
// JSON Parsing
// compile 'com.google.code.gson:gson:2.6.1'
// compile 'com.squareup.retrofit2:converter-gson:2.1.0'
// compile 'com.google.android.gms:play-services-appindexing:11.0.4'
}
apply plugin: 'com.google.gms.google-services'
it successfull when uppload on playstore but the application cannot running on android 9, where is the part of code i have to change so that can running well in Android 9 (Pie)