androidfluttercross-platformflutter-plugin

Android dependency not issue in Flutter Plugin


I am creating a flutter pluggin for a native sdk.

So I added the android dependency in the plugin/android/build.gradle file like this

android {
    if (project.android.hasProperty("namespace")) {
        namespace = "com.xxxxxxx.xxxxxx_sdk"
    }

    compileSdk = 34

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdk = 21
    }

    dependencies {
        testImplementation("junit:junit:4.13.2")
        testImplementation("org.mockito:mockito-core:5.0.0")

        implementation 'com.xxxxxx:xxxxx-xxx:x.x.x' // The dependency
    }

    testOptions {
        unitTests.all {
            testLogging {
               events "passed", "skipped", "failed", "standardOut", "standardError"
               outputs.upToDateWhen {false}
               showStandardStreams = true
            }
        }
    }
}

but not able to build when I tried to access the added dependency,


Solution

  • I was able to solve this issue by opening the example/android folder in the Android Studio