How to use Gradle to add JAR library for Flutter project?

29 views Asked by At

When i try to use Gradle to add JAR library for my Flutter project, i got this tip enter image description here but click is unuseful, no things would be changed.

Gradle version: 7.6.3 FLutter version: 3.19

my dependencies: Android -> bulid.gradle.kts

// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

plugins {
    `java-gradle-plugin`
    `groovy`
}


group = "dev.flutter.plugin"
version = "1.0.0"

gradlePlugin {
    plugins {
        // The "flutterPlugin" name isn't used anywhere.
        create("flutterPlugin") {
            id = "dev.flutter.flutter-gradle-plugin"
            implementationClass = "FlutterPlugin"
        }
        // The "flutterAppPluginLoaderPlugin" name isn't used anywhere.
        create("flutterAppPluginLoaderPlugin") {
            id = "dev.flutter.flutter-plugin-loader"
            implementationClass = "FlutterAppPluginLoaderPlugin"
        }
    }
}

configurations {
    all{
        exclude (group = "xpp3",module = "xpp3")
    }
    all{
        exclude(group = "xpp3", module = "xpp3_min")
    }
}

dependencies {
    // When bumping, also update:
    //  * ndkVersion in FlutterExtension in packages/flutter_tools/gradle/src/main/flutter.groovy
    //  * AGP version constants in packages/flutter_tools/lib/src/android/gradle_utils.dart
    //  * AGP version in buildscript block in packages/flutter_tools/gradle/src/main/flutter.groovy
    compileOnly ("com.android.tools.build:gradle:8.0.0")
    api ("org.igniterealtime.smack:smack-android-extensions:4.4.6")
    api ("org.igniterealtime.smack:smack-tcp:4.4.6")
}

I try to add libraries by Project Sittting->Libraries for my Flutter project, it's unuseful too, although this JAR library in the External LIbraries.

1

There are 1 answers

1
Liu On

i maybe know the reason,because of my foolish.i should add the dependencies in the bulid.gradle(Module:app),but not the bulid.gradle.kts(Include bulid: gradle).