Use triple slash in localUri of local assets #12428
Merged
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.
Why
Fixes https://linear.app/expo/issue/ENG-724/textures-not-loading-in-expo-gl-in-published-android-apps
Fixes #10906
Related #12101
How
Local assets returned by
expo-updates
have just one slash in their file URIs.expo-gl
requires at least two, see below 馃憞expo/packages/expo-gl-cpp/cpp/EXGLImageUtils.cpp
Line 126 in 9c26fbc
expo-updates
usedfile.toURI()
which returnsjava.net.URI
object that stringifies tofile:/...
URI, which is actually not correct on many platforms. Instead, we need to useUri.fromFile(file)
fromandroid.net.Uri
that returnsfile:///...
URI.Test Plan
Creating GL texture from the asset works and it renders correctly (tried some GL examples in published NCL). Also tested against some other examples using assets.
Checklist
expo build
(eg: updated@expo/xdl
).expo prebuild
& EAS Build (eg: updated a module plugin).