-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Namespace not specified #38660
Comments
|
Can you please share:
Plus having a repro would help |
android/app/buid.gradle :
|
Please share the missing things I asked. Plus the file I asked for is |
@cortinico updated the file , please review it |
The issue is caused by one of your dependency. Sadly it's impossible to say which one, as I see you have I suspect the issue will be fixed once you bump the version of those dependencies: Closing for now as this is not an issue in React Native itself |
@cortinico thank you for your help |
Hi, I managed to solve this error by including the namespace in the dependencies that caused the errors. I located them from my node modules, navigated to the build.gradle file of each dependency in the android directory, and then added the namespace under the android block. ### Below is the exact solution I applied to this error for the react-native-splash-screen dependency. def safeExtGet(prop, fallback) { apply plugin: 'com.android.library' def DEFAULT_COMPILE_SDK_VERSION = 26 android {
} dependencies {
} I hope this helps someone solve this problem. If it does, that will be awesome. |
The presentation above depicts a rookie's mistake, but I want to direct your attention to the lines below, android {
} |
Make sure to replace "com.example.app" with the package name from each dependency's AndroidManifest.xml file which you should find in the "../android/src/main/AndroidManifest.xml" path. For example, if the package name from AndroidManifest.xml is "com.sortnumbers.mathsapp", then in the dependency's build.gradle file, inside the android scope, make sure you've indicated this exactly. android { |
@cortinico By any chance is there any workaround for this issue if third-party dependencies are not having that namespace defined in their respective build gradle files? For react native 0.73+ AGP 8+ is required and that enforces all the libraries to have namespace: react-native-community/discussions-and-proposals#671 Currently, upgrading to 0.73+ is a bit challenging because that namespace required build error is expected. Not only in this single third-party library, but build throws an error in other libraries as well. For e.g Manually adding namespace in gradle file of each dependencies resolves this issue, somehow this can be a patch package for few depdencies until there's an update available, but that's not feasible when application has multiple dependencies Even following workaround is also not working. Any workaround is highly appreciated on this issue. Thank you!
|
Why is it not feasible with multiple dependencies? Other than this, there is nothing much we can do. We communicated this change long ago exactly to avoid scenarios like this. If you're depending on old/unmaintained libraries, I would advice to consider moving away from those dependencies. |
Description
I specified namespace in android>app>build.gradle , still this error is occurring ! Anyone can please help how to resolve this !
android {
ndkVersion rootProject.ext.ndk
}
React Native Version
0.72.3
Output of
npx react-native info
Steps to reproduce
when i build app in android studio Flamingo
Snack, screenshot, or link to a repository
The text was updated successfully, but these errors were encountered: