GoogleChromeLabs / bubblewrap

Bubblewrap is a Command Line Interface (CLI) that helps developers to create a Project for an Android application that launches an existing Progressive Web App (PWAs) using a Trusted Web Activity.
Apache License 2.0
2.28k stars 153 forks source link

Upgrade to target SDK version 34 #860

Open jere-mie opened 1 week ago

jere-mie commented 1 week ago

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: https://github.com/pwa-builder/PWABuilder/issues/4766

jere-mie commented 1 week ago

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 commented 1 week ago

CC @ibrahimkarahan

andreban commented 1 week ago

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 commented 1 week ago

The process of bumping versions is most likely the same as this PR: https://github.com/GoogleChromeLabs/bubblewrap/pull/764

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

siaeweb commented 1 week ago

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

Aviv1000 commented 1 week ago

same here

charlypa commented 1 week ago

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

jere-mie commented 1 week ago

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 commented 6 days ago

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

andreban commented 6 days ago

@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 commented 6 days ago

A few people are out of office due to holidays in the US. We can take a look at this as soon as they’re back. PRs are also welcome.

On Tue, Jul 9, 2024 at 19:41 André Cipriani Bandarra < @.***> wrote:

@andreban https://github.com/andreban are we just looking for someone to make the changes you mentioned and put them up in a PR?

Looping @ibrahimkarahan https://github.com/ibrahimkarahan for thoughts here.

— Reply to this email directly, view it on GitHub https://github.com/GoogleChromeLabs/bubblewrap/issues/860#issuecomment-2218302451, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANNGTBO3MJLB3KEFKGUAETZLQODBAVCNFSM6AAAAABKMLTJPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJYGMYDENBVGE . You are receiving this because you were mentioned.Message ID: @.***>

A1kmm commented 4 days ago

I didn't see this issue until now, but I did make a PR: https://github.com/GoogleChromeLabs/bubblewrap/pull/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.