Skip to content

Commit

Permalink
[launcher][Android] Fix loading app without reverse proxy (#26630)
Browse files Browse the repository at this point in the history
Closes #26364.

This PR: facebook/react-native#37265 changes how the packager connection is received. Now, it's passed next to the dev support settings, so our swapping logic didn't cover that.

```
- npx expo prebuild -p android --clean
- cd ./android
- ./gradlew app:assembleDebug
- Install the apk from ./android/app/build/outputs/apk/debug on your physical device
- npx expo start
- Connect to the dev server
```
  • Loading branch information
lukmccall authored and brentvatne committed Jan 23, 2024
1 parent 0824542 commit 48561a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/expo-dev-launcher/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### 🐛 Bug fixes

- [Android] Fixed unable to load dev client bundle on device. ([#26630](https://github.com/expo/expo/pull/26630) by [@lukmccall](https://github.com/lukmccall))

### 💡 Others

## 3.6.3 — 2024-01-18
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ fun injectDebugServerHost(
val mSettingsField = devServerHelper.javaClass.getDeclaredField("mSettings")
mSettingsField.isAccessible = true
mSettingsField[devServerHelper] = settings

val packagerConnectionSettingsField = devServerHelper.javaClass.getDeclaredField("mPackagerConnectionSettings")
packagerConnectionSettingsField.isAccessible = true
packagerConnectionSettingsField[devServerHelper] = settings.public_getPackagerConnectionSettings()

// set useDeveloperSupport to true in case it was previously set to false from loading a published app
val mUseDeveloperSupportField = instanceManager.javaClass.getDeclaredField("mUseDeveloperSupport")
mUseDeveloperSupportField.isAccessible = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ internal class DevLauncherInternalSettings(
private var packagerConnectionSettings = DevLauncherPackagerConnectionSettings(context, debugServerHost)

override fun getPackagerConnectionSettings() = packagerConnectionSettings

@Suppress("FunctionName")
fun public_getPackagerConnectionSettings() = getPackagerConnectionSettings()
}

/**
Expand Down

0 comments on commit 48561a0

Please sign in to comment.