Android 如何在flatter中使用本机库?

Android 如何在flatter中使用本机库?,android,android-gradle-plugin,flutter,flutter-dependencies,Android,Android Gradle Plugin,Flutter,Flutter Dependencies,我希望能够在我的FlatterAndroid项目中使用本机库,例如GLIDE 我已将gradle包含在android/app/build.gradle文件夹中 dependencies { implementation fileTree(include: '*.aar', dir: 'libs') testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android

我希望能够在我的FlatterAndroid项目中使用本机库,例如GLIDE

我已将gradle包含在android/app/build.gradle文件夹中

dependencies {
        implementation fileTree(include: '*.aar', dir: 'libs')
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.1'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
        implementation 'com.github.bumptech.glide:glide:3.5.2'
    }
但是,当我运行
/gradlew build
命令时,它不会编译GLIDE,此外,当我进入java文件夹android/src/main/java ManActivity.java时

我试着输入Glide,但它仍然没有解决


请帮忙

从这个问题中您可以看到:您必须使用所需的特定库创建一个新的插件项目。然而,正如@dr3k所说,您可以只使用flatter图像小部件。

我明白了,但我的主要目标是学习如何在flatter中使用gradle添加库。如果我想添加谷歌的支持库,我应该在你的链接中使用同样的方法吗?大多数谷歌支持库已经有了更高版本的支持库,所以你可以像添加任何flatter软件包/插件一样将它们添加到你的项目中。是的,但问题是“如何在flatter中使用本机库”。