无法更新 android studio 3.1:配置冲突:同步项目期间“armeabi-v7a,x86”

2024-04-24

这是我的构建 gradle(应用程序)文件:

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'checkstyle'

def versions = ['appcompat_v7' : '25.1.0',
                'butterknife'  : '8.4.0',
                'leak_canary'  : '1.5',
                'card_view'    : '25.1.0',
                'design'       : '25.1.0',
                'photoview'    : '1.2.4',
                'play_services': '10.0.1']



task checkstyle(type: Checkstyle) {
    configFile file("${project.rootDir}/checkstyle/checkstyle.xml")
    configProperties.checkstyleSuppressionsPath = file("${project.rootDir}/config/quality/checkstyle/suppressions.xml").absolutePath
    // Where is my suppressions file for checkstyle is...
    source 'src'
    include '**/*.java'
    exclude '**/gen/**'
    classpath = files()
}


android {
    compileSdkVersion 25
    buildToolsVersion '27.0.3'
    flavorDimensions "versionCode"

    useLibrary 'org.apache.http.legacy'
    dexOptions {
        // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
        preDexLibraries = preDexEnabled && !travisBuild
    }

    defaultConfig {

        ndk {
            abiFilters 'x86', 'armeabi-v7a'
        }

        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner "android.test.InstrumentationTestRunner"
    }
    signingConfigs {
        release
    }
    buildTypes {
        debug {
            debuggable true
        }
        release {
            //runProguard true
            proguardFile file('android.pro')
            proguardFile getDefaultProguardFile('proguard-android.txt')
            signingConfig signingConfigs.release
        }
    }

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

    // map for the version code


    productFlavors {

        playstore {

        }
        develop {
        }
    }


    lintOptions {
        //I'm too lazy to translate everything
        abortOnError false
    }
    externalNativeBuild {
        ndkBuild {
            path 'src/main/jni/Android.mk'
        }
    }
}

def Properties props = new Properties()
def propFile = new File('signing.properties')
if (propFile.canRead()) {
    props.load(new FileInputStream(propFile))

    if (props != null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
            props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
        android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
        android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
        android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
        android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
    } else {
        println 'signing.properties found but some entries are missing'
        android.buildTypes.release.signingConfig = null
    }
} else {
    println 'signing.properties not found'
    android.buildTypes.release.signingConfig = null
}

buildscript {
    repositories {
        jcenter()
        mavenCentral()

    }
}


dependencies {
    compile project(":tess-two:tess-two")
    compile project(":volley")
    compile project(":real-time-ocr")

    compile 'com.github.barteksc:pdfium-android:1.5.0'
    compile fileTree(dir: 'src/main/libs', include: '*.jar')

    debugCompile "com.squareup.leakcanary:leakcanary-android:${versions.leak_canary}"
    releaseCompile "com.squareup.leakcanary:leakcanary-android-no-op:${versions.leak_canary}"
    compile 'com.viewpagerindicator:library:2.4.1@aar'
    compile "com.commit451:PhotoView:${versions.photoview}"
    compile 'com.google.code.findbugs:jsr305:2.0.2'
    compile "com.google.guava:guava:18.0"
    compile 'de.greenrobot:eventbus:2.4.0'
    compile 'com.nineoldandroids:library:2.4.0'
    compile "com.android.support:design:${versions.design}"
    compile "com.android.support:appcompat-v7:${versions.appcompat_v7}"
    compile 'org.apache.commons:commons-compress:1.5'
    compile "com.android.support:cardview-v7:${versions.card_view}"
    compile 'com.google.code.gson:gson:2.8.2'
    compile "com.jakewharton:butterknife:${versions.butterknife}"
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
    compile 'com.google.android.gms:play-services-vision:9.4.0+'
    compile group: 'com.facebook.android', name: 'facebook-android-sdk', version: '4.25.0'



    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.0'
    androidTestCompile 'com.google.dexmaker:dexmaker:1.0'
    androidTestCompile 'org.mockito:mockito-core:1.10.17'
    androidTestCompile 'junit:junit:4.12'


    testCompile 'junit:junit:4.12'
    testCompile "org.mockito:mockito-all:1.10.19"
    testCompile("org.robolectric:robolectric:3.0-rc2") {
        exclude group: 'commons-logging', module: 'commons-logging'
    }
    compile('com.crashlytics.sdk.android:crashlytics:2+') {
        transitive = true;
    }
    compile('com.crashlytics.sdk.android:crashlytics-ndk:1+@aar') {
        transitive = true;
    }


    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.shawnlin:number-picker:2.4.4'
    compile 'com.squareup.picasso:picasso:2.5.2'



}
crashlytics {
    enableNdk true
    androidNdkOut '/Users/renard/devel/textfairy/tess-two/tess-two/obj'
    androidNdkLibsOut '/Users/renard/devel/textfairy/tess-two/tess-two/libs'
}
apply plugin: 'com.google.gms.google-services'

android studio 无法同步项目并出现此错误:

配置冲突:设置分割 abi 过滤器时,ndk abiFilters 中的“armeabi-v7a、x86”不能出现:x86、armeabi-v7a

配置“编译”已过时,已替换为“实现”。 将于2018年底删除

配置“debugCompile”已过时,已替换为“debugImplementation”。 将于2018年底删除

配置“androidTestApi”已过时,已替换为“androidTestImplementation”。 将于2018年底删除

配置“releaseCompile”已过时,已替换为“releaseImplementation”。 将于2018年底删除

配置“testCompile”已过时,已替换为“testImplementation”。 将于2018年底删除

配置“testApi”已过时,已替换为“testImplementation”。 将于2018年底删除

配置“androidTestCompile”已过时,已替换为“androidTestImplementation”。 将于2018年底删除

选项“android.enableAapt2”已弃用,不应再使用。 使用“android.enableAapt2=true”删除此警告。 它将在 2018 年底被删除。

配置“编译”已过时,已替换为“实现”。 将于2018年底删除

选项“android.enableAapt2”已弃用,不应再使用。 使用“android.enableAapt2=true”删除此警告。 它将在 2018 年底被删除。

配置“testCompile”已过时,已替换为“testImplementation”。 将于2018年底删除

配置“testApi”已过时,已替换为“testImplementation”。 将于2018年底删除

选项“android.enableAapt2”已弃用,不应再使用。 使用“android.enableAapt2=true”删除此警告。 它将在 2018 年底被删除。

配置“编译”已过时,已替换为“实现”。 将于2018年底删除

如果我删除这一行

defaultConfig {

    ndk {
        abiFilters 'x86', 'armeabi-v7a'
    }

项目同步成功 但是构建时给我这个错误

执行aapt失败

我已经尝试清理和重建项目,但仍然无法正常工作! 我还发布了 build.gradle (项目)文件

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        mavenCentral()
        jcenter()
        google()
    }
    dependencies {
        classpath 'io.fabric.tools:gradle:1+'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.android.tools.build:gradle:3.1.0'
    }
}



allprojects {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        maven { url "http://dl.bintray.com/populov/maven" }
        jcenter()
        maven {
            url "http://oss.sonatype.org/content/repositories/snapshots"
        }
        maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' }
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
    }

}

ext {
    travisBuild = System.getenv("TRAVIS") == "true"
    // allows for -Dpre-dex=false to be set
    preDexEnabled = "true".equals(System.getProperty("pre-dex", "true"))
}

我的 gradle-wrapper.properties 文件

    #Tue Mar 27 14:42:14 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

和我的 gradle.properties 文件

    ndkDir=/Users/giuliopettenuzzo/Library/Android/sdk/ndk-bundle
org.gradle.jvmargs=-XX\:MaxPermSize\=512m
android.enableAapt2=false

ndk.abiFilters配置意味着只有选定的本机库的处理器架构才会包含在最终的 APK 中。

另一方面,splits.abi.enable true告诉编译器为选定的架构生成单独的 APK。

看来这两个配置不能一起设置。所以你有两个选择:

  1. 禁用拆分 APK(您已经知道了)。这样您就会拥有一个 APK。

  2. Remove ndk.abiFilters环境。您将拥有多个(可能小得多)APK。此外,与universalApk true,将生成一个具有所有架构的通用 APK(可能比选项 1 中的大得多)。

比,替换compile使用新关键字implementation。我认为,这从错误消息中可以清楚地看出。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

无法更新 android studio 3.1:配置冲突:同步项目期间“armeabi-v7a,x86” 的相关文章

  • 为什么 Kotlin 数据类可以在 Gson 的不可空字段中包含空值?

    在 Kotlin 中你可以创建一个data class data class CountriesResponse val count Int val countries List
  • 如何改变android中menuItem的背景颜色?

    我正在以编程方式将菜单项添加到菜单中 我想在选择特定项目时添加背景颜色 如何为 menuItem 添加背景 您的回答将不胜感激 虽然其他答案提供了更改样式 这会影响all菜单项 据我了解 需要更改一个菜单项 我建议你使用android ac
  • 检查双精度值的等于和不等于条件

    我在比较两者时遇到困难double values using and 我创建了 6 个双变量并尝试进行比较If健康 状况 double a b c d e f if a b c d e f My code here in case of t
  • 在 Android 中的活动、服务和应用程序之间传递变量

    有人可以给我提供以下活动 服务 应用程序组合的示例吗 我拥有这三个 但我已经把我的应用程序弄得一团糟 试图在这个地方传递一堆变量 现在我不知道发生了什么 请注意 我是 Android 新手 最近我一直在努力解决这个问题 因为有很多方法可以实
  • 无法解析符号 FlutterActivity

    我使用 VCS gt Checkout from Version Control 将 flutter 项目从 github 导入到 Android Studio 中 现在我面临的问题是 Cannot resolve symbol Flutt
  • Google Inbox 类似 RecyclerView 项目打开动画

    目前 我正在尝试实现 Google Inbox 例如RecyclerView行为 我对电子邮件打开动画很好奇 我的问题是 该怎么做 我的意思是 他们使用了哪种方法 他们用过吗ItemAnimator dispatchChangeStarti
  • 方法断点可能会大大减慢调试速度

    每当向方法声明行添加断点 在 Intellij IDEA 或 Android Studio 中 时 都会出现一个弹出窗口 方法断点可能会大大减慢调试速度 为什么会这样戏剧性地减慢调试速度 是我的问题吗 将断点放在函数的第一行有什么不同 Th
  • OpenCV InRange 参数

    我在 Android 上使用 OpenCV 来实时查找特定颜色的圆圈 我的第一步是仅保留与我正在寻找的定义颜色相对应的像素 在本例中为红色或绿色 示例图像 https i stack imgur com CIozU jpg 为此 我正在使用
  • Android - 除了普通 SSL 证书之外还验证自签名证书

    我有一个通过 SSL 调用 Web 服务的 Android 应用程序 在生产中 我们将拥有由受信任的 CA 签名的普通 SSL 证书 但是 我们需要能够支持自签名证书 由我们自己的 CA 签名 我已经成功实施了接受自签名证书的建议解决方案
  • Cordova 地理定位不适用于 Android

    我想在 Android 上使用地理定位 我用 Apache Cordova 编写应用程序 地理定位在 android 电脑模拟器和 android 手机上均不起作用 I try http cordova apache org docs en
  • Locale.getDefault().getCountry() 返回空字符串

    我正在尝试使用国家 地区代码获取用户语言 例如en US es es 但是当我使用Locale getDefault getCountry 它返回空字符串 虽然它给了我正确的语言Locale getDefault getLanguage N
  • Python Kivy - 在本机网络浏览器中打开 url 的应用程序

    我尝试制作一个简单的应用程序 在单击 Screen One 上的按钮后 在 Kivy 中打开一个网页 我使用了这个主题 Python 在应用程序中直接显示网络浏览器 iframe https stackoverflow com questi
  • 在 Android 中使用 iText 读取或打开 PDF 文件

    我是 Android 应用程序开发新手 使用 iText 我完成了 PDF 创建并在创建的文件上写入 现在我想阅读该 PDF 文件 如何使用 iText 打开或阅读 PDF 文件 例子将是可观的 那么提前 哪个是渲染 PDF 文件的最佳库
  • 如何覆盖日期选择器的高度和宽度以填充父布局

    我有一个活动包含一个日期选择器 我想设置DatePicker适合屏幕 我试过这个答案 https stackoverflow com questions 6674667 how to customize date pickers width
  • 版本 5 上带有 getBackground().setAlpha 的按钮 - 棒棒糖无法正常工作

    我有这段代码 适用于自 API 14 以来的每个版本 但在 Android 5 0 Lollipop 上无法正常工作 以下是我希望按钮出现的方式 单击按钮1 buttonArrivals getBackground setAlpha 180
  • onTouchEvent()中如何区分移动和点击?

    在我的应用程序中 我需要处理移动和单击事件 一次点击是由一个 ACTION DOWN 操作 多个 ACTION MOVE 操作和一个 ACTION UP 操作组成的序列 理论上 如果您收到 ACTION DOWN 事件 然后收到 ACTIO
  • 更改android中禁用按钮的颜色

    有没有办法通过样式或其他形式更改 android 中禁用按钮的颜色 我目前有以下内容 可绘制 button default xml
  • 点击监听器的公共类

    我的所有 6 项活动中有 7 个按钮 所有 6 个按钮在所有活动中都具有相同的功能 如何为这 6 个按钮执行通用的单击事件侦听器 您可以创建一个实现 View OnClickListener 的新类 如下所示 public class My
  • 带有空白白屏的 WebView

    我在 DialogFragment 中有一个 webview 它使用以下方式显示文档和 PDF它可以进行几次尝试 但如果用户尝试频繁打开和关闭对话框 webview 将显示空白屏幕 我已经尝试了所有的线程link1 https stacko
  • Android:单一活动,多个视图

    我不是 Android 专业人士 尽管我开发了一个包含 50 多个活动的应用程序 这使得该应用程序非常庞大 经过8周的开发 现在出现了一些问题 导致应用程序难以维护和升级 我正在处理的主要问题是 我无法将对象引用传递给活动的构造函数 事实上

随机推荐