zoukankan      html  css  js  c++  java
  • 所有的环境都配置好了,将新创建的weex项目导入到Android studio中的时候,出现的错误。

    关于android studio升级3.0以后自动输出apk名的报错问题

    我的安装之路,与bug斗智斗勇!!!!

    升级gradle到3.0.1的时候,app.gradle报了如下几种错误错误:主要是将以前的output.outputFile替换为outputFileName。

    第一种情况:

    Could not get unknown property 'outputFile' for BuildType_Decorated{name=output, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, 

    第二种情况:

    Ambiguous method overloading for method java.io.File# . Cannot resolve which method to invoke for [class java.lang.String, null] due to overlapping prototypes between: [class java.lang.String, class java.lang.String] [class java.lang.String, class java.io.File] Open File

    第三种情况:

    No signature of method: java.util.ArrayList.endsWith() is applicable for argument types: (java.lang.String) values: [.apk] Open File

    反正不管是哪种错误,最后经过翻阅各个博客资料,和自己的尝试,修改为下面的方案总算是可以了。:

    //自定义打包时apk名字
    android.applicationVariants.all { variant ->
    variant.outputs.all { output ->
    def fileName
    if (outputFileName != null && outputFileName.contains('.apk')) {
    if (variant.buildType.name.equals('release')) {
    //输出示例: yilv-huawei-release.apk
    fileName = "yilv-${variant.productFlavors[0].name}-${defaultConfig.versionName}-relese.apk"
    } else if (variant.buildType.name.equals('debug')) {
    fileName = "yilv-${variant.productFlavors[0].name}-${defaultConfig.versionName}-debug.apk"
    }
    outputFileName = fileName
    }
    }
    }

    //渠道
    productFlavors {
    develop {}
    xiaomi {}
    huawei {}

    }
    以上内容原文链接:https://blog.csdn.net/sunchaohui5741/article/details/80499547

    Intel HAXM is required to run this AVD.

    7链接地址

    https://jingyan.baidu.com/article/a3761b2be09f961576f9aab3.html

    AndroidStudio Gradle 解决Error:All flavors must now belong to a named flavor dimension. Learn more at

    链接地址:

    https://blog.csdn.net/jabony/article/details/78932024

  • 相关阅读:
    StackExchange.Redis 使用 (一)
    委托的一个小问题
    MemberwishClone学习
    类的内容学习
    类的学习
    构造函数学习
    C# 重新筑基-从头开始
    C语言入门:结构体+文件的应用
    C语言入门:结构体的概要
    C语言入门:指针的概要
  • 原文地址:https://www.cnblogs.com/littleswan/p/11328120.html
Copyright © 2011-2022 走看看