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.
Environment
Description
I am working on a brownfield integration. When
package
attribute is not set inAndroidManifest.xml
(it's deprecated from AGP 7.3) it takes thenamespace
value from the module-levelbuild.gradle
. However, it cannot access it when the module is named differently thanapp
. In my case, the file is undermastodon/build.gradle
, and CLI looking specifically forapp/build.gradle
.This leads to an error:
Reproducible Demo
v-0.76
branch and install packagesAndroidManifest.xml
and removepackage
attribute./node_modules/@react-native-community/cli/build/bin.js config