Skip to content

run-android arguments --variant and and --appIdSuffix ignored #1796

@adrianso

Description

@adrianso

Environment

System:
OS: macOS 13.0.1
CPU: (8) arm64 Apple M1
Memory: 81.17 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.13.0 - /var/folders/cn/pdlsf8zs1cg0d21d3125ws400000gn/T/yarn--1673839173668-0.21160869548811556/node
Yarn: 1.22.19 - /var/folders/cn/pdlsf8zs1cg0d21d3125ws400000gn/T/yarn--1673839173668-0.21160869548811556/yarn
npm: 8.19.3 - ~/Library/Caches/fnm_multishells/45421_1673835655313/bin/npm
Watchman: 2023.01.09.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 23, 28, 29, 30, 31, 32, 33
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 31.0.0, 31.0.0, 31.0.0, 32.0.0, 32.0.0, 33.0.0, 33.0.0, 33.0.1
System Images: android-25 | Android Wear ARM EABI v7a, android-26 | ARM 64 v8a, android-27 | Google APIs ARM 64 v8a, android-30 | Google Play ARM 64 v8a, android-31 | Google Play ARM 64 v8a, android-33 | Google APIs ARM 64 v8a, android-33 | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9123335
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.17 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.0 => 0.71.0
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Description

When I run the following command, the variant and appIdSuffix arguments are ignored.
yarn react-native run-android --variant devDebug --appIdSuffix dev

I get the following error

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Task 'installDebug' not found in project ':app'.

This was working correct in the previous React Native release 0.70.4.

Reproducible Demo

  • Create a new project with npx react-native init RN071
  • Start an Android emulator
  • Run yarn react-native run-android --variant devDebug --appIdSuffix dev
  • Verify that the incorrect command ./gradlew app:installDebug -PreactNativeDevServerPort=8081 is run

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions