react-native-community / cli

React Native command line tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

On Android, app isn't opened automatically if applicationId is changed

geydson opened this issue · comments

Description

I'm using expo bare with access to android files. I change applicationId but keep package ID. I run yarn android --appId new.app.id where a different applicationId from the namespace is used but generates a type 3 error and the application does not open.

This does not occur in old versions such as the old project which is on 0.64.4, I am updating to 0.73.4, with this new "namespace" variable, if I leave the "applicationId" different I get the error below.

Captura de Tela 2024-03-14 às 11 41 44

Steps to reproduce

Run npx react-native init foobar
Open android/app/build.gradle, namespace "com.foobar" change applicationId "com.foobar" to applicationId "com.foo.bar"
Run yarn android --appId com.foo.bar
It throws Error: Couldn't open Android app with activity "com.foo.bar/.MainActivity" on device "Pixel_4_API_34".. and doesn't start app

React Native Version

0.73.4

Affected Platforms
Runtime - Android, Build - MacOS

Output of npx react-native info
System:
OS: macOS 14.3.1
CPU: (8) arm64 Apple M1 Pro
Memory: 101.50 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.19.1
path: /usr/local/bin/node
Yarn:
version: 1.22.21
path: /opt/homebrew/bin/yarn
npm:
version: 10.2.4
path: /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.15.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.4
- iOS 17.4
- macOS 14.4
- tvOS 17.4
- visionOS 1.1
- watchOS 10.4
Android SDK:
Android NDK: 25.1.8937393
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode:
version: 15.3/15E204a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.10
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.6
wanted: 0.73.6
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false

hey, since you're using Expo please use their command to launch the app.