Repository navigation
fix(🤖): build the Android library at its API 26 floor and raise an Expo app to it - #556
Merged
wcandillon merged 5 commits intoOct 16, 2026
Merged
Conversation
…po app to it An Expo app's Android build failed in the library's C++: Expo sets minSdkVersion 24, the library built at the app's value, and its native code calls the AHardwareBuffer API, which Android 8 (API 26) introduced. Wgpu_minSdkVersion only applied to an app that sets no minSdkVersion. android/build.gradle now builds the library at the higher of the app's minSdkVersion and Wgpu_minSdkVersion, so an app below 26 stops at the manifest merger with Android's suggestion to raise its minSdk. The config plugin raises an Expo app's android.minSdkVersion to that floor, read from android/gradle.properties, and keeps a higher value, so an Expo app with the plugin builds with Expo's defaults. The installation, Expo and Canvas pages state the minimum. Fixes wcandillon#554
wcandillon
self-requested a review
October 16, 2026 11:46
wcandillon
requested changes
Oct 16, 2026
wcandillon
left a comment
Owner
There was a problem hiding this comment.
Can you update the documentation to make it clear that the expo plugin is not iOS only now and it looks like the PR is marked as draft?
The Expo page still called the plugin a no-op on Android. It now lists each platform's step: Metal API Validation off in the iOS scheme, the app's minSdkVersion raised to 26 on Android. Both are re-applied on every prebuild.
YevheniiKotyrlo
marked this pull request as ready for review
October 16, 2026 12:08
Contributor
Author
|
Updated the Expo page and CONTRIBUTING.md to say what the plugin does on each platform: Metal API Validation off in the iOS scheme, |
wcandillon
self-requested a review
October 16, 2026 17:29
wcandillon
approved these changes
Oct 16, 2026
wcandillon
approved these changes
Oct 16, 2026
|
🎉 This PR is included in version 0.16.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #554.
Problem
An Expo app's Android build fails in the library's C++: Expo sets
minSdkVersion24, the library builds at the app's value, and its native code calls theAHardwareBufferAPI, which Android 8 (API 26) introduced.Wgpu_minSdkVersion=26never reaches an app:android/gradle.propertiesis not in the published files.Solution
android/build.gradlebuilds the library at the higher of the app'sminSdkVersionandandroidMinSdkVersion, a newpackage.jsonfield (26), so an app below 26 stops at the manifest merger with Android's suggestion to raise its minSdk instead of at the compiler. The unusedWgpu_minSdkVersiongoes.android.minSdkVersionGradle property to that floor and keeps a higher value, so an Expo app with the plugin, the template included, builds with Expo's defaults.CONTRIBUTING.mddescribe the plugin's step on each platform.Tests
plugin/src/__tests__/setMinSdkVersion.test.ts: the property is added, a lower value raised in place, a higher one kept, the change idempotent.Verification
react.minSdkVersion=24: before,:react-native-webgpu:externalNativeBuildDebugfails with'AHardwareBuffer_describe' is unavailable: introduced in Android 26and the same error for every otherAHardwareBuffercall; after,:app:processDebugMainManifestfails withuses-sdk:minSdkVersion 24 cannot be smaller than version 26 declared in library [:react-native-webgpu].apps/expo-webgpuwith this branch packed and installed as npm would:npx expo prebuild --platform androidwritesandroid.minSdkVersion=26, and./gradlew assembleDebugsucceeds; with the published 0.8.5,./gradlew assembleReleasethere fails with the errors above.yarn lint·yarn tsc· the package and web-template builds ·yarn test:plugin·yarn check-dawn·yarn build:docs·npm run cpplintmerged withmain(this branch changes no C++ file).