Arkadaşlar merhaba. Yapmış olduğum flutter projesinin apk’sını almaya çalışıyorum ama aşağıda gördüğünüz hata ile karşılaşıyorum. Bilgisi olan var mıdır acaba
Project evaluation failed including an error in afterEvaluate {}. Run with –stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\src\flutter.pub-cache\hosted\pub.dartlang.org\path_provider-2.0.4\android\build.gradle’ line: 57

  • What went wrong:
    A problem occurred evaluating root project ‘path_provider’.

Could not find method testImplementation() for arguments [junit:junit:4.12] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

  • Try:
    Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output. Run with –scan to get full insights.

  • Get more help at https://help.gradle.org

BUİLD FAILED in 1s

The plugin path_provider could not be built due to the issue above.

sirheracros Build file ‘C:\src\flutter.pub-cache\hosted\pub.dartlang.org\path_provider-2.0.4\android\build.gradle’ line: 57

Şurayı kontrol edebilir misiniz ?

sirheracros Buraya da atabilir misiniz ?
uygulamayı flutter clean yaptınız mı ?
Uygulama debug modda çalışıyor mu ?

Flutter

`def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 30

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.doktorbunapp"
        minSdkVersion 19
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}`

build gradle kısmı bura.
clean yaptım. debug çalışıyor

sirheracros Hata verdiği satır hangisi oluyor ?
Böyle anlaşılmıyorda 🙂
Bu arada uygulamanın android dosyasını android studio ile açıp hatanın detayı görebilirsinz.

Pubspac.yaml dosyanızıda atabilir misiniz

    version: 1.0.0+1

    environment:
    sdk: “>=2.12.0 <3.0.0”

    dependencies:
    flutter:
    sdk: flutter




    webview_flutter: 2.0.10
    url_launcher: 6.0.9
    shared_preferences: 2.0.1
    cached_network_image: 3.1.0
    flutter_html: 2.1.5
    dev_dependencies:
    flutter_test:
    sdk: flutter
    flutter_native_splash: 1.2.3
    flutter_launcher_icons: “0.9.2”

    flutter_icons:
    android: “launcher_icon”
    ios: true
    image_path: “assets/icons/icon.png”

    sirheracros shared_preferences
    shared_preferences: any olarak değiştirir misin

      Write a Reply...