• Android Studio升级到3.4遇到的问题总结


    1、gradle需要升级。

      1)、project的build.gradle文件写下如下代码:

        buildscript {

        repositories {
        google()
        jcenter()
        }
        dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0' //gradle版本号升级到高于3.4.0以上。
        }
        }  
      2)、gradle-wrapper.properties文件中写上如下代码:
         distributionUrl=https://services.gradle.org/distributions/gradle-5.1.1-all.zip   //此处最低要高于5.1.1
      3)、更新gradle版本可以通过配置的方式来更新,如下截图:
        

    2、关于buildToolsVersion值的设置。

      最小支持:28.0.3。各module都需要这么设置。

      统一去配置相关的值可以在project的build.gradle文件中编辑如下代码:

      ext {
      minSdkVersion = 16
      targetSdkVersion = 26
      compileSdkVersion = 28
      buildToolsVersion = '28.0.3'
      sourceCompatibilityVersion = JavaVersion.VERSION_1_8
      targetCompatibilityVersion = JavaVersion.VERSION_1_8
      }

      在各module中引用的代码如下:
      compileSdkVersion rootProject.ext.compileSdkVersion      //举个例子。

    3、添加依赖库的关键词需要更新。

    compile

    testCompile

    androidTestCompile

                 只能用于低版本                                                                         声明的依赖包此模块和其它依赖该模块的其它模块也可以使用                                              

    api

    testApi

    androidTestApi 

                无版本限制 声明的依赖包此模块和其它依赖该模块的其它模块也可以使用

    implementation

    testImplementation

    androidTestImplementation

               无版本限制,会使AS编译速度更快 声明的依赖包只限于模块内部使用,不允许其他模块使用。

    4、Android Error: execution failed for task ':app:transformDexWithInstantRunSlicesApkForDebug'

      解决办法: 
        File->Settings->Built,Execution,Deployment->Instant Run 
        不用勾选Enable Instant Run to hot swap code/resource changes on deploy(default enabled)

     
  • 相关阅读:
    Oracle使用手册<收藏>
    Oracle 连接串方式
    通过多线程为基于 .NET 的应用程序实现响应迅速的用户
    PL/SQL三种集合类型的比较<收藏>
    关于Application.DoEvents() 避免假死<收藏>
    Inserting/Retrieving CLOB/NCLOB Data
    从procedure返回結果集<收藏>
    oracle ReadBlobs
    使用Update...returning...into为什么会出现ORA01036,ORA24369错误 <收藏>
    DevExpress document 地址
  • 原文地址:https://www.cnblogs.com/qynprime/p/10781419.html
Copyright © 2020-2023  润新知