Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature-request] change the default target sdk to (API Level 30) #1006

Closed
mosabab opened this issue Jun 25, 2020 · 29 comments
Closed

[feature-request] change the default target sdk to (API Level 30) #1006

mosabab opened this issue Jun 25, 2020 · 29 comments
Milestone

Comments

@mosabab
Copy link
Contributor

mosabab commented Jun 25, 2020

Feature Request

Motivation Behind Feature

The latest version of Android Studio allow you to set the latest API level available which is API LEVEL 30.

Feature Description

It is good idea to increase the default target sdk to 30.

Alternatives or Workarounds

@mosabab mosabab changed the title Increased default target sdk to (API Level 30) [feature-request] change the default target sdk to (API Level 30) Jun 25, 2020
@breautek breautek modified the milestone: 9.0.0 Jun 25, 2020
@breautek
Copy link
Contributor

breautek commented Jun 25, 2020

This is considered a breaking change so it won't be in the cordova-android@9 release (which is currently in the voting process).

If you want to target SDK 30 in your app however, you can do so by using the android-targetSdkVersion preference for the time being.

@breautek breautek added this to the 10.0.0 milestone Jun 25, 2020
@jcesarmobile
Copy link
Member

SDK 30 is not even released yet, is at beta stage. Won’t be released until some point of Q3

@mosabab
Copy link
Contributor Author

mosabab commented Jun 29, 2020

I am not sure if it still in beta or not, because I can see it added recently to the latest version of Android Studio as API LEVEL 30 (Android 10+ R)

@mosabab
Copy link
Contributor Author

mosabab commented Jun 29, 2020

If you install a new clean version of Android Studio, you will see that Android 10+ (R) API LEVEL 30 is the default version, I don't think it is beta release.

Please check this image for details: (New clean installed version of Android Studio v.4 ):
Untitled-1

@breautek
Copy link
Contributor

It's misleading, it's still a beta release. You can view their release timeline here: https://developer.android.com/preview/overview

The expected final release is sometime in Q3.

@mosabab
Copy link
Contributor Author

mosabab commented Jun 29, 2020

It's misleading, it's still a beta release. You can view their release timeline here: https://developer.android.com/preview/overview

The expected final release is sometime in Q3.

Thanks for clarification

@barkermn01
Copy link

barkermn01 commented Jul 2, 2020

@breautek you shared a link to the android 11 version "Android 11 Developer Preview" (the title on the page).

SDK 30 is not exclusively for Android 11 but also for Android 10.0, I would assume this is because of the changes Google are making to the Bluetooth API because of COVID19 track & trace app problems. so it appears they have rushed out SDK 30 to work with Android 10.0+ and if they need more or exclusive to 11 SDK features, it will come out as 31. as the image above shows, it is for Android 10.0+ also as the AVD Manager shows it.

image

@mosabab
Copy link
Contributor Author

mosabab commented Jul 2, 2020

@breautek you shared a link to the android 11 version "Android 11 Developer Preview" (the title on the page).

SDK 30 is not exclusively for Android 11 but also for Android 10.0, I would assume this is because of the changes Google are making to the Bluetooth API because of COVID19 track & trace app problems. so it appears they have rushed out SDK 30 to work with Android 10.0+ and if they need more or exclusive to 11 SDK features, it will come out as 31. as the image above shows, it is for Android 10.0+ also as the AVD Manager shows it.

image

That what i mentioned before
API level 30 is not only for android 11, it is also for new version of android 10+ R

We can see it in Androod Studio SDK manager

@timbru31
Copy link
Member

timbru31 commented Jul 2, 2020

Nevertheless a default target SDK bump needs to happen in a major version (i.e., cordova-android@10) and given that we've just release v9 this is not likely to happen any time soon and rather around the general release of Android 11.
Like Norman said, you can already use the android-targetSdkVersion pref.

But yes, we are aware of this new SDK version and Android 11 being in development.

@barkermn01
Copy link

barkermn01 commented Jul 2, 2020

@mosabab yeah, I agree with you and think the claim below is wrong

It's misleading, it's still a beta release. You can view their release timeline here: https://developer.android.com/preview/overview

I was just pointing out, that SDK 30 is not a Beta, and what's more likely Google accidentally released something that was beta and changed it to 10.0+ to mislead people, or it was a deliberate action by Google for a reason and I speculated on what that reason could be.

@timbru31 are versions, not branches? would it not be possible to fork/branch from v9 and create a v10 alpha with just the SDK support update in?

@breautek
Copy link
Contributor

breautek commented Jul 2, 2020

It's not misleading at all, it's clearly described in the timeline. Just saying the Android Studio UI is misleading. The API is in a "final preview" state. It's still a beta release. Things can still change from now and the final release targeting Q3 then (although should not be breaking). Changes at this current time will be mainly for incompatibility fixes.

You see the update in Android Studio because as of Beta 1 (Which was June), apps can now be published targeting API 30, but the API is still in a beta state. Beta 3 (August) will be release candidate, and an undisclosed date (sometime in Q3) for the final release of SDKs as well as the Android 11 platform. Cordova doesn't support beta packages.

would it not be possible to fork/branch from v9 and create a v10 alpha with just the SDK support update in?

I personally don't see the need for that unless if there are many changes required to support API 30, which may or may not be the case. I'd personally just start off by using the android-targetSdkVersion. If it works then 👍 otherwise, feel free to report bugs, I'll add them to the cordova-android@10 milestone.

@NitzDKoder
Copy link

any update on this? I use cordova and have below issue when target==30.
https://bugs.chromium.org/p/chromium/issues/detail?id=1101250

@dpogue
Copy link
Member

dpogue commented Oct 15, 2020

any update on this? I use cordova and have below issue when target==30.
https://bugs.chromium.org/p/chromium/issues/detail?id=1101250

Ooof, that sounds bad. If Google is actually going to require using WebViewAssetsLoader then we have no choice but to move Cordova to AndroidX, which will break a tonne of plugins 😞

@jcesarmobile
Copy link
Member

jcesarmobile commented Oct 16, 2020

as an alternative you can use cordova-plugin-ionic-webview, as it uses http/https to serve the content it's not affected by this problem, but it requires to convert the file:// urls to http/https urls with window.Ionic.WebView.convertFileSrc()

Anyway, next cordova major should move to AndroidX, some plugins will break, but a lot of other plugins are holding back because they don't want to update to use AndroidX until it's the default on Cordova and that makes the plugin use out of date support libraries. Or some plugin authors are maintaining two versions of the same plugin, one for AndroidX and another for the old support libraries.

@jbfrequence
Copy link

jbfrequence commented Oct 23, 2020

Hi all,

Any updates on this issue ?

"If you want to target SDK 30 in your app however, you can do so by using the android-targetSdkVersion preference for the time being." It does not work if I changed the config.xml or even any build-extras.gradle

    <platform name="android">
        <preference name="android-targetSdkVersion" value="30" />

or/and (build-extras.gradle)

android {

	compileSdkVersion 30

	defaultConfig {
	targetSdkVersion 30

When adding platform android@9.0.0, the following is still displayed

Adding android project... Creating Cordova project for the Android platform: Path: platforms\android Package: com.jby.frequence Name: FREQUENCE Activity: MainActivity Android target: android-29

Thanks

@NitzDKoder
Copy link

@breautek any plans to update target to 30? Please confirm.. We have blocker when target 30 is made..

https://bugs.chromium.org/p/chromium/issues/detail?id=1101250

@ath0mas
Copy link
Contributor

ath0mas commented Dec 3, 2020

(to track it here)
Google recently blogged about future Google Play requiring targetSdk update to 30 to be August and November 2021:
https://android-developers.googleblog.com/2020/11/new-android-app-bundle-and-target-api.html

@wearcheck
Copy link

I have a brand new Pixel 4a 5G and I can't install my API level 29 cordova app. Not compatible. When will we be able to target API 30?

@Fever905
Copy link

Fever905 commented Dec 11, 2020

I have a brand new Pixel 4a 5G and I can't install my API level 29 cordova app. Not compatible. When will we be able to target API 30?

You can still target 30 - I use these preferences:

	preference name="android-minSdkVersion" value="19" 
	preference name="android-maxSdkVersion" value="30" 
	preference name="android-targetSdkVersion" value="30"

My app works on Android 11 and shows the targer SDK as 30 (see pic)
image

@breautek
Copy link
Contributor

breautek commented Dec 11, 2020

FYI: By specifying android-maxSdkVersion you're intentionally making your app unavailable to newer releases (e.g. whenever SDK 31 devices comes out) unless you make an update with the bumped max sdk. Maybe this is what you want, but if you want to make your app available automatically you can omit the android-maxSdkVersion preference. Google does not recommend specifying the max SDK version for this reason.

@Fever905
Copy link

@breautek Thanks for the tip! :) 👍

@lunedam-git
Copy link

I have a strange problem around targeting SDK 30. I'm using cordov-android@9 and setting the Adndroid SDK via preferences:

preference name="android-minSdkVersion" value="24" 
preference name="android-targetSdkVersion" value="30"

The app builds, is successfully signed and zip aligned. However the APK will not install on any Android 11 device I have (Galaxy S10 with developer mode and emulator). I've tried sideloading and also using adb install. When sideloading there's no useful feedback, just "App not installed", but using adb it reports that the APK isn't signed. Despite the fact that it most certainly is.

If I drop the targetSdkVersion back down to 29 then all is sweetness and light again.

@gjsalot
Copy link

gjsalot commented Feb 17, 2021

@lunedam-git you are likely signing with the signature scheme v1, as of api 30 you must sign with signature scheme v2

@lunedam-git
Copy link

@gjsalot Thankyou!

@mobilemarines
Copy link

The preference
<preference name="android-targetSdkVersion" value="30" />
in the config.xml has no effect because
node_modules\cordova-android\bin\templates\project\build.gradle
sets
defaultCompileSdkVersion=29 //Integer - We ALWAYS compile with the latest by default
which will always overwrite your config.xml setting.
The overwrite is done in
node_modules\cordova-android\bin\templates\project\app\build.gradle

// Set property defaults after extension .gradle files.
ext.cdvCompileSdkVersion = cdvCompileSdkVersion == null ? (
    defaultCompileSdkVersion == null
        ? privateHelpers.getProjectTarget()
        : defaultCompileSdkVersion
) : Integer.parseInt('' + cdvCompileSdkVersion);

As workaround you can modify your build-extra.gradle as follows:

allprojects {
    // Overwrite Cordova fixed target SDK 29
    project.ext {
      defaultTargetSdkVersion=30
      defaultCompileSdkVersion=30
    }
}

When building your project there is still displayed Android target: android-29 (which is not true).
But when analyzing the APKs AndroidManifest.xml in Android Studio (Build/Analyze APK) you can see that
platformBuildVersionCode="30" now.

@EinfachHans
Copy link
Contributor

See this Android Blog:

From August 2021, the Google Play Console will require all new apps to:

Publish with the Android App Bundle format.
Utilize Play Asset Delivery or Play Feature Delivery to deliver assets or features that exceed download size of 150MB. Expansion files (OBBs) will no longer be supported for new apps.
Target API level 30 (Android 11) or above and adjust for behavioral changes.
Requirements for updates to existing apps

From November 2021, updates to existing apps will be required to target API level 30 or above and adjust for behavioral changes in Android 11. Existing apps that are not receiving updates are unaffected and can continue to be downloaded from the Play Store.

@erisu
Copy link
Member

erisu commented Apr 13, 2021

Merged to master: #1182

@erisu erisu closed this as completed Apr 13, 2021
@infacto
Copy link

infacto commented Apr 16, 2021

Since Google is enforcing API 30, we should publish a corresponding Cordova version as soon as possible.

Starting August 2021, new apps will be required to target API level 30 (Android 11) and use the Android App Bundle publishing format. Starting November 2021, all app updates will be required to target API level 30 (Android 11).

This message appears on Play Store Console. Also see the Google News.

@erisu
Copy link
Member

erisu commented Apr 16, 2021

  • We have been aware of this requirement since it was published on their website.
  • We have been working on preparing a release and can not give an ETA for release.
  • We are working toward a release well before the Google’s Play Store enforcement.

@apache apache locked as resolved and limited conversation to collaborators Apr 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests