Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on run Android #1

Closed
Driaan opened this issue Oct 29, 2019 · 1 comment
Closed

Error on run Android #1

Driaan opened this issue Oct 29, 2019 · 1 comment

Comments

@Driaan
Copy link

Driaan commented Oct 29, 2019

Hi I recieve the following error log when I try running the version 0.1.0 on my android app.

  • Error running Gradle:
    ProcessException: Process exited abnormally:

Configure project :app
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where:
    Build file 'C:\Users[redacted]\Downloads\flutter_windows_v1.10.5-dev\flutter.pub-cache\hosted\pub.dartlang.org\christian_picker_image-0.1.0\android\build.gradle' line: 20

  • What went wrong:
    A problem occurred evaluating project ':christian_picker_image'.

Could not get unknown property 'kotlin_version' for 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.
    ==============================================================================

2: Task failed with an exception.

  • Where:
    Script 'C:\Users[redacted]\Downloads\flutter_windows_v1.10.5-dev\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 320

  • What went wrong:
    A problem occurred configuring project ':christian_picker_image'.

Could not get unknown property 'android' for project ':christian_picker_image' of type org.gradle.api.Project.

  • 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

BUILD FAILED in 3s
Command: C:\Users[redacted]\Documents[redacted][redacted]\android\gradlew.bat app:properties

@diepnghitinh
Copy link
Owner

diepnghitinh commented Nov 19, 2019

You can consult my build.gradle
android/build.gradle

buildscript {
    ext.kotlin_version = '1.3.0'
    ext.supportLibraryVersion = '26.1.0'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath 'com.google.gms:google-services:4.3.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

android/app/src/build.gradle

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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties()
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.test.app"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode = 16
        versionName '1.0.5'
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
        }
    }

    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.release
            //signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == "com.android.support") {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion "26.+"
            }
        }
    }
}

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.android.support:support-v4:28.0.0-rc01'
    implementation 'com.android.support:support-annotations:28.0.0'
    implementation ('com.google.firebase:firebase-messaging:17.6.0') {
        exclude group: 'com.android.support'
    }
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'org.jetbrains.kotlin:kotlin-reflect:1.1.51'
}
apply plugin: 'com.google.gms.google-services'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants