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

Upgrade to target SDK version 34 #860

Open
jere-mie opened this issue Jul 5, 2024 · 22 comments
Open

Upgrade to target SDK version 34 #860

jere-mie opened this issue Jul 5, 2024 · 22 comments

Comments

@jere-mie
Copy link

jere-mie commented Jul 5, 2024

Is your feature request related to a problem? Please describe.
Currently, bubblewrap targets SDK version 33, which is no longer supported for apps to be published on the Play Store.

Describe the solution you'd like
Target SDK version 34

Describe alternatives you've considered
Manually specifying a specific SDK

Additional context
This issue for PWABuilder is what prompted me to create this: pwa-builder/PWABuilder#4766

@jere-mie
Copy link
Author

jere-mie commented Jul 5, 2024

It appears that changing export const BUILD_TOOLS_VERSION = '33.0.2'; to some version above 34 in packages/core/src/lib/androidSdk/AndroidSdkTools.ts should be sufficient, though I haven't been able to verify

@andreban
Copy link
Member

andreban commented Jul 5, 2024

CC @ibrahimkarahan

@andreban
Copy link
Member

andreban commented Jul 5, 2024

It appears that changing export const BUILD_TOOLS_VERSION = '33.0.2'; to some version above 34 in packages/core/src/lib/androidSdk/AndroidSdkTools.ts should be sufficient, though I haven't been able to verify

Most likely you'd want to update targetSdkVersion and compileSdkVersion on build.gradle. Build tools, as you mentioned may be needed to.

The thing to be aware of is that Android introduces changes to OS between different target SDKs - once upgraded, there's a chance the generated application won't build anymore and require changes to fix it, or that it may behave differently at runtime.

@jere-mie
Copy link
Author

jere-mie commented Jul 5, 2024

The process of bumping versions is most likely the same as this PR: #764

CCing @PEConn since they were involved with the bump to v33

@siaeweb
Copy link

siaeweb commented Jul 6, 2024

Also facing the same issue while creating my first PWA app. Upgrade to target SDK version 34.

@Aviv1000
Copy link

Aviv1000 commented Jul 7, 2024

same here

@charlypa
Copy link

charlypa commented Jul 7, 2024

Screenshot from 2024-07-07 13-15-32

@jere-mie
Copy link
Author

jere-mie commented Jul 8, 2024

it would be nice if we could add a cli flag or environment variable or something of that nature that allows us to specify the default target - and would prevent this from being a blocker for people in the future when Google decides change the requirements again.

Maybe that's an idea for a separate issue though

@jgw96
Copy link

jgw96 commented Jul 9, 2024

@andreban are we just looking for someone to make the changes you mentioned and put them up in a PR?

@andreban
Copy link
Member

andreban commented Jul 9, 2024

@andreban are we just looking for someone to make the changes you mentioned and put them up in a PR?

Looping @ibrahimkarahan for thoughts here.

@ibrahimkarahan
Copy link
Collaborator

ibrahimkarahan commented Jul 9, 2024 via email

@A1kmm
Copy link
Contributor

A1kmm commented Jul 11, 2024

I didn't see this issue until now, but I did make a PR: #862. It seems to work to produce SDK version 35 APKs - but took quite a number of consequential updates (it isn't as simple as just bumping the version, as quite a few dependencies are old (including JDK), and Bubblewrap doesn't even build cleanly within the current NPM dependencies right now).

My PR doesn't upgrade SDK tools though.

If anyone wants to test it out while it is being reviewed:

git clone https://github.com/GoogleChromeLabs/bubblewrap
cd bubblewrap
git fetch origin pull/862/head:sdk35
git checkout sdk35
npm install && npm run build

That should give you a working script in ./packages/cli/bin/bubblewrap.js, which you can symlink as bubblewrap from somewhere in your path if you want (or just run it by absolute path). You might need to delete the jdkPath key from the JSON in ~/.bubblewrap/config.json if you have previously installed an older JDK with Bubblewrap (use the doctor subcommand to check if unsure). Since my changes are quite significant due to the number of things updated, more testing by other people would be appreciated.

@lukastribus
Copy link

The PR was merged. But a bubblewrap release is probably necessary for other projects to be able to pick up the change.

@viral32111
Copy link

When can we expect a release?

@Mahera72
Copy link

Mahera72 commented Jul 23, 2024 via email

@kaktus42
Copy link

kaktus42 commented Jul 26, 2024

For me it worked to change

  • compileSdkVersion 33 to compileSdkVersion 34 and
  • targetSdkVersion 33 to targetSdkVersion 34

in the file app/build.grade and then run `bubblewrap build.

Whenever you run bubblewrap update, it will overwrite app/build.grade and you have to make the changes again. (At least until bubblewrap gets an update.)

2024-07-26_15-31

The comment by @andreban and comment by @jere-mie put me on the right track.

@Cristian021195
Copy link

The kaktus42 way worked for me, just one more thing, if you are using bubblewrap for twa and make any change in twa-manifest.json, when you wanna build it again, will set compileSdkVersion 33 again, so keep in mind.

@dhalldmg
Copy link

dhalldmg commented Aug 6, 2024

I followed @kaktus42 steps also (thank you for sharing). However, I'm confused because this warning is not going away.
The detail when clicking on "Go to Policy status" says that "App must target Android 14 (API level 34) or higher" Is there still something that needs done?

Capture

@maiconcarraro
Copy link

@dhalldmg the warning is saying something about policies it can be related to other changes, recently I got a similar warning to check some specific features (comply or not), recommend to check.

@dhalldmg
Copy link

dhalldmg commented Aug 6, 2024

@dhalldmg the warning is saying something about policies it can be related to other changes, recently I got a similar warning to check some specific features (comply or not), recommend to check.

The policy status / issue detail is "App must target Android 14 (API level 34) or higher"

1

@ibrahimkarahan
Copy link
Collaborator

Hi everyone, thanks for your patience! We just pushed version 1.22.0 into npm which bumps up targetSdkVersion to 35 and Play Billing Library to v6. You can update your Bubblewrap version to regenerate the Android project and upload to the Play Store.

@cmizzi
Copy link

cmizzi commented Aug 8, 2024

Hi everyone, thanks for your patience! We just pushed version 1.22.0 into npm which bumps up targetSdkVersion to 35 and Play Billing Library to v6. You can update your Bubblewrap version to regenerate the Android project and upload to the Play Store.

The tag has been pushed as well as the Docker image. But the Docker image is still running the version 1.21.0.

docker run -ti --rm ghcr.io/googlechromelabs/bubblewrap:1.22.0 --version

,-----.        ,--.  ,--.  ,--.
|  |) /_,--.,--|  |-.|  |-.|  |,---.,--.   ,--,--.--.,--,--.,---.
|  .-.  |  ||  | .-. | .-. |  | .-. |  |.'.|  |  .--' ,-.  | .-. |
|  '--' '  ''  | `-' | `-' |  \   --|   .'.   |  |  \ '-'  | '-' '
`------' `----' `---' `---'`--'`----'--'   '--`--'   `--`--|  |-'
                                                           `--'
version 1.21.0

Probably related:

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

No branches or pull requests