expo-cli
expo-cli copied to clipboard
expo run:android is not respecting the variant passed by flag while opening the app using the terminal.
Summary
Hello Guys, how is it going?
Currently, my application has 3 packages names/bundle identifiers, each one has the respecting Android Flavors and iOS schemes. For some reason when I try to run:
APP_VARIANT=dev expo run:android --variant devDebug
The expo will build the project using the right package name and will install the newly generated app on the android emulator. Everything seems to work fine, but when the expo tries to open the application with this message: Opening com.company.mobile.app://expo-development-client/?url=http%3A%2F%2F192.168.2.45%3A8081
I receive the following error:
As you can see to open the app expo is using another package name, if I change the command to use flavor/variant that is appearing on the image, the expo will be able to open the app with no problems.
The weirdest thing is expo build and installs the right package name, but to run and open he chooses a different one.
If I run the same command for ios, it will work and install the correct app using the right bundle identifier, and open it.
Environment
expo-env-info 1.0.2 environment info: System: OS: macOS 12.3.1 Shell: 5.8 - /bin/zsh Binaries: Node: 16.13.2 - /usr/local/bin/node Yarn: 1.22.17 - /opt/homebrew/bin/yarn npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm Watchman: 2022.03.07.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 IDEs: Android Studio: Bumblebee 2021.1.1 Patch 3 Bumblebee 2021.1.1 Patch 3 Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild npmPackages: @expo/metro-config: ^0.3.10 => 0.3.13 @expo/webpack-config: ^0.16.17 => 0.16.20 expo: ~44.0.6 => 44.0.6 react: 17.0.1 => 17.0.1 react-dom: 17.0.2 => 17.0.2 react-native: 0.64.3 => 0.64.3 react-native-web: 0.17.5 => 0.17.5 Expo Workflow: bare
Please specify your device/emulator/simulator platform, model and version
Android Pixel_5_API_32
Error output
Couldn't start project on Android: Error running adb: The development client (XXX.XXX.mobile.app.staging) for this project is not installed. Please build and install the client on the device first. Learn more: https://docs.expo.dev/clients/distribution-for-android/
Reproducible demo or steps to reproduce from a blank project
Repo: https://github.com/mendesbarreto/expo-android-flavor-problem
Command to run:
#steps
npm install
APP_VARIANT=dev expo run:android --variant devDebug