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

Update Android SDK to version 35.0.1 and targetSdkVersion to 35 #10081

Merged
merged 25 commits into from
Jan 23, 2025

Conversation

AGulev
Copy link
Contributor

@AGulev AGulev commented Jan 20, 2025

Android SDK updated to the latest stable version 35.0.1

Fix #10037

@@ -0,0 +1,93 @@
name: Package Android SDKs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's annoying to run win/linux just to package SDK for all the platforms.
I added this action we can run manually and prepare SDKs specified in sdk.py


PLATFORM=android-${ANDROID_PLATFORM}

HOST=`uname | tr '[:upper:]' '[:lower:]'`
SDKMANAGER="sdkmanager"
D8TOOL="d8"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some improvements for the script to be able to build it on windows

@AGulev AGulev marked this pull request as ready for review January 20, 2025 16:25
@@ -288,7 +288,8 @@ task createBobLightJar(type: Jar, dependsOn: [createExternalLibsLightJar, create
include 'libexec/**/glslang*',
'libexec/**/tint*',
'libexec/**/spirv-opt*',
'libexec/**/luajit*'
'libexec/**/luajit*',
'libexec/**/aapt2'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to use aapt2 from build tools to link apk instead of one from bundletool-all.jar

Otherwise we will get:

RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data.
Failed to load resources table in APK ‘android.jar’.

google/bundletool#381

// Make sure it's extracted once
File bundletool = new File(Bob.getLibExecPath("bundletool-all.jar"));
String aapt2 = Bob.getExe(Platform.getHostPlatform(), "aapt2");
if (aapt2 == null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep both ways in case we will be able to remove this extra appt2 again

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split into two executables using:

lipo aapt2 -thin x86_64 -output aapt2-x86_64

lipo aapt2 -thin arm64 -output aapt2-arm64


jobs:
build-linux:
runs-on: ubuntu-20.04
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better use 22.04 at least because 20.04 end of life at Apr'25.
actions/runner-images#11101

echo "ANDROID_TARGET_API_LEVEL=$ANDROID_TARGET_API_LEVEL" >> $GITHUB_ENV
echo "ANDROID_BUILD_TOOLS_VERSION=$ANDROID_BUILD_TOOLS_VERSION" >> $GITHUB_ENV

- name: Archive results
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth to implement direct upload to S3 instead of github artifacts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah, it's pretty rare action and I don't see it as a problem to upload it myself.

{
extractFile(bundletool, platformName + "/" + getAapt2Name(), aapt2);
aapt2.setExecutable(true);
File aapt2_file = new File(bundletool.getParent(), getAapt2Name());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[codestyle] aapt2_file -> aapt2File

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use two different code styles in the same function if you see above.
I just picked one we use for tools
But I'll fix it

{
platformName = "linux";
}
Platform hostPlatform = Platform.getHostPlatform();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems it worth to move outside condition body and use it in String aapt2 = Bob.getExe(Platform.getHostPlatform(), "aapt2");


TOOLHOSTNAME=$HOST
if [ "$HOST" == "darwin" ]; then
TOOLHOSTNAME="mac"
fi

if [ "$TERM" == "cygwin" ]; then
HOST="win"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong indentation.

if (libc_url != null) {
File f = new File(rootFolder, Platform.getHostPlatform().getPair() + "/lib/" + libc_filename);
Bob.atomicCopy(libc_url, f, false);
String libcFilename = Platform.getHostPlatform().getLibPrefix() + "c++" + Platform.getHostPlatform().getLibSuffix();
Copy link
Contributor Author

@AGulev AGulev Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just renaming for consistency

@AGulev AGulev requested a review from ekharkunov January 22, 2025 14:27
@AGulev AGulev merged commit d0e7232 into dev Jan 23, 2025
21 of 22 checks passed
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

Successfully merging this pull request may close these issues.

Update Android SDK to Android 15 (API 35)
2 participants