Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

config fails to load if Android module is named differently than app #2516

Open
TMisiukiewicz opened this issue Sep 27, 2024 · 2 comments · May be fixed by #2524
Open

config fails to load if Android module is named differently than app #2516

TMisiukiewicz opened this issue Sep 27, 2024 · 2 comments · May be fixed by #2524

Comments

@TMisiukiewicz
Copy link
Collaborator

Environment

  OS: macOS 14.6.1
  CPU: (8) arm64 Apple M1 Pro
  Memory: 104.22 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.18.0
    path: ~/.nvm/versions/node/v18.18.0/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 9.8.1
    path: ~/.nvm/versions/node/v18.18.0/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.19072.14.2412.12360217
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 3.3.4
    path: /Users/tomaszmisiukiewicz/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.0-alpha.2
    wanted: 15.0.0-alpha.2
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.0-rc.2
    wanted: 0.76.0-rc.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: false
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Description

I am working on a brownfield integration. When package attribute is not set in AndroidManifest.xml (it's deprecated from AGP 7.3) it takes the namespace value from the module-level build.gradle. However, it cannot access it when the module is named differently than app. In my case, the file is under mastodon/build.gradle, and CLI looking specifically for app/build.gradle.

This leads to an error:

error Failed to build the app: No package name found. We couldn't parse the namespace from neither your build.gradle[.kts] file at null nor your package in the AndroidManifest at /Users/tomaszmisiukiewicz/Documents/projects/mastodon-brownfield/android/mastodon/src/main/AndroidManifest.xml.

Reproducible Demo

  1. Clone https://github.com/TMisiukiewicz/mastodon-brownfield, checkout v-0.76 branch and install packages
  2. Open AndroidManifest.xml and remove package attribute
  3. Run ./node_modules/@react-native-community/cli/build/bin.js config
Copy link

There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.

@github-actions github-actions bot added the stale label Dec 27, 2024
@TMisiukiewicz
Copy link
Collaborator Author

not stale

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant