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

Android: Changes needed to support API 30 (Android 11) requirements from August 2021 #48636

Closed
9 tasks done
akien-mga opened this issue May 11, 2021 · 35 comments
Closed
9 tasks done

Comments

@akien-mga
Copy link
Member

akien-mga commented May 11, 2021

Godot version:
All Godot versions, but realistically only master, 3.x and 3.3.
Older versions don't support AABs which will become a requirement. (This might finally force EOL for 2.1, unless someone is really motivated to backport all this work to the 2.1 branch.)

Issue description:

Like clockwork, Google Play has updated requirements for new apps and updates that will be enforced from August 2021 (new apps) and November 2021 (updates). These requirements are described in https://developer.android.com/distribute/best-practices/develop/target-sdk (archive.org link).

From the above documentation, we need to support:

  • Publish with the Android App Bundle format. Supported in 3.3 and later.
    • AAB should likely be made the default option, and APK support deprecated? I'd keep it in 3.3 but we can possibly remove it in 3.4 (or deprecate and remove in 3.5 once Google Play no longer accepts APKs).
  • Use 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.
    • Where do we stand here for asset delivery features?
  • Target API level 30 (Android 11) or above and adjust for behavioral changes. Behavioral changes are:
    • Scoped storage enforcement: Access into external storage directories is limited to an app-specific directory and specific types of media that the app has created. Add support for Android scoped storage requirements #38913
    • Permissions auto-reset: If users haven't interacted with an app for a few months, the system auto-resets the app's sensitive permissions.
    • Background location access: Users must be directed to system settings in order to grant the background location permission to apps.
    • Package visibility: When an app queries for the list of installed apps on the device, the returned list is filtered.

We need to assess all of the above, implement it ASAP for the 3.x and master branches, and cherry-pick to 3.3. It would be great if we could have this in a 3.3 release at least by late June/July.

@godotengine/android

@KoBeWi
Copy link
Member

KoBeWi commented May 11, 2021

APK support deprecated? I'd keep it in 3.3 but we can possibly remove it in 3.4

AFAIK only Google Play supports AABs, you can't even install them directly on the device. They are still useful outside the Google Play.

@m4gr3d
Copy link
Contributor

m4gr3d commented May 24, 2021

AAB should likely be made the default option, and APK support deprecated? I'd keep it in 3.3 but we can possibly remove it in 3.4 (or deprecate and remove in 3.5 once Google Play no longer accepts APKs).

We would keep apk support (as the non default option) for stores that still relies on them (e.g: Oculus mobile store).
Also the ability to unpack and repack an apk may be useful in environments where we can't run the regular Android build tools.

Use 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.

As this will be the only available option when AAB is the default, we should aim to land these feature sooner rather than later. Here it would be useful to have an example use-case, a game or developer we can work with to ensure the feature behaves as expected and there's no regressions feature wise.
I'll follow up with a potential timeline for this feature.

Scoped storage enforcement: Access into external storage directories is limited to an app-specific directory and specific types of media that the app has created. #38913

We should aim to land this for Godot 3.4 (which hopefully we can ship prior to August).

  • Permissions auto-reset: If users haven't interacted with an app for a few months, the system auto-resets the app's sensitive permissions.
  • Background location access: Users must be directed to system settings in order to grant the background location permission to apps.
  • Package visibility: When an app queries for the list of installed apps on the device, the returned list is filtered.

I don't anticipate any changes being required for these.

@ICatRegister
Copy link

Is progress expected on this issue?
Got a letter from my publisher :

To continue distributing games further to them we would need an update to a target SDK of 30.

@m4gr3d
Copy link
Contributor

m4gr3d commented Jun 25, 2021

@ICatRegister yea, we'll be addressing the issue later next week.

@tolgayaz1991
Copy link

Hi, what is the latest situation about this upgrade? When is the planned time for Godot Engine to support api 30 (Android 11)?

@lefavilla
Copy link

@m4gr3d have you adressed this issue yet? I stalk this issue since it is created and very concerned about app updates in august.

@kuruk-mm
Copy link
Contributor

kuruk-mm commented Jul 22, 2021

Any news about this? I want to publish a game of 450 MB size. I tried to upload it as an AAB, and the limit is 150 MB like @akien-mga said 😢

@lefavilla
Copy link

[...] a game or developer we can work with to ensure the feature behaves as expected and there's no regressions feature wise.
I'll follow up with a potential timeline for this feature.

@kuruk-mm m4gr3d has already said, that they look for devs who they can work with. Your app size seems to be an opportunity for this or am I wrong?

@kuruk-mm
Copy link
Contributor

kuruk-mm commented Jul 22, 2021

[...] a game or developer we can work with to ensure the feature behaves as expected and there's no regressions feature wise.
I'll follow up with a potential timeline for this feature.

@kuruk-mm m4gr3d has already said, that they look for devs who they can work with. Your app size seems to be an opportunity for this or am I wrong?

Thanks! Now I read that :)

As this will be the only available option when AAB is the default, we should aim to land these feature sooner rather than later. Here it would be useful to have an example use-case, a game or developer we can work with to ensure the feature behaves as expected and there's no regressions feature wise.

I offer myself! Let me know. I will help you with everything you need! We already have our game in Desktop working, and we're trying to release an Alpha version. So we can fail a lot :) haha

@kyoz
Copy link

kyoz commented Aug 7, 2021

I'm using 3.3.2, today i release an app to internal testing and of course google require API 30.

I'v modified android/build/config.gradle file like

ext.versions = [
    androidGradlePlugin: '4.0.1',
    compileSdk         : 30,
    minSdk             : 18,
    targetSdk          : 30,
    buildTools         : '30.0.3',
    ...
]

I'v tried the output apk and it work, aab file is success uploaded to google play console. But is it legal?. @@.

@lefavilla
Copy link

I'm using 3.3.2, today i release an app to internal testing and of course google require API 30.

I'v modified android/build/config.gradle file like

ext.versions = [
    androidGradlePlugin: '4.0.1',
    compileSdk         : 30,
    minSdk             : 18,
    targetSdk          : 30,
    buildTools         : '30.0.3',
    ...
]

I'v tried the output apk and it work, aab file is success uploaded to google play console. But is it legal?. @@.

Interesting. Why should it not be legal?

@ronnywolf42
Copy link

@akien-mga
hello!

we wanted to publish our new game today, but we can't upload it to Google Play because of these issues. I don't know how to get help, so i ask here...or is there customer service? It is August now and only one of the tasks on your list have been done. Google annonced these changes for a long time now. what should we do now? we spent months developing the game in godot because we liked the engine and now all is in vain? i am really worried about godot now and our game. should we change engine to Unity finally? I feel like it!

Just increasing the number to 30 will not do. you also have to implement the new requirements, or game will be taken down after. Will this be fixed in next release? And when please?

I am sorry if i'm very confrontational, but this is huge problem for ALL new games which use this engine.

@Calinou
Copy link
Member

Calinou commented Aug 11, 2021

..or is there customer service?

Godot has no customer service, and there is no warranty provided as per the license. We also don't offer official commercial support, but nothing prevents third parties from providing commercial support.

we spent months developing the game in godot because we liked the engine and now all is in vain? i am really worried about godot now and our game. should we change engine to Unity finally? I feel like it!

Don't worry, support for Android API 30 will come eventually 🙂

However, we don't give ETAs because this kind of work happens on a best-effort basis. We'd prefer not making promises that we can't reasonably hold up to.

@ronnywolf42
Copy link

I understand that, sorry. But shouldn't fixing this be a top priority for the Godot team? Instead this issue is sitting here since 3 months and almost nothing has been done. what good is an engine or new shiny features when it can't even deploy to a major platform it supposedly supports? :/

@akien-mga
Copy link
Member Author

It is a priority, but we have limited resources and we do our best with what we have.

Most of the items in the above list are optional and needed only when you actually need those features. What's needed to fulfill these requirements is to target API level 30, which means losing support for the legacy access to external storage which needs to be replaced with scoped storage, and this is not trivial to retrofit in an existing engine. This is being worked on by @m4gr3d.

Just increasing the number to 30 will not do. you also have to implement the new requirements, or game will be taken down after.

Are you sure about this? My current understanding is that as long as you're not relying on one of the obsoleted features which need to be replaced by new APIs (scoped storage, 150MB assets delivery), targeting API level 30 should work and be a working solution. That's my current plan for 3.3.3 if we can't finalize scoped storage support in coming days.

@ronnywolf42
Copy link

I know that Godot is OpenSource and that mostly volonteers are working on this. I just tought that critical things like this have greater importance than new features and such.

We use external storage to save progression data, so that it's available when reinstalling it again. If scoped storage can't be done we have to use a server side solution...or just use internal storage.

I just read through the rest of the requirements in the docs. What about changes to compressed resource files (https://developer.android.com/about/versions/11/behavior-changes-11#compressed-resource-file)? Current export contains a resources.arsc file. Is this ok?

Thank you for responding so quickly, and sorry again. I think it will work, i just got too exited.

@lefavilla
Copy link

lefavilla commented Aug 12, 2021

I know that Godot is OpenSource and that mostly volonteers are working on this. I just tought that critical things like this have greater importance than new features and such.

This morning I had a little Idea. Maybe you could try to outsource the delivery part to an external AAR as Godot-Plugin until it gets cold fixed within the engine if needed?

Same thing goes for the media storage manager, what could be a preferred way in your case without depending on an external data server.

What I saw in the google docs; you could flag the new permissions in the aar lib and then you could manage the data from your user. Within an AAR you could then manage everything and feed it back to your game likewise feed game data to aar. That is just an idea and not tested by me! Godot and java can handle JSON strings with no problem. So, there is no problem to transfer data strings between godot and an aar manager lib.

Because of my work I have not the time to code it by myself. Hope it helps

@m4gr3d
Copy link
Contributor

m4gr3d commented Aug 13, 2021

@ronnywolf42 For saving progression data, using internal storage (or app specific directories) is indeed the recommended approach.
This ensures that the system is able to clean all relevant app data when the user decides to uninstall an app.

If you'd like the user to retain game data, we'll be exposing this configuration which will enabled you to do so.

@akien-mga
Copy link
Member Author

akien-mga commented Aug 13, 2021

For those who are currently blocked by us not targeting SDK 30, I've made a test build here from #50359 which has support for scoped storage:

https://downloads.tuxfamily.org/godotengine/testing/3.3.3-rc.pr50359/
(Windows and Linux editor builds, Android templates only)

It would be great if you could confirm that it works for you to deploy on device and on Google Play.

Note that it doesn't implement Play Asset Delivery for 150MB+ AABs yet, that will be done later.

@ronnywolf42
Copy link

@m4gr3d Thank you for working on that and scoped storage.
@akien-mga thank you! i can try your build with our game.

@sebastianpennino
Copy link

I'm using 3.3.2, today i release an app to internal testing and of course google require API 30.

I'v modified android/build/config.gradle file like

ext.versions = [
    androidGradlePlugin: '4.0.1',
    compileSdk         : 30,
    minSdk             : 18,
    targetSdk          : 30,
    buildTools         : '30.0.3',
    ...
]

I'v tried the output apk and it work, aab file is success uploaded to google play console. But is it legal?. @@.

For other persons finding this thread, @kyoz is manually modifying the file located on ${your project folder}/android/build/config.gradle, and changing "targetSdk" to 30 (I didn't change de compileSdk and google play didn't complained).

@kyoz: thank you very much, this worked for me (although I consider it a workaround) and allowed me to keep working with the google play console (I'm still months or even more time away from the real release to the public, but this allows me to keep testing the app internally). Thanks.

@akien-mga
Copy link
Member Author

For those who are currently blocked by us not targeting SDK 30, I've made a test build here from #50359 which has support for scoped storage

There's now an official 3.3.3 RC 2 which includes this work: https://godotengine.org/article/release-candidate-godot-3-3-3-rc-2

Please test and confirm that it works to publish new games on Google Play (and if not, what issues seem to remain). I plan to release 3.3.3 stable this week.

@m4gr3d
Copy link
Contributor

m4gr3d commented Aug 20, 2021

@kuruk-mm Quick update; we'll try to land support for Play asset delivery (which enables larger AAB upload) for the 3.4 release, so rough eta would be around late September.
I'll provide more updates once we start testing the feature.

@m4gr3d
Copy link
Contributor

m4gr3d commented Sep 10, 2021

@kuruk-mm I've submitted PR #52526 for review which adds Play Asset Delivery support to Godot 3.4.
If you're familiar with building Godot from source, can you give the PR a try for your project.

@Calinou
Copy link
Member

Calinou commented Apr 7, 2022

It looks like targeting level 31+ will be required starting from June (or July) 2022: https://godotforums.org/discussion/29262/android-targetsdk-31-or-32-export

@NianoTT
Copy link

NianoTT commented May 5, 2022

It looks like targeting level 31+ will be required starting from June (or July) 2022: https://godotforums.org/discussion/29262/android-targetsdk-31-or-32-export

According to here: https://support.google.com/googleplay/android-developer/answer/11926878 from August 1st.

@Zireael07
Copy link
Contributor

@hani09876: You were asked to stop spamming this request everywhere.

@filipworksdev
Copy link

filipworksdev commented Jun 18, 2022

Hi guys, I am testing target SDK level 33 on my build. Starting with Android 12 we need to add android:exported="true" in AndroidManifest.xml under <activity> otherwise is not going to build. I tested the editor built with target 33 and didn't noticed any issues or differences. Seems 30 to 33 might not require any code changes other than that exported issues mentioned above at 33. It may be possible to skip straight to 32 or 33.

@m4gr3d
Copy link
Contributor

m4gr3d commented Jun 19, 2022

Hi guys, I am testing target SDK level 33 on my build. Starting with Android 12 we need to add android:exported="true" in AndroidManifest.xml under <activity> otherwise is not going to build. I tested the editor built with target 33 and didn't noticed any issues or differences. Seems 30 to 33 might not require any code changes other than that exported issues mentioned above at 33. It may be possible to skip straight to 32 or 33.

@filipworksdev We're updating the target sdk in #51815.

@akien-mga we'll need to review and merge #51815 prior to Google's deadline for updating the target sdk.

@ghost
Copy link

ghost commented Jun 19, 2022

Hi guys, I am testing target SDK level 33 on my build. Starting with Android 12 we need to add android:exported="true" in AndroidManifest.xml under <activity> otherwise is not going to build. I tested the editor built with target 33 and didn't noticed any issues or differences. Seems 30 to 33 might not require any code changes other than that exported issues mentioned above at 33. It may be possible to skip straight to 32 or 33.

@filipworksdev We're updating the target sdk in #51815.

@akien-mga we'll need to review and merge #51815 prior to Google's deadline for updating the target sdk.

Is it implemented on Godot 3.5 RC 4

@Calinou
Copy link
Member

Calinou commented Jun 19, 2022

Is it implemented on Godot 3.5 RC 4

No, as that pull request isn't merged yet. Depending on when 3.5 is planned to be released, this may have to wait for a 3.5.x point release to be merged.

PS: Please don't multi-quote in replies. Remove all quotes except the last reply to prevent threads from looking too cluttered.

@NianoTT
Copy link

NianoTT commented Jun 19, 2022

@Calinou Is it planned to update the 3.4 branch with this?

@Calinou
Copy link
Member

Calinou commented Jun 19, 2022

@Calinou Is it planned to update the 3.4 branch with this?

There may be a 3.4 point release for this, but I can't give any guarantees.

@akien-mga
Copy link
Member Author

Please test this build which adds full support for Android scoped storage and updated the target API to 32: #51815 (comment)

If it works well, this should be part of 3.5-stable in coming days.

There should also be a 3.4.5 release that will target API 31 following #62297 - we'll also need confirmation there that it fulfills the August 2022 requirements.

@akien-mga akien-mga modified the milestones: 4.0, 3.5 Jun 27, 2022
@akien-mga
Copy link
Member Author

akien-mga commented Jun 27, 2022

This is all implemented in 3.5 (most of the requirements were already fulfilled by 3.4).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests