avioli / uni_links

Flutter plugin for accepting incoming links.
BSD 2-Clause "Simplified" License
563 stars 303 forks source link

Namespace not specified. Specify a namespace in the module's build file #187

Closed MrCsabaToth closed 5 months ago

MrCsabaToth commented 1 year ago

Describe the bug After trying to upgrade my Flutter app's Android port to AGP v8.0+ I get an error message:

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

I depend on uni_links 0.5.1 in my app. I just tried to upgrade the Android side of the Flutter app to AGP 8.0+ (to be precise it's AGP 8.1 now), because Android Studio brings up the upgrade assistant for the last half year about this. The upgrade fails because some of the plugins don't have the namespace in their build.gradle. On of the failing plugins is the uni_links.

To Reproduce Steps to reproduce the behavior:

  1. Have a Flutter app with Android port and AGP 7.4 (or any AGP version below 8.0)
  2. Open the Android folder of the project with Android Studio
  3. The AGP upgrade assistant will pop up
  4. Let the AGP upgrading assistant try the upgrade and it gonna fail

Expected behavior I'd be able to upgrade to AGP 8.0+.

Smartphone (please complete the following information):

Additional context The way Flutter Community projects solve this is adding a conditional clause to the build.gradle:

android {
    // Conditional for compatibility with AGP <4.2.
    if (project.android.hasProperty("namespace")) {
        namespace 'name.avioli.unilinks'
    }

    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 16
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    lintOptions {
        disable 'InvalidPackage'
    }
}
MrCsabaToth commented 1 year ago

Do you need a PR?

MrCsabaToth commented 1 year ago

There's the PR

victorien-a commented 8 months ago

Here is to get it to work until PR is merged:

uni_links: git: url: https://github.com/DanMossa/uni_links.git path: uni_links/

avioli commented 5 months ago

This package is now marked as discontinued and app_links recommended replacement.