My app from the Play Store hangs after modifying compileSdkVersion - java

I have an app published in the Play store. I updated the compileSDKVersion and targetSDKVersion to 27. After the update was released, it did work for some but did not work for most users.
I tried to switch back and forth these compile and target and versions. However, on testing on the device it works but it does not work when I release it in the Play Store.
Which versions I have been using:
compileSDKVersion = 18, targetSDKVersion = 18 (Worked, it was like this originally)
compileSDKVersion = 27, targetSDKVersion = 27 (worked for some after updating but downloading it as a new app didn't work)
compileSDKVersion = 18, targetSDKVersion = 18 (Couldn't even release)
compileSDKVersion = 23, targetSDKVersion = 23 (Was able to release but still doesn't work, when I update the currently installed app, or when I install it as a new app)
Dependencies (In the current version):
compile 'com.android.support:appcompat-v7:23.0.+'
compile 'com.android.support:support-v4:23.0.0'
buildToolsVersion "24.0.2"
Looking for an advice to solve this issue, really stuck!
Thanks very much!

I'm guessing you haven't made the permissions changes necessary when targeting SDK >=23 (Android 6.0).
See the documentation at https://developer.android.com/training/permissions/requesting

Related

How Do I Change My minCompileSDK Version In Android Studio?

I just pulled up the android studio again and the current SDK version appears to have major bugs. While on SDK version 31 I get an error message saying SDK tools are corrupted and to uninstall then reinstall version 31.
When I switch to version 30 I get another error message stating that "the minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/Gradle/aarmetadata.properties) is greater than this module's compileSdkVersion", and I can't find any sources on google for altering minCompileSdk.
I just need to fix one of these problems, not both.
p.s. - I have already uninstalled and reinstalled APK 31 several times.
in your project, app -> build.gradle:
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "...."
minSdkVersion 16
targetSdkVersion 30
}
}
here the minSdkVersion is minCompileSdk.
You can change minSdk and targetSdk. And ensure minSdk and target < compileSDK
compileSdk 31
defaultConfig {
...
minSdk 25
targetSdk 31
...
}
"the minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/Gradle/aarmetadata.properties)
Im set compileSdk 31 to fixed that error. Show me your build.gradle
Thanks for the feedback! It looks like the solution was to change targetSDKversion and compileSDKVersion to 31 but keep buildToolsVersion at 30.0.3. I'm guessing any version between target and min will work.

How to change compile SDKversion of a project?

I was working on a project in late 2018 and left that as it is after that now i want to make changes in it and publish it to the playstore. The project had the v7 dependencies
&
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.andropc.wallpro"
minSdkVersion 15
targetSdkVersion 27
The app crashes after Android7.1 so how to run the app on above android versions what changes to make in the project or in dependencies to make it run in all versions.
First of all android support libraries had mean migrated to androidx!(https://developer.android.com/jetpack/androidx/releases/appcompat)
But you can still use old dependencies as well (I would recommend you to switch to androidx).
You need to change targetSdkVersion: 29 in build.gradle in order to support latest android version which is android 10.

Complie version higher than Build tool

Google have recently released API 27. I am planning to update my application with API 27. I have marked that there latest build tool is 26.0.2 and API is 27. If I use like below it can cause any issue in app ?
compileSdkVersion 27
buildToolsVersion "26.0.2"
and Application's minimum and maximum API is like below
minSdkVersion 16
targetSdkVersion 27
Thanks
1) Build tools version has nothing to do with compile SDK version.
Your current setup will work fine.
compileSdkVersion 27
buildToolsVersion "26.0.2"
2) You should use the newest build tools available.
If you had an old project you could say this:
compileSdkVersion 25
buildToolsVersion "27.0.0"
3) Build tools version is picked automatically in Android plugin 3.0.0.
You don't have to specify it. This is enough:
compileSdkVersion 27
You can use
android {
compileSdkVersion 27
buildToolsVersion '27.0.0'
defaultConfig {
targetSdkVersion 27
}
Read official guideline about Set Up the Android 8.1 SDK
If you are using last version of android-studio you can remove buildToolsVersion "26.0.2" from your gradle it's not mandatory.
The buildToolsVersion will work along-side with compileSdkVersion.
compileSdkVersion 27
buildToolsVersion "26.0.2"
Your config works. You should use lasted build tool.
From android studio 3.0, buildToolsVersion is ignored. It automatically pick the build tool version for you.

Can not resolve symbol R and build.gradle error

I began to program with android and so I downloaded Android Studio 2.1.3 and android SDK and jdk 1.8.0_60 the Gradle version is 2.14.1.
I want to program with Android 2.2.
In my class called GameView is the problem:
bmp = BitmapFactory.decodeResource(getResources(),
R.mipmap.ic_launcher);
it can not resolve symbol R
I read that I can solve the problem in these ways:
BUILD -> Clean Project
Tools -> Android -> Sync Project with Gradle Files
File -> Invalidate Caches / Restart
Nothing helped so I tried to changed the Versions in build.gradle(Module: app).
I do not really know wich Versions I need to program for Android 2.2.
Please help me or do you know any other solution to fix that problem?
Thanks!!!
In my case the solution was to put the minSdkVersion from 8 to 9.
I also changed the versions in build.gradle:
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.panjutorials.lazypudding"
minSdkVersion 9
targetSdkVersion 24
versionCode 1
versionName "1.0"
The only disadvantage is that I program with Android Nougat now but that's okay.
Good luck for everybody who has a similar problem.

severe errors in android studio due to something going wrong inside build.gradle

in android studio im getting a lot of errors because i think something must have happened in the build.gradle. I may have accidentally deleted the dependices method (or whatever it is) inside the build.gradle now everytime i try to run a gradle project sync this happens (below)
I have tried the invalidate caches/restart but that has not worked.
Here is my what my gradle settings look like. (below).
All my other projects in android studio seem to be working fine. Can someone please help me here.
You misplaced the defaultConfig block. Should be like:
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
minSdkVersion 11
targetSdkVersion 21
versionCode 1
versionName "1.0"
applicationId "com.example.app"
}
buildTypes {
...
}
...
}

Categories