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

Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl. Namespace not specified. #201

Open
tapz opened this issue Sep 5, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@tapz
Copy link

tapz commented Sep 5, 2023

Environment

info Fetching system and libraries information...
(node:19293) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
System:
  OS: macOS 13.5.1
  CPU: (12) arm64 Apple M2 Max
  Memory: 28.64 GB / 96.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.17.1
    path: ~/.nvm/versions/node/v18.17.1/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 9.6.7
    path: ~/.nvm/versions/node/v18.17.1/bin/npm
  Watchman:
    version: 2023.08.28.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.1
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10671973
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 20.0.1
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 11.3.7
    wanted: ^11.3.7
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.4
    wanted: 0.72.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Platforms

Android

Versions

  • react-native-netinfo:
  • react-native: 0.72.4
  • react: 18.2.0

Description

2: Task failed with an exception.
-----------
* What went wrong:
Failed to query the value of property 'buildFlowServiceProperty'.
> Could not isolate value org.jetbrains.kotlin.gradle.plugin.statistics.BuildFlowService$Parameters_Decorated@51645e1d of type BuildFlowService.Parameters
   > A problem occurred configuring project ':react-native-clipboard_clipboard'.
      > Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
         > Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.
           
           If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

Reproducible Demo

@tapz tapz added the bug Something isn't working label Sep 5, 2023
@sten-nico
Copy link

I got the same issue :(

@tapz
Copy link
Author

tapz commented Sep 6, 2023

Downgrading to Gradle wrapper 8.2.1 helped. 8.3 does not seem to work with React Native.

@Kinqdos
Copy link

Kinqdos commented Oct 26, 2023

Doesnt works for me. Can someone just add a namespace to the build.gradle?

@Aymkdn
Copy link

Aymkdn commented Dec 4, 2023

Same issue here. Any solution?

@grant-devon
Copy link

I have the same issue

@littlefrogyq
Copy link

littlefrogyq commented Mar 12, 2024

I had the same problem when I import opencv module.
Then I add some code to the build.gradle(opencv) file, and my problem solved:

android {
namespace 'com.example.mytestapp' // added
compileSdk 34
...

@eisodev
Copy link

eisodev commented Apr 16, 2024

This comes up when upgrading Android Gradle Plugin to >= 8.

Updating the package to try to solve this will add two new peerDependencies from 1.14.0:
"react-native-macos": "^0.73.0",
"react-native-windows": "^0.73.0"

Why do I need to install these two when they are not used? I don't develop for windows.
And this change is breaking too, and there is no mentions/docs for the new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants