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

Build failed with an exception #817

Open
liuzhoou opened this issue Dec 4, 2023 · 0 comments
Open

Build failed with an exception #817

liuzhoou opened this issue Dec 4, 2023 · 0 comments

Comments

@liuzhoou
Copy link

liuzhoou commented Dec 4, 2023

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-amap3d'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
   > Namespace not specified. Please specify a namespace in the module's build.gradle file like so:

     android {
         namespace 'com.example.namespace'
     }

     If the package attribute is specified in the source AndroidManifest.xml, it can be migrated automatically to the namespace value in the build.gradle file using the AGP Upgrade Assistant; please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s
error Failed to install the app.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-amap3d/lib/android/build.gradle b/node_modules/react-native-amap3d/lib/android/build.gradle
index a6e84de..056e27b 100644
--- a/node_modules/react-native-amap3d/lib/android/build.gradle
+++ b/node_modules/react-native-amap3d/lib/android/build.gradle
@@ -18,6 +18,7 @@ buildscript {
 }
 
 android {
+    namespace 'qiuxiang.amap3d'
     compileSdkVersion getExt('compileSdkVersion', 33)
     buildToolsVersion getExt('buildToolsVersion', '33.0.0')
 

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant