2

I want to be able to use a native library for example GLIDE in my flutter android project.

I have included gradle in the folder 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'
    }

However when i run ./gradlew build command it doesn't compile GLIDE, in addition when i go into the java folder android/src/main/java ManActivity.java

i try to type in Glide but it remains unresolved method.

please help.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Mysterious_android
  • 598
  • 2
  • 9
  • 32

1 Answers1

1

As you can see from this question: Calling native libraries in Flutter using Platform Channels you will have to create a new plugin project with the specific library you want. However as @dr3k said you can just use the flutter image widget.

Serl
  • 240
  • 1
  • 14
  • i see, but my main goal is to learn how to add libraries using gradle in flutter. Also should i use the same method in your link if I want to add google's support libraries ? – Mysterious_android Jul 12 '18 at 07:03
  • Most google support libraries already have futter versions of them, so you can just add them to your project as you normaly would any flutter packages/plugins. – Serl Jul 12 '18 at 12:02