Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲

Android 2.2 Preview 3 編譯錯誤的解決方法

編輯:關於 Android 開發

Android 2.2 Preview 3 編譯錯誤的解決方法

平台:Android 2.2 Preview 3。

解決方法:在專案根目錄的 build.gradle 中設定,確保 Gradle 插件版本為 2.1.0,不要使用 alpha 版本:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0' // 確保這個地方是2.1.0,不要使用alpha版本
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

將 Gradle 插件版本固定為 2.1.0 後,即可避開該 Preview 版本所引發的編譯問題。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © Android教程網 All Rights Reserved