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

Android and Android TV instances are overriding each others app #1249

Closed
VMBindraban opened this issue Nov 21, 2023 · 3 comments
Closed

Android and Android TV instances are overriding each others app #1249

VMBindraban opened this issue Nov 21, 2023 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@VMBindraban
Copy link

Describe the bug
When i run npx rnv run -p android (or androidtv) it targets both the android and the androidtv sim.

I am getting the following message:

⠼ Waiting for bundler to finish...[ task ] [run] _isBundlerRunning[5]
[ task ] [run] _isBundlerRunning[6] (YES)
✔ Waiting for bundler to finish...
[ task ] [run] runAndroid[1] target:undefined default:Nexus_5X_API_26
[ task ] [run] getAndroidTargets[1] skipDevices:false skipAvds:false deviceOnly:false
✔ Executing: /Users/vijay/Library/Android/sdk/platform-tools/adb devices -l
✔ Executing: /Users/vijay/Library/Android/sdk/emulator/emulator -list-avds
✔ Waiting for emulator to boot...
✔ Waiting for emulator to boot...
✔ Executing: /Users/vijay/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell wm size
✔ Executing: /Users/vijay/Library/Android/sdk/platform-tools/adb -s emulator-5556 shell wm size
✔ Executing: /Users/vijay/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell wm density
✔ Executing: /Users/vijay/Library/Android/sdk/platform-tools/adb -s emulator-5556 shell wm density
✔ Executing: /Users/vijay/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop
✔ Executing: /Users/vijay/Library/Android/sdk/platform-tools/adb -s emulator-5556 shell getprop
[ info ] [run] Found device Pixel_7_Pro_API_33:emulator-5554!
[ task ] [run] _runGradleApp[1]
✔ Executing: npx react-native run-android --mode=Debug --no-packager --deviceId=emulator-5554

info Building the app...

> Configure project :react-native-video
useExoplayerIMA:false
WARNING:The specified Android SDK Build Tools version (30.0.0) is ignored, as it is below the minimum supported version (30.0.3) for Android Gradle Plugin 7.4.2.
Android SDK Build Tools 30.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '30.0.0'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:installDebug
Installing APK 'app-debug.apk' on 'Television_1080p_API_33(AVD) - 13' for :app:debug
Installing APK 'app-debug.apk' on 'Pixel_7_Pro_API_33(AVD) - 13' for :app:debug
Installed on 2 devices.

The app is however only installed on android and it was removed on the androidtv.
If i also run npx rnv run -p androidtv next to the existing android build it will say the same message but it removes the app from android and install it only on the androidtv.

The androidtv targets [ info ] [run] Found device Television_1080p_API_33:emulator-5556!

Desktop:

  • OS: OSX 14.1.1
  • Node Version: 18
  • RNV Version: 1.0.0-feat-bonanza.12

Note:
I am running 2 sims to test/develop both devices at the same time, they are using a different server.

@VMBindraban VMBindraban added the bug Something isn't working label Nov 21, 2023
@GabrieleKaceviciute
Copy link
Collaborator

@VMBindraban thanks for reporting this issue.
I reproduced it on 1.0.0-canary.9

  • OS: macOS Ventura 13.5.2 (Intel)
  • Node Version 18.14.2
  • RNV Version 1.0.0-canary.9
  • rnv/template-starter Version 1.0.0-canary.9

@RicardasN
Copy link
Collaborator

Seems to be the issue with react native itself. This specific line - https://github.com/react-native-community/cli/blob/main/packages/cli-platform-android/src/commands/runAndroid/index.ts#L184 seems to launch the app on multiple devices even with the deviceId provided. I think that could be the case due to gradle by default tries to launch on multiple. However, I did find a workaround for this, if you add --interactive option to cli command it launches only on one specific device.

To do this more easily, you could run the rnv command with --printExec, which will show the raw react native command, to which you will be able to add the --interactive option

@ElenaDiachenko
Copy link
Contributor

The answer has been provided. Closing this issue now. Please reopen if you have further questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants