Android Gradle 插件 0.13 和 android-apt 1.3 出现错误

2023-11-22

我刚刚将我的 android gradle 插件从 0.12 更新到 0.13。而且我已经下载了gradle 2.1。然后,我尝试使用 beta 版的 android studio 0.8.9 但根据http://tools.android.com/tech-docs/new-build-system/version-compatibility我必须至少使用 android studio 0.8.11(金丝雀频道)。所以我更新了我的 android studio 但问题仍然存在。

现在,我必须使用 gradle 1.10 和 android gradle 插件 0.12.+ 才能工作

这是来自 AS 的错误

Error:No such property: projectDependencies for class: com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated

Edit :

这是我的 build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        // works with 0.12.+ (not with 0.13.+)
        classpath 'com.android.tools.build:gradle:0.12.+'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

        // The latest version of the android-apt plugin
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.3'
    }
}

allprojects {
    repositories {
        maven {  // For Android-ViewPagerIndicator
            url "http://dl.bintray.com/populov/maven"
        }
        jcenter()
        mavenCentral()
        maven {
            url "http://JRAF.org/static/maven/2"
        }
    }
}

这是我的 gradle-wrapper.properties

#Fri Sep 19 17:50:42 CEST 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
# use gradle-2.1-all.zip with android gradle plugin 0.13
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip

EDIT 2 :

apply plugin: 'com.android.application'
apply plugin: 'android-apt'

android {
    compileSdkVersion 19
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId 'xxx'
        minSdkVersion 10
        targetSdkVersion 19
        versionCode xxx
        versionName 'xxx'
    }

    // For more information see
    // @link http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Using-sourceCompatibility-1.7
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    signingConfigs {
        debug {
            storeFile file('../../KeyStore/debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
        release {
            storeFile file('xxx')
            storePassword 'xxx'
            keyAlias 'xxx'
            keyPassword 'xxx'
        }
    }

    buildTypes {
        // Just intern. This is alpha build
        debug {
            buildConfigField "boolean", "FORCE_GOOG_GEO_API", "false"  // can be set to true in debug but not in other buildTypes
            buildConfigField "boolean", "ENABLE_LOG", "true"
            buildConfigField "String", "HOST", "\"xxx\""
            versionNameSuffix '-alpha'
            signingConfig signingConfigs.debug
            zipAlign true
        }
        // For customer
        recette {
            buildConfigField "boolean", "FORCE_GOOG_GEO_API", "false"
            buildConfigField "boolean", "ENABLE_LOG", "false"
            buildConfigField "String", "HOST", "\"xxx\""
            versionNameSuffix '-recette'
            signingConfig signingConfigs.debug
            zipAlign true
        }
        // PreProd
        preprod {
            buildConfigField "boolean", "FORCE_GOOG_GEO_API", "false"
            buildConfigField "boolean", "ENABLE_LOG", "false"
            buildConfigField "String", "HOST", "\"xxx\""
            signingConfig signingConfigs.debug
            zipAlign true
        }
        // Prod
        release {
            buildConfigField "boolean", "FORCE_GOOG_GEO_API", "false"
            buildConfigField "boolean", "ENABLE_LOG", "false"
            buildConfigField "String", "HOST", "\"xxx\""
            signingConfig signingConfigs.release
            zipAlign true
            runProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
        }
    }

    // This is important, it will run lint checks but won't abort build
    lintOptions {
        abortOnError false
        disable 'MissingTranslation'
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'AndroidManifest.xml'
    }
}

apt {
    arguments {
        resourcePackageName android.defaultConfig.packageName
        androidManifestFile variant.processResources.manifestFile
    }
}

def GoogPlayServVersion = '5.0.+';
def GsonVersion = '2.2.4';
def LibPhoneNumbVersion = '5.9';
def GreenRobotVersion = '2.2.1';
def OkHttpVersion = '2.0.0';
def OkHttpConnVersion = '2.0.0';
def JacksonCore = '2.4.1';
def JacksonDatabind = '2.4.1';
def JacksonAnnotations = '2.4.0';
def SwitchVersion = '1.3.1';
def CroutonVersion = '1.8.4';
def ActionBarSherlockVersion = '4.4.0';
def ViewpagerIndicatorVersion = '2.4.1';
def PicassoVersion = '2.3.4';
def RoboSpiceVersion = '1.4.12';
def StickyListHeaders = '2.4.1';
def AAVersion = '3.1';

def RobotiumVersion = '5.2.1';

dependencies {
    // Include all jar in libs folder
    compile fileTree(dir: 'libs', include: ['*.jar'])

    // Google Play Services
    compile "com.google.android.gms:play-services:$GoogPlayServVersion"

    // Gson
    compile "com.google.code.gson:gson:$GsonVersion"

    // LibphoneNumber
    compile "com.googlecode.libphonenumber:libphonenumber:$LibPhoneNumbVersion"

    // GreenRobot
    compile "de.greenrobot:eventbus:$GreenRobotVersion"

    // OkHttp [We use repackaged version @see https://github.com/square/okhttp/issues/967]
    // compile "com.squareup.okhttp:okhttp:$OkHttpVersion"
    // compile "com.squareup.okhttp:okhttp-urlconnection:$OkHttpConnVersion"

    // Jackson
    compile "com.fasterxml.jackson.core:jackson-core:$JacksonCore"
    compile "com.fasterxml.jackson.core:jackson-databind:$JacksonDatabind"
    compile "com.fasterxml.jackson.core:jackson-annotations:$JacksonAnnotations"

    // Switch backport
    compile "org.jraf:android-switch-backport:$SwitchVersion"

    // Crouton lib
    compile("de.keyboardsurfer.android.widget:crouton:$CroutonVersion") {
        // exclusion is not neccessary, but generally a good idea.
        exclude group: 'com.google.android', module: 'support-v4'
    }

    // You must install or update the Support Repository through the SDK manager to use this dependency.
    // The Support Repository (separate from the corresponding library) can be found in the Extras category.
    // compile 'com.android.support:support-v4:19.1.0'
    // compile 'com.android.support:gridlayout-v7:19.1.0'

    // ActionBarSherlock
    compile "com.actionbarsherlock:actionbarsherlock:$ActionBarSherlockVersion@aar"

    // Android-ViewPagerIndicator
    compile "com.viewpagerindicator:library:$ViewpagerIndicatorVersion@aar"

    // Picasso
    compile "com.squareup.picasso:picasso:$PicassoVersion"

    // Robospice
    compile "com.octo.android.robospice:robospice:$RoboSpiceVersion"

    // StickyList headers
    compile "se.emilsjolander:stickylistheaders:$StickyListHeaders"

    // Facebook sdk
    compile 'fr.avianey:facebook-android-api:+@aar'

    // android annotations
    compile "org.androidannotations:androidannotations-api:$AAVersion"
    apt "org.androidannotations:androidannotations:$AAVersion"

    compile 'com.sothree.slidinguppanel:library:+'

    // Tests part
    androidTestCompile "com.jayway.android.robotium:robotium-solo:$RobotiumVersion"
    compile "com.jayway.android.robotium:robotium-solo:$RobotiumVersion"
}

你知道我该如何解决这个问题吗?

Thx


android-apt 1.3 似乎与 Android Gradle 插件 v0.13 不兼容。请使用 android-apt 1.4 代替:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.13.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android Gradle 插件 0.13 和 android-apt 1.3 出现错误 的相关文章

  • 使用 JSONArray 还是普通数组来存储/读取数据更有效?

    我正在使用一个连接到PHP MySQL返回所有内容的服务器JSON格式 例如 用户列表作为JSONArray of JSONObject 每个对象都包含单个用户的信息 姓名 位置 电话号码等 处理这种格式的信息时 将所有内容保留在其中会更有
  • 如何在 Android 中更改 Drawable 的颜色?

    我正在开发一个 Android 应用程序 并且我有一个从源图像加载的可绘制对象 在此图像上 我想将所有白色像素转换为不同的颜色 例如蓝色 然后缓存生成的 Drawable 对象 以便稍后使用它 举例来说 假设我有一个 20x20 PNG 文
  • 应用程序在加载 xml 布局文件的主线程中做了太多工作

    我正在制作一个 9x9 数独网格 其中 81 个单元格本身就是一个 3x3 网格 单个细胞看起来像这样 1 2 3 4 5 6 7 8 9 每个数字代表该单元格的铅笔注释 我有一个名为 cell layout xml 的文件 表示这种 3x
  • 如何在android中显示对话框之外的图像?

    我试图在对话框片段的顶部显示配置文件图像 一半在图像之外 我在下面附加了示例对话框 就像那样 并尝试了旧 Stackoverflow 解决方案中的所有 FrameLayout 协作 但我无法存档此内容 请给我正确的解决方案 谢谢 Updat
  • 当满足条件时,如何以编程方式更改 ImageButton src 目标?

    我有一个学校项目 我正在尝试开发一个手电筒应用程序 对于开 关 ImageButton 我想要 4 个自定义图像 如果手电筒关闭 turn on png 默认 turn on pressing png 按下状态 true 如果手电筒打开 t
  • Android 中的列表(特别是 RecyclerView 和 CardView)如何工作

    请原谅我问这个问题 但我是 Android 开发新手 尽管我正在尝试了解developer android com 网站上的基础知识 但大多数示例 即使他们说它们是为 Android Studio 构建的 尚未设置为使用 Gradle 因此
  • 覆盖 Android 中的电源按钮

    我正在开发一个应用程序 其中我需要在按下电源按钮时执行一个操作 但不幸的是我无法处理按下电源按钮时的操作 我尝试使用 onKeyDown 和dispatchKeyEvent 方法 但似乎没有任何效果 任何人都可以建议我解决这个问题的任何其他
  • Android 全屏对话框确认和拒绝操作

    材料设计中的全屏对话框应该在操作栏 工具栏上有确认和拒绝操作 我的问题是 我该怎么做 显示对话框 getFragmentManager beginTransaction add R id container new MyDialogFrag
  • 退出设备上的 system.img

    我正在为我们部署给客户的设备 LG p509 Optimus 1 开发自动应用程序更新解决方案 我们可以控制这些设备 并且目前在它们上安装自定义内核 但不是完整的自定义 ROM 由于我们试图在设备上自动更新我们的应用程序 因此我们需要由我们
  • Ionic 2 RC0 和 Angular 2 最新的 Android 构建错误(ngc:错误:静态解析符号值时遇到错误)

    当我使用构建android时出现错误ionic build android命令 ngc 错误 静态解析符号值时遇到错误 引用本地 非导出 符号 字典 考虑导出符号 原始 ts文件中的位置14 8 解析符号TRANSLATION PROVID
  • Android上如何获取ImageView的Drawable的矩形?

    我想要获取将包裹 ImageView 的 Drawable 的矩形对象 而不是包裹 ImageView 的矩形 我将使用该矩形在 Drawable 周围绘制一些奇特的矩形 我怎样才能得到那个矩形 Rect rect new Rect Ima
  • 透明 9patch 图像:显示出线条

    我得到了一个透明的 9 补丁图像 其中有 9 条补丁线显示槽 This is the output 显然我不希望水平线可见 这就是我创建 9patch 的方式 This is the final image that is used in
  • 将 java 中的 byte[] 转换为 C++ 中的 unsigned char* 的正确方法,反之亦然?

    我是 C 和 JNI 的新手 我尝试找到一种正确的方法 通过使用 JNI 将 java 中的 byte 转换为 C 中的 unsigned char 反之亦然 我正在安卓上工作 在谷歌和SO中寻找解决方案后 我还没有找到将java中的byt
  • Android -room 持久库 - DAO 调用是异步的,因此如何获取回调?

    从我读到的Room 不允许您在主线程上发出数据库查询 因为可能会导致主线程延迟 所以想象一下我正在尝试更新 UI 主线程上的文本视图 其中一些数据我将如何得到回调 让我给你举个例子 想象一下 我想将我的业务模型数据存储到一个名为 事件 的对
  • 在新的 intel x86 android 模拟器中访问 google api

    我只是尝试在新的 x86 android 模拟器中运行我公司的应用程序 但是我们的应用程序依赖于 google 地图 API 而这在 google 随 android sdk 版本 17 提供的 x86 系统映像中不可用 我的直觉告诉我答案
  • Android蓝牙java.io.IOException:bt套接字已关闭,读取返回:-1

    我正在尝试编写一个代码 仅连接到运行 Android 5 0 KitKat 的设备上的 目前 唯一配对的设备 无论我尝试了多少方法 我仍然会收到此错误 这是我尝试过的最后一个代码 它似乎完成了我看到人们报告为成功的所有事情 有人能指出我做错
  • MIUI 权限被拒绝活动 KeyguardLocked

    当应用程序处于后台且屏幕被锁定时 我无法启动活动 没有异常或警告 只是不调用 onCreate 我一直在与这个问题作斗争 我想我终于找到了它的根源 日志中有一行 D com android server am ExtraActivityMa
  • 如何为我的 Android Market APK 创建证书?

    我想将我的第一个 APK 应用程序上传到 Android Market 但我收到了此错误 顺便说一下 在 stackoverflow 中搜索时并没有引导我找到正确的链接 市场不接受使用调试证书签名的 APK 创建有效期至少 50 年的新证书
  • 移动设备上的 TensorFlow(Android、iOS、Windows Phone)

    我目前正在寻找不同的深度学习框架 特别是用于训练和部署卷积神经网络 要求是 它可以在带有 GPU 的普通 PC 上进行训练 但训练后的模型必须部署在三个主要的移动操作系统上 即 Android iOS 和 Windows Phone Ten
  • Android模拟器中的网络访问

    我试图通过我的 Android 应用程序访问互联网 但我既成功又失败 我在构建应用程序时启动模拟器 并且应用程序安装得很好 我可以使用浏览器访问互联网 但是 当我尝试这个小代码片段时 InetAddress inet try inet In

随机推荐

  • 如何自动回答 y(kill-matching-buffers 询问我是否应该终止修改的缓冲区)?

    在 Emacs 中 如何杀死与正则表达式匹配的缓冲区 Edit 我该如何回答y自动地 kill matching buffers询问我是否应该杀死修改过的缓冲区 像这样的东西吗 defun bk kill buffers bfrRgxp i
  • 使用 React Router 进行条件渲染

    我想在顶部渲染一些带有导航的路线 而在没有任何导航的情况下渲染其他路线 如注册 登录页面 对于导航的设置 我有 const App gt
  • 从类路径中的任何位置加载资源

    我有一个简单的 java 应用程序 它从当前包加载属性文件 this getClass getResourceAsStream props properties 当我想要的属性文件位于当前包中时 这可以正常工作 但是 我想将此应用程序打包为
  • 素数生成器解释? [复制]

    这个问题在这里已经有答案了 我正在寻找一种生成素数的算法 我找到了罗伯特 威廉 汉克斯 Robert William Hanks 创作的以下一幅作品 它非常有效并且比其他算法更好 但我无法理解其背后的数学原理 def primes n Re
  • 将数组传递给 Java 方法

    如何将整个数组传递给方法 private void PassArray String arrayw new String 4 populate array PrintA arrayw private void PrintA String a
  • Java:具有接口属性的对象的 Jackson 多态 JSON 反序列化?

    我正在使用杰克逊的ObjectMapper反序列化包含接口作为其属性之一的对象的 JSON 表示形式 代码的简化版本可以在这里看到 https gist github com sscovil 8735923 基本上 我有一个班级Asset有
  • ViewPager 和 FragmentPagerAdapter 中 Fragment 的 Android 生命周期管理

    我一直在努力找出如何正确管理 Fragment 中的内容FragmentActivity with a ViewPager是 在详细介绍之前 我先对我面临的问题进行快速总结如下 我有一个FragmentActivity with a Vie
  • Android Studio 2.1 将字节码转换为 dex 时出错

    自从我将 android studio 从 2 0 更新到 2 1 后 我收到以下错误 错误 将字节码转换为 dex 时出错 原因 Dex 无法解析版本 52 字节代码 这是由于 使用 Java 8 或更高版本编译的库依赖项 如果 您正在库
  • 使用 Visual Studio 2015 编译 ToolsVersion 12

    我安装了一台新电脑并安装了VS2015 编译我当前正在处理的项目会产生一些无效代码 ILSpy 创建无法编译的源代码 使用 ToolsVersion 12 在 VS2013 中运行良好 日志文件告诉我 ToolsVersion 12 丢失
  • ExtJs4 - 与网格 ColumnModel 等效的是什么?

    ExtJs3相当于什么Ext grid ColumnModel在 ExtJs4 中 我想做的是隐藏一列 我在 ExtJs3 中做了如下操作 grid colModel setHidden 1 true 您可以使用 Ext grid colu
  • 查找非有限值的最快方法

    这是受到以下启发 python numpy 中的组合掩码 任务是创建一个包含所有非有限值的布尔数组 例如 gt gt gt arr np array 0 2 np inf np inf np nan gt gt gt np isfinite
  • 使用 EventTrigger 设置属性

    我希望能够使用 EventTrigger 设置属性 但这有很多问题 1 EventTriggers仅支持Actions 所以我必须使用storyBoard来设置我的属性 2 一旦我使用故事板 我有两个选择 停止 动画停止后 值将恢复到动画开
  • git log -L 不带差异

    我正在尝试使用git log L
  • 使用 Ruby 进行科学编程

    我正在使用 python 或 Octave 进行数学计算 因为手头有非常好的函数和库 但最近我对 Ruby 产生了兴趣 我想知道 Ruby 中是否有相当于 Python 中的 numpy scipy 的科学编程工具 具体来说 我正在寻找一些
  • 选择页面上的所有元素[关闭]

    很难说出这里问的是什么 这个问题模棱两可 含糊不清 不完整 过于宽泛或言辞激烈 无法以目前的形式合理回答 如需帮助澄清此问题以便重新打开 访问帮助中心 我正在寻找 javascript 中的一个函数 它可以单击我页面上的每个元素 链接 按钮
  • 将指针传递给结构数组时出错

    include
  • Bootstrap 多选不起作用

    我正在尝试使用多选 Bootstrap 我使用了以下代码 该代码也可以在他们的网站上找到 http davidstutz github io bootstrap multiselect 它显示了多选按钮 并且由于我已经选择了 奶酪和意大利辣
  • 没有 ControlContainer 的提供者和 ControlContainer 没有提供者

    我正在开发一个使用 Angular2 的应用程序 我正在尝试在我的应用程序中使用反应式表单 但遇到了一些错误 第一个错误是关于 NgControl 的 如下所示 没有 NgControl 的提供者 div 类 col md 8 错误 gt
  • C++ sizeof Vector 是 24?

    我只是在闲逛并学习向量和结构 有一次 我尝试以字节为单位输出向量的大小 这是代码 include
  • Android Gradle 插件 0.13 和 android-apt 1.3 出现错误

    我刚刚将我的 android gradle 插件从 0 12 更新到 0 13 而且我已经下载了gradle 2 1 然后 我尝试使用 beta 版的 android studio 0 8 9 但根据http tools android c