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

npx init with "--package-name" makes Android application crash on runtime #42280

Closed
jvaronenka opened this issue Jan 15, 2024 · 4 comments
Closed
Labels
Platform: Android Android applications. Resolution: Fixed A PR that fixes this issue has been merged.

Comments

@jvaronenka
Copy link

Description

If you initialise an application with "npx init" and provide a package name with "--package-name", then the built Android app will crash on startup.

No such issue exists on iOS.
No such issue on 0.72 versions.

I have narrowed this down to how MainActivity.kt is generated. It generates the following function:

override fun getMainComponentName(): String = "com.mycompany.MyApp"

However, it should be:

override fun getMainComponentName(): String = "MyApp"

Manually changing that function and rebuilding resolves the issue.

Steps to reproduce

  1. npx [email protected] init MyApp --version 0.73.2 --package-name com.mycompany.MyApp
  2. cd MyApp/android
  3. ./gradlew assembleRelease
  4. Launch app/build/outputs/apk/release/app-release.apk

React Native Version

0.73.2

Affected Platforms

Runtime - Android

Output of npx react-native info

n/a

Stacktrace or Logs

n/a

Reproducer

n/a

Screenshots and Videos

No response

@github-actions github-actions bot added Platform: Android Android applications. Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Jan 15, 2024
Copy link

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

@jvaronenka
Copy link
Author

I can't add a reproducer, but I have added reproduction steps. Is that sufficient?

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jan 15, 2024
@jvaronenka
Copy link
Author

Duplicate of react-native-community/cli#2205

@jvaronenka jvaronenka closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2024
@cortinico
Copy link
Contributor

Yup this will be fixed in the upcoming patch of 0.73

@cortinico cortinico added Resolution: Fixed A PR that fixes this issue has been merged. and removed Needs: Triage 🔍 Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Attention Issues where the author has responded to feedback. labels Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android Android applications. Resolution: Fixed A PR that fixes this issue has been merged.
Projects
None yet
Development

No branches or pull requests

2 participants