android - 为什么我无法在 android studio 3.1.0 中构建?

标签 android android-gradle-plugin google-play-services

每当我尝试构建它时,我都会陷入这个奇怪的问题,说无法解决 发挥国家服务和共同 enter image description here

应用插件:'com.android.application' 应用插件:'io.fabric'

安卓{ useLibrary 'org.apache.http.legacy' compileSdk版本27 buildToolsVersion '27.0.3'

defaultConfig {
    applicationId "com.a2l.paladin"
    minSdkVersion 17
    targetSdkVersion 27
    versionCode 40
    versionName "7.0.3"
    multiDexEnabled true
    vectorDrawables.useSupportLibrary = true
}

signingConfigs {
    release {
        v2SigningEnabled false
    }
}

dexOptions {
    javaMaxHeapSize "4g"
}

packagingOptions {
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
}

buildTypes {
    debug {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
   'proguard-rules.pro'
    }

    release {
        lintOptions {
            disable 'MissingTranslation'
            checkReleaseBuilds false
            abortOnError false
        }
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
   'proguard-rules.pro'
    }
  }

repositories {
    flatDir {
        dirs 'libs'
    }
 }

splits {
    abi {
        enable true
        reset()
        include 'x86', 'armeabi', 'armeabi-v7a'
        universalApk true
    }
}

  project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 
 'mips': 5, 'mips64': 6, 'x86': 8, 'x86_64': 9]

  android.applicationVariants.all { variant ->
    variant.outputs.each { output ->
        output.versionCodeOverride =
                project.ext.versionCodes.get(output.getFilter(
                        com.android.build.OutputFile.ABI), 0) * 10000000 + 
   android.defaultConfig.versionCode
    }
  }
  }

 repositories {
 maven { url "https://jitpack.io" }
 maven { url "https://github.com/QuickBlox/quickblox-android-sdk- 
releases/raw/master/" }
//maven { url 'http://maven.stickerpipe.com/artifactory/stickerfactory' } QB 
Sticker repo
maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
maven { url 'https://maven.fabric.io/public' }
 }

dependencies {
  implementation fileTree(include: ['*.jar'], dir: 'libs')

// For analytics
// For push notification
// For crash reporting on Firebase
// For Dynamic Linking & App Invites
implementation 'com.quickblox:quickblox-android-sdk-chat:3.2.0'
implementation 'com.quickblox:quickblox-android-sdk-content:3.2.0'
implementation 'com.quickblox:quickblox-android-sdk-core:3.2.0'
implementation 'com.quickblox:quickblox-android-sdk-messages:3.2.0'
implementation 'com.facebook.android:facebook-android-sdk:4.6.0'
implementation 'com.google.android.gms:play-services-base:15.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'
implementation 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-crash:15.0.2'
implementation 'com.google.firebase:firebase-invites:15.0.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:support-compat:27.1.1'
implementation 'com.stripe:stripe-android:1.0.5'
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.nostra13.universalimageloader:universal-image- 
 loader:1.9.5'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.github.recruit-lifestyle:WaveSwipeRefreshLayout:1.6'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.3.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.android.gms:play-services-analytics:15.0.2'
implementation 'com.thoughtbot:expandablerecyclerview:1.3'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'io.github.memfis19:annca:0.3.7'
implementation 'com.github.traex.calendarlistview:library:1.2.3'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
/*compile group: 'com.zendesk', name: 'support', version: '2.0.0'*/
implementation group: 'com.zendesk', name: 'sdk', version: '1.11.0.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.2'

/*Acuant Mobile sdk  */
implementation project(':acuantMobileSDK')
implementation 'com.microblink:pdf417.mobi:6.4.0@aar'
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'org.jmrtd:jmrtd:0.5.6'
implementation 'org.ejbca.cvc:cert-cvc:1.4.3'
implementation 'com.madgag.spongycastle:prov:1.54.0.0'
implementation 'net.sf.scuba:scuba-sc-android:0.0.9'
/*Acuant Mobile sdk  */

}

apply plugin: 'com.google.gms.google-services'

我做错了什么?如何解决这个问题?

最佳答案

将 Google Maven 存储库作为第一个条目添加到您的 build.gradle:

一个。在构建依赖部分:

buildscript {    
    repositories {
        google()
        // your other repos
    }
    // ...
}

在模块部分:

allprojects {
    repositories {
        google()
        // your other repos
    }
}

关于android - 为什么我无法在 android studio 3.1.0 中构建?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50564314/

相关文章:

android - 为 Firebase RecyclerView 添加触摸监听器

java - Android Studio 中的错误 - 无法从静态上下文引用非静态方法

minSdkVersion ="10"时Android白图不白

android - 模块根文件夹中缺少文件 google-services.json。没有它,Google Quickstart 插件将无法运行

android - Google PlaceDetectionClient 与 FusedLocationProviderClient

android - 如何修改和重新发布 AOSP 应用程序?

android - google-services.json 文件已添加,但模块根文件夹中缺少 : File google-services. json 错误

Android 数据绑定(bind)编译警告 : Method references using '.' is deprecated

android - 如何使用 gradle 维护位于个人服务器上的依赖项

android - Google 登录失败 : The Google Play services resources were not found. 检查您的项目配置以确保包含资源