user9061274
user9061274

Reputation: 3

android studio test app can't open

  1. The event log just remind me that message :

    Executing tasks: [:app:assembleDebug]

    Gradle build finished in 1s 45ms

I think it's my gradle setting has problem but i can't solve it. Here is my build.gradle's

context:

        apply plugin: 'com.android.application'
        apply plugin: 'kotlin-android'
        apply plugin: 'kotlin-android-extensions'

        android {
            compileSdkVersion 27
            buildToolsVersion '27.0.3'
            aaptOptions.cruncherEnabled = false
            aaptOptions.useNewCruncher = false
        defaultConfig {
            applicationId "skill573.myapplication"
            minSdkVersion 26
            targetSdkVersion 27
            versionCode 1
            versionName "1.0"                                      
            testInstrumentationRunner
            "android.support.test.runner.AndroidJUnitRunner"
            }
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

        dependencies {
            implementation fileTree(include: ['*.jar'], dir: 'libs')
            implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
            implementation 'com.android.support:appcompat-v7:27.1.1'
            implementation 'com.android.support.constraint:constraint-layout:1.1.0'
            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'
        }

and the top level gradle code:

            buildscript {
                ext.kotlin_version = '1.2.30'
                repositories {
                    google()
                    jcenter()
                }
                dependencies {
                    classpath 'com.android.tools.build:gradle:3.1.2'
                    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
                }
            }
            allprojects {
                repositories {
                    google()
                    jcenter()
                }
            }
            task clean(type: Delete) {
                delete rootProject.buildDir
            }

Upvotes: 0

Views: 78

Answers (1)

Anjani kumar joshi
Anjani kumar joshi

Reputation: 373

match according to this files hope its work fine. 

 1.  build.gradel

    `apply plugin: 'com.android.application'
android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "test.com.test"
        minSdkVersion 23
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
`

 2. Top-level build file
  ` buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2' 
    }
}
allprojects {
    repositories {
        google()
        jcenter()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}
`

Upvotes: 2

Related Questions