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

wrong warnings while running pod install #34247

Closed
matinzd opened this issue Jul 22, 2022 · 11 comments
Closed

wrong warnings while running pod install #34247

matinzd opened this issue Jul 22, 2022 · 11 comments
Labels
💻CLI Platform: iOS iOS applications. Resolution: PR Submitted A pull request with a fix has been provided.

Comments

@matinzd
Copy link
Contributor

matinzd commented Jul 22, 2022

Description

While running pod install on 0.69.2 there are many unrelated warnings from android in the console:

warn Invalid application's package name "com.ismaeld.RNBuildConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.RNAppleAuthentication" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.lugg.ReactNativeConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.learnium.RNDeviceInfo" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.dooboolab.RNIap" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.BV.LinearGradient" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.ismaeld.RNBuildConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.RNAppleAuthentication" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.lugg.ReactNativeConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.learnium.RNDeviceInfo" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.dooboolab.RNIap" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.BV.LinearGradient" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id

Version

0.69.2

Output of npx react-native info

System:
OS: macOS 12.4
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 45.41 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
Yarn: 1.22.18 - ~/w/dietdoctor/rnapp/node_modules/.bin/yarn
npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
Watchman: 2022.05.16.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /Users/matin/.rvm/gems/ruby-3.0.2/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
API Levels: 28, 29, 30, 31
Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0, 31.0.0
System Images: android-27 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play ARM 64 v8a, android-30 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom_64, android-31 | Google APIs Intel x86 Atom_64, android-S | Google Play Intel x86 Atom_64
Android NDK: 23.0.7344513-beta4
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.10 - /usr/local/opt/openjdk@11/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.2 => 0.69.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  • Run pod install

Snack, code example, screenshot, or link to a repository

https://github.com/matinzd/rn692falsewarnings

@cortinico
Copy link
Contributor

https://github.com/facebook/react-native/tree/main/template

Sorry, but this is not a valid reproducer.
I can't see how the template could import those packages which are coming from external dependencies (like com.ismaeld.RNBuildConfig).

Also is confusing that you mention this is happening during a pod install while those are Android related messages 🤔

Could you provide a valid repro, like a blank project with 1 dependency added that creates this problem?

@cortinico cortinico added the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Jul 22, 2022
@github-actions
Copy link

⚠️ Missing Reproducible Example
ℹ️ It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.

@matinzd
Copy link
Contributor Author

matinzd commented Jul 22, 2022

https://github.com/facebook/react-native/tree/main/template

Sorry, but this is not a valid reproducer. I can't see how the template could import those packages which are coming from external dependencies (like com.ismaeld.RNBuildConfig).

Also is confusing that you mention this is happening during a pod install while those are Android related messages 🤔

Could you provide a valid repro, like a blank project with 1 dependency added that creates this problem?

Hey Nicola,
I will provide a repo as soon as possible.
Yeah, that’s why I opened this issue! When I run pod install these messages regarding android will come up!

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jul 22, 2022
@cortinico cortinico added Needs: Author Feedback and removed Needs: Attention Issues where the author has responded to feedback. labels Jul 22, 2022
@matinzd
Copy link
Contributor Author

matinzd commented Jul 22, 2022

https://github.com/matinzd/rn692falsewarnings

Here you are @cortinico

Screen.Recording.2022-07-22.at.18.58.00.mov

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jul 22, 2022
@brascene
Copy link

brascene commented Jul 27, 2022

I'm also currently trying to upgrade to RN0.69 and after running pod install I saw these warnings for Android manifest file, so weird 😄
Any updates on this?

@mlazari
Copy link
Contributor

mlazari commented Jul 28, 2022

The error message comes from here: https://github.com/react-native-community/cli/blob/be8790f7545498ba3974fd32b9e2eeddbf7b883d/packages/cli-platform-android/src/config/getAndroidProject.ts#L39

It looks like that code reads package name from AndroidManifest.xml and passes it to a validation function. That function does not allow uppercase letters. However both the package name (https://developer.android.com/guide/topics/manifest/manifest-element.html#package) and the application id (https://developer.android.com/studio/build/application-id) are allowed to contain upper case letters.

Screenshot 2022-07-28 at 14 29 33
Screenshot 2022-07-28 at 14 29 58

It's strange though that this validation is done during pod install...

@mlazari
Copy link
Contributor

mlazari commented Jul 28, 2022

It happens on pod install because here finalConfig.platforms contains both ios and android, so it loads the config for both platforms:
https://github.com/react-native-community/cli/blob/be8790f7545498ba3974fd32b9e2eeddbf7b883d/packages/cli-config/src/loadConfig.ts#L34

mlazari added a commit to mlazari/cli that referenced this issue Jul 28, 2022
Currently `validatePackageName` fails for package names containing uppercase letters. A message like this is shown during pod install:
```
warn Invalid application's package name "com.lugg.ReactNativeConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.BV.LinearGradient" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.lugg.ReactNativeConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.BV.LinearGradient" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
```
 However both the package name (https://developer.android.com/guide/topics/manifest/manifest-element.html#package) and the application id (https://developer.android.com/studio/build/application-id) are allowed to contain upper case letters.

This change adds the "i" flag to the regex to ignore case when validating package name.

Related issue: facebook/react-native#34247
@mlazari
Copy link
Contributor

mlazari commented Jul 28, 2022

PR for fixing the validation function: react-native-community/cli#1660

@matinzd
Copy link
Contributor Author

matinzd commented Jul 28, 2022

Thanks @mlazari for the PR! I will close the issue as soon as it got merged and cli updated in main react-native repo!

thymikee pushed a commit to react-native-community/cli that referenced this issue Jul 28, 2022
* Ignore case in validatePackageName

Currently `validatePackageName` fails for package names containing uppercase letters. A message like this is shown during pod install:
```
warn Invalid application's package name "com.lugg.ReactNativeConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.BV.LinearGradient" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.lugg.ReactNativeConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.BV.LinearGradient" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
```
 However both the package name (https://developer.android.com/guide/topics/manifest/manifest-element.html#package) and the application id (https://developer.android.com/studio/build/application-id) are allowed to contain upper case letters.

This change adds the "i" flag to the regex to ignore case when validating package name.

Related issue: facebook/react-native#34247

* Add tests for validatePackageName
thymikee pushed a commit to react-native-community/cli that referenced this issue Jul 28, 2022
* Ignore case in validatePackageName

Currently `validatePackageName` fails for package names containing uppercase letters. A message like this is shown during pod install:
```
warn Invalid application's package name "com.lugg.ReactNativeConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.BV.LinearGradient" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.lugg.ReactNativeConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
warn Invalid application's package name "com.BV.LinearGradient" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id
```
 However both the package name (https://developer.android.com/guide/topics/manifest/manifest-element.html#package) and the application id (https://developer.android.com/studio/build/application-id) are allowed to contain upper case letters.

This change adds the "i" flag to the regex to ignore case when validating package name.

Related issue: facebook/react-native#34247

* Add tests for validatePackageName
@cortinico
Copy link
Contributor

I will close the issue as soon as it got merged and cli updated in main react-native repo!

Thanks for the report @matinzd and thanks for following up on the CLI. I'm glad this got sorted out and solved. I'm closing it now as we're trying to reduce the # of opened issues we have, specifically if they involve other tools (such as the CLI).

@cortinico cortinico added Platform: iOS iOS applications. Resolution: PR Submitted A pull request with a fix has been provided. 💻CLI 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 Jul 29, 2022
@matinzd
Copy link
Contributor Author

matinzd commented Jul 29, 2022

I will close the issue as soon as it got merged and cli updated in main react-native repo!

Thanks for the report @matinzd and thanks for following up on the CLI. I'm glad this got sorted out and solved. I'm closing it now as we're trying to reduce the # of opened issues we have, specifically if they involve other tools (such as the CLI).

You are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻CLI Platform: iOS iOS applications. Resolution: PR Submitted A pull request with a fix has been provided.
Projects
None yet
Development

No branches or pull requests

4 participants