fluttercandies / flutter_image_compress

flutter image compress
MIT License
632 stars 215 forks source link

[Bug report] Namespace is not specified. (A problem occurred configuring project ':flutter_image_compress_common'.) #265

Closed Vikrant758 closed 5 months ago

Vikrant758 commented 10 months ago

Version

2.0.4

Platforms

Android

Device Model

Nokia 7.2

flutter info

[✓] Flutter (Channel stable, 3.13.6, on macOS 12.6.7 21G651 darwin-x64, locale en-GB)
    • Flutter version 3.13.6 on channel stable at /Users/vikrantpatil/development/flutter_3.13.4
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ead455963c (3 weeks ago), 2023-09-26 18:28:17 -0700
    • Engine revision a794cf2681
    • Dart version 3.1.3
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/vikrantpatil/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.83.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • Nokia 7 2 (mobile)       • 192.168.0.104:5555                       • android-arm64 • Android 11 (API 30)
    • Kishor's iPhone (mobile) • 4e1b3c862ea0f79e0080ddb36f2bf3b3d0873629 • ios           • iOS 16.7.1 20H30
    • macOS (desktop)          • macos                                    • darwin-x64    • macOS 12.6.7 21G651 darwin-x64
    ! Error: Kishor's iPhone is busy: Loading metadata for the watch via Kishor's iPhone. Xcode will continue when Kishor's iPhone is finished. (code -10)
    ! Error: (null) needs to connect to determine its availability. Check the connection between the device and its companion iPhone, and the connection between the iPhone
      and Xcode. Both devices may also need to be restarted and unlocked. (code 1)

[✓] Network resources
    • All expected network resources are available.

How to reproduce?

I am adding flutter module in android native application.

In flutter module I have added flutter_image_compress package but when I try to build in native android application it is giving me following error.

I have not written any code and I have just added flutter_image_compress package in pubspec.yaml and then tried build the native android applicaiton.

When i remove flutter_image_compress it is working fine.

Logs

A problem occurred configuring project ':flutter_image_compress_common'.
> 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.

Example code (optional)

No code written only added flutter_image_compress in pubspec.yaml.

Contact

vikrantp758@gmail.com

raspberry-jenshen commented 10 months ago

Same here

The lib owner should add this to the gradle file

android {
  // Conditional for compatibility with AGP <4.2.
  if (project.android.hasProperty("namespace")) {
    namespace 'io.flutter.plugins.firebase.messaging'
  }

With a different namespace of course :)

Vikrant758 commented 10 months ago

@raspberry-jenshen I guess They have added it but not published yet.

Screenshot 2023-10-19 at 6 54 22 PM