Repository navigation
chore(馃): give the example app its own Android application id - #575
Merged
Merged
Conversation
react-native-test-app builds every example to its default application id, com.microsoft.reacttestapp, so the WebGPU and Skia examples replaced each other on a device and could not be installed side by side. The example now sets `android.package` in app.json, which the test app writes to `applicationId`: com.reactnativewebgpu.example. The Java namespace stays the test app's own (com.microsoft.reacttestapp): `packageName` in react-native.config.js keeps naming it, since the CLI's generated entry point reads BuildConfig from that package, and the launcher activity keeps its full name. The CI launch by package is updated, and the agent workflow starts the activity by its full class name instead of one relative to the application id. Verified with a debug build: the APK's package is com.reactnativewebgpu.example and its launchable activity is com.microsoft.reacttestapp.MainActivity.
|
馃帀 This PR is included in version 0.17.0 馃帀 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.
Why
Every react-native-test-app example builds to the test app's default application id,
com.microsoft.reacttestapp, so the WebGPU and Skia examples replace each other on a device and cannot be installed side by side (which cost an aborted e2e run while verifying #574).What
apps/example/app.jsonsetsandroid.packagetocom.reactnativewebgpu.example; react-native-test-app writes it toapplicationId.react-native.config.jskeepspackageNameatcom.microsoft.reacttestappwith a comment: that field is the Java namespace, which the CLI's generatedReactNativeApplicationEntryPointreadsBuildConfigfrom, and the test app's app module keeps its own. Pointing it at the new id fails the Java compile.ci.ymllaunches the test app by the new id.agent.ymluses the new id and starts the activity by its full class name,com.microsoft.reacttestapp.MainActivity, since the relative.MainActivitywould resolve against the new application id and fail.Companion: wcandillon/react-native-skia#4265 with
com.reactnativeskia.example.Verification
A debug build's APK reports
package: name='com.reactnativewebgpu.example'andlaunchable-activity: name='com.microsoft.reacttestapp.MainActivity'(aapt2 dump badging). Anyone with the old id installed keeps it as a separate app until they uninstall it.