1

i try to implementation an android external library in flutter plugin let's called myPlugin. But i have no idea how to build build.gradle which has implementation of external library. i tried run main project that depend on myplugin. but still i cannot call any api of external library here's myplugin build.gradle :

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
    }
}

rootProject.allprojects {
    repositories {
        google()
        jcenter()
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion 27

    defaultConfig {
        minSdkVersion 16
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    lintOptions {
        disable 'InvalidPackage'
    }
}
dependencies {
    implementation 'com.android.support:support-v4:26.1.0'
}

when i try to import android.support.v4...ActivityCompat, it's called cannot resolve symbol. please tell me how to do the right way. thanks

2 Answers 2

6

There are 2 build.gradle files.

  • The one in your android folder is the project-level build.gradle. You usually do not edit it.
  • The one in your android/app folder is the app/module-level build.gradle. Place your dependencies in this file.
Sign up to request clarification or add additional context in comments.

1 Comment

ok. it usually for android studio native framework. Thanks for advice
-2

Thanks. i solve it .

Open in android studio Project/android and wrapping with gradle.

thanks

1 Comment

??? what does this mean.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.