Android Studioが3.4にアップグレードされた問題のまとめ

2070 ワード

1、gradleはアップグレードする必要があります.
1)、プロジェクトの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.30.各moduleはこのように設定する必要があります.
関連する値を統一的に構成するには、プロジェクトの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)をチェックする必要はありません
 
 
 
 

転載先:https://www.cnblogs.com/qynprime/p/10781419.html