How use native libraries in flutter?

11,459

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.

Share:
11,459

Related videos on Youtube

Mysterious_android
Author by

Mysterious_android

Just an Android Developer, hope to help with react-native, Xamarin etc..

Updated on June 04, 2022

Comments

  • Mysterious_android
    Mysterious_android almost 2 years

    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.

    • Mysterious_android
      Mysterious_android over 5 years
      Yes but the question is "How to use native libraries in flutter".
  • Mysterious_android
    Mysterious_android almost 6 years
    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 ?
  • Serl
    Serl almost 6 years
    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.