react-native-community / cli

The React Native Community CLI - command line tools to help you build RN apps
MIT License
2.41k stars 905 forks source link

fix: Use custom app name when getting build.gradle #2524

Open TMisiukiewicz opened 1 month ago

TMisiukiewicz commented 1 month ago

Summary:

It cannot access package name from build.gradle when the module is named differently than app. This PR is fixing it.

Closes #2516

Test Plan:

  1. Init fresh project
  2. Change android/app folder name to android/test
  3. Create react-native.config.js file with the following content:
    module.exports = {
    project: {
    android: {
      appName: 'test',
    },
    },
    };
  4. Run android command and verify the error about missing package name is not thrown

Checklist

cortinico commented 1 month ago

3. Create react-native.config.js file with the following content:

Is this documented somewhere or is it a new config?

szymonrybczak commented 1 month ago

Is this documented somewhere or is it a new config?

If you mean the property appName -- yes it was added a while ago and it's document here.

cortinico commented 1 month ago

Is this documented somewhere or is it a new config?

If you mean the property appName -- yes it was added a while ago and it's document here.

yup that one 👍 thank you

szymonrybczak commented 1 month ago

Let's fix CI failures and it's good to go for me!

szymonrybczak commented 1 week ago

Ah, because of recent package refactors there are some merge conflicts 🥲 @TMisiukiewicz can you take a look? :pray: