react-native-clipboard / clipboard

React Native Clipboard API for both iOS and Android.
MIT License
668 stars 117 forks source link

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

Open tapz opened 10 months ago

tapz commented 10 months ago

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

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

sten-nico commented 10 months ago

I got the same issue :(

tapz commented 10 months ago

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

Kinqdos commented 8 months ago

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

Aymkdn commented 7 months ago

Same issue here. Any solution?

grant-devon commented 6 months ago

I have the same issue

littlefrogyq commented 3 months ago

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 commented 2 months ago

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.