简体   繁体   English

配置项目':app'时出现Android 3.1 build gradle 4.4错误

[英]Android 3.1 build gradle 4.4 error occurred configuring project ':app'

When i build app to android studio 3.1 with emulator api<26 not error, but when i build api>26 error. 当我构建应用程序到Android工作室3.1与模拟器api <26没有错误,但当我构建api> 26错误。 i have not to use kotlin because not import kotlin,but build api>26 error. 我没有使用kotlin因为没有导入kotlin,但是构建api> 26错误。 > kotlin.KotlinNullPointerException (no error message) . > kotlin.KotlinNullPointerException(无错误消息)

com.android.build.gradle.tasks.ir.InstantRunMainApkResourcesBuilder$ConfigAction.execute(InstantRunMainApkResourcesBuilder.kt:129) com.android.build.gradle.tasks.ir.InstantRunMainApkResourcesBuilder $ ConfigAction.execute(InstantRunMainApkResourcesBuilder.kt:129)

Build gradle: 建立gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "vn.top12.app"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled = true
        // blur
        renderscriptTargetApi 18
        renderscriptSupportModeEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    signingConfigs {
        release {
            keyAlias "top12vn"
            keyPassword "top12vn"
            storeFile file('key_store/top12_released_key.keystore')
            storePassword "top12vn"

        }
        debug {
            keyAlias "top12vn"
            keyPassword "top12vn"
            storeFile file('key_store/top12_released_key.keystore')
            storePassword "top12vn"
        }
    }
    lintOptions {
        checkReleaseBuilds true
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
    buildToolsVersion '27.0.3'

}
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    //them multiDexEnabled = true
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:recyclerview-v7:27.1.0'
    implementation 'com.android.support:design:27.1.0'
    // butter knife.
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    // gson.
    implementation 'com.google.code.gson:gson:2.8.2'
    // image loading.
    implementation 'com.github.bumptech.glide:glide:4.6.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
    //    com.squareup.retrofit2
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
    //com.squareup.okhttp3
    implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
    implementation 'com.squareup.okhttp3:okhttp:3.9.1'
    //    reactive
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.8'
    // keyboard keyboardvisibilityevent
    implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.1.0'
    // com.google.firebase.
    implementation 'com.google.firebase:firebase-messaging:12.0.1'
    // Cloud Messaging
    implementation 'com.google.firebase:firebase-core:12.0.1'
    //Analytics
    implementation 'com.google.firebase:firebase-invites:12.0.1'
    //Invites and Dynamic Links
    // ViewModel and LiveData
    implementation 'android.arch.lifecycle:extensions:1.1.1'
    //room Save data in a local database using Room
    implementation 'android.arch.persistence.room:runtime:1.0.0'
    annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
    //push onesignal
    //  implementation 'com.onesignal:OneSignal:3.7.1'
    //gmc
    implementation 'com.google.android.gms:play-services-gcm:12.0.1'
    //exoplayer-textureview
    implementation 'com.google.android.exoplayer:exoplayer:2.7.0'
}

// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'

Build gradle app: 构建gradle app:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
        mavenCentral()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services:3.1.1'
        // google-services plugin


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()

    }
}

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

Not a permanent solution, but to get instant run working again, downgrade your project gradle to 这不是一个永久的解决方案,但为了让您的项目再次降级,请将您的项目降级为

classpath 'com.android.tools.build:gradle:3.0.1' (instead of 3.1.0) and in your app/build.gradle, downgrade buildTools: buildToolsVersion '27.0.0' (instead of 27.0.3) classpath'com.android.tools.build:gradle:3.0.1'(而不是3.1.0)并在你的app / build.gradle中,降级buildTools:buildToolsVersion '27 .0.0'(而不是27.0.3)

This will allow you to use instant run again. 这将允许您再次使用即时运行。 hopefully they will fix the issue with 3.1.0 & 27.0.3 in a future release... 希望他们能在未来的版本中修复3.1.0和27.0.3的问题......

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter:gradle 构建失败,错误为“评估根项目 &#39;android&#39; 时出现问题 &gt; 配置项目 &#39;:app&#39; 时出现问题。” - Flutter:gradle build failed with error "A problem occurred evaluating root project 'android' > A problem occurred configuring project ':app'." 错误:发生配置项目“:app”。 安卓应用 - Error:A occurred configuring project ':app'. Android app Android - 错误:配置项目“:app”时发生问题 - Android - Error:A prblem occurred configuring project ':app' 如何修复 gradle 构建错误配置根项目时出现问题? - How to fix gradle build error A problem occurred configuring root project? 离子构建错误:发生配置根项目“Android” - Ionic Build Error: occurred configuring root project 'Android' tns 运行 android 产生错误:配置根项目“核心”时出现问题。 >未指定 compileSdkVersion。 请加到build.gradle - tns run android produces error: A problem occurred configuring root project 'core'. >compileSdkVersion is not specified. Please add it to build.gradle 配置项目时出错:app in development android app using gradle build tools - An error occurs configuring project:app in developing android app using gradle build tools Flutter Android Build Gradle 配置根项目“android”时出错? - Flutter Android Build Gradle error configuring root project 'android'? Build.Gradle 错误 - 评估项目“:app”时出现问题 - Build.Gradle Error - A problem occurred evaluating project ':app' 配置项目 ':app' (org.gradle.api.ProjectConfigurationException) 时发生错误并且还发现错误 ASCII - Error occurred when configuring project ':app' (org.gradle.api.ProjectConfigurationException) and ERROR ASCII also found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM