When I am trying to make a new Google Maps Activity, its grey and I cant click the option. (New --> Google --> Google Maps Activity (Requires MinSdk >=9)
I got the same message when I create a new app and try to choose the activity while setting up a new project.
C:\Users\Joey\AppData\Local\Android\sdk\platforms
Android-23
And when opening the SDK manager in Android Studio I got the following SDK tools.
Can someone tell me if Im missing something?
In your application level build.gradle file do you have minSdkVersion 9 or greater than 9 like this:
defaultConfig {
minSdkVersion 15 //this should be greater than or equal to 9
targetSdkVersion 23
//...
}
Related
I followed this page: https://developer.android.com/about/versions/13/setup-sdk
to set up Android 13 SDK.
In my build.gradle:
android {
compileSdkVersion("Tiramisu")
defaultConfig {
targetSdkVersion("Tiramisu")
}
}
Then I got the error:
> Unsupported value: Tiramisu. Format must be one of:
- android-31
- android-31-ext2
- android-T
- vendorName:addonName:31
I tried to use "33" instead of "Tiramisu", but it's not working.
I'm using the latest Android Studio Preview as the instruction.
Is there anyone trying to use Android 13 SDK?
This answer is no longer valid because you can use API version 33 now for Tiramisu as it's officially released
Credit to #NickolaySavchenko - Posting this answer since I've been waiting for him for a day.
Finally, after taking advice from #NickolaySavchenko - I have a final working code like this.
compileSdkVersion "android-Tiramisu"
targetSdkVersion "Tiramisu"
Yes, you see it correctly, the targetSdkVersion is Tiramisu, not android-Tiramisu so that it can run in an emulator API Tiramisu device.
I tested and can confirm that minSdkVersion doesn't need to change to android-Tiramisu or Tiramisu. I'm still keeping it as 19 and it's working great.
As #NickolaySavchenko said
compileSdkPreview "android-Tiramisu"
targetSdkPreview "android-Tiramisu"
working fine
and to run it on android 13 you also need to change your minSdk to "android-Tiramisu"
I have released my App to Google Play store and it shows fine. But for this App in Additional info I do not see "Requires Android" version.
I have following version restriction defined in build.gradle and users with their Android version below 5 / sdk 28 are not able to install which is right but not sure why it is not showing up in additional info?
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 28
compileSdkVersion = 30
targetSdkVersion = 30
androidXCore = "1.5.0"
}
Here is the "Requires Android info not showing for my App. This is sample image from Google Play Store
Appreciate any help / pointers to fix this.
Thank you.
-Reds
This question already has answers here:
Android: Get TargetSDKVersion in runtime
(5 answers)
Closed 2 years ago.
I am trying to determine the Build SDK level from within my app. I tried
Log.i( "MYAPP", "SDK="+Build.VERSION.SDK_INT );
I previously had been building for level 28, but recently upgraded to level 30.
My module's current build.gradle file included:
android {
compileSdkVersion 30 // was 28
defaultConfig {
applicationId "com.ramrod.MyApp"
minSdkVersion 23
targetSdkVersion 30 // was 28
more ...
Strangely, logcat still shows level 28.
I've re-synced, did a clean and rebuilt the app but no change.
What's going on
?
As you can see in the documentation here, SDK_INT returns the OS version of the device in which the app is running, and not the targetSdkVersion you're looking for.
public static final int SDK_INT
The SDK version of the software
currently running on this hardware device.
This value never changes
while a device is booted, but it may increase when the hardware
manufacturer provides an OTA update.
To get the targetSdkVersion you need to use ApplicationInfo.targetSdkVersion class:
packageManager.getApplicationInfo(youPackage, 0).targetSdkVersion;
I was trying to implement the MultiImagePicker from Yazeed44 (https://github.com/yazeed44/MultiImagePicker).
The problem I have is, when I open the image selector:
new Picker.Builder(getActivity(), new MyPickListener(), R.style.MIP_theme)
.build()
.startActivity();
The view remains empty where it should be displaying the photo albums to select from. See the screenshot:
What am I missing in order to get this to work?
I'm testing with a Google Nexus 6P with Android 6.0.1. minSdkVersion 19, targetSdkVersion 23. And I'm Gradle importing: net.yazeed44.imagepicker:imagepicker:1.3.0
Try to set targetSdkVersion to 22, the problem occurs because in android 6 you need to request for permissions at run-time. If you have configured targetSdkVersion to 23 in your project, your app needs to support Runtime Permission, but if you doesn't have your code prepared to manage this, you neeed to change targetSdkVersion to 22, in this way you are going to get de old permission behavior.
"Warning: Right now when you create a new project in Android Studio.
targetSdkVersion will be automatically set to the latest version, 23.
If you are not ready to make your application fully support the
Runtime Permission, I suggest you to step down the targetSdkVersion to
22 first."
https://inthecheesefactory.com/blog/things-you-need-to-know-about-android-m-permission-developer-edition/en
I know this might be a easy question to some people, but i been googling this for this entire afternoon and try to find out how to set up the build.gradle file in my Android project.
I am updating some APIs and making them ready to Android M. Now everything is fine now. However, i got confused about the minSdkversion,targetSdkversion,complieSdkVersion.
My current setup is
android {
compileSdkVersion 'android-MNC' //this was 21
buildToolsVersion "22.0.1"
defaultConfig {
...
minSdkVersion 11
targetSdkVersion 'MNC' //this was 21
...
}
...
}
As you can see from the comments, my app was complied and target API21 before and now i change it to MNC in order to cover the whole range from api11to MNC.
This is my test cases,
Device with Android M(API22)---OK
Device with Android 5.1.1 (API22)---error and FAILED_OLDER_SDK
If i change my setup to
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
...
minSdkVersion 11
targetSdkVersion 21
...
}
Test cases,
Device with Android M(API22)---OK
Device with Android 5.1.1(API22)---OK
Device with Android 4.3.1(API18)---OK //Why is this OK?
if device with API18 can run the project complied against 21, then why the Android 5.1.1(API22) couldn't run the project complied against MNC?
Right now, since Android M is still in developer preview, any app that targets MNC will only run in emulators or devices with the MNC developer preview.