簡體   English   中英

android studio測試應用無法打開

[英]android studio test app can't open

  1. 事件日志只是提醒我該信息:

    執行任務:[:app:assembleDebug]

    Gradle構建在1秒45毫秒內完成

我認為這是我的gradle設置有問題,但我無法解決。 這是我的build.gradle的

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'
        }

以及最高級的gradle代碼:

            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
            }
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
}
`

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM