参考github上的demo,新建一个project后,会有一个位于app文件夹下的局部build.gradle文件和一个位于根目录project下的全局build.gradle文件,我们要修改的是局部gradle文件:

 buildscript {
repositories {
mavenCentral()
}
dependencies {
// replace with the current version of the Android plugin
classpath 'com.android.tools.build:gradle:1.0.0'
// the latest version of the android-apt plugin
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
} repositories {
mavenCentral()
mavenLocal()
} apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '3.3-SNAPSHOT' // change this to your desired version, for example the latest stable: 3.2 dependencies {
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
} apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
// if you have multiple outputs (when using splits), you may want to have other index than 0 resourcePackageName 'org.androidannotations.gradle' // If you're using Android NBS flavors you should use the following line instead of hard-coded packageName
// resourcePackageName android.defaultConfig.packageName // You can set optional annotation processing options here, like these commented options:
// logLevel 'INFO'
// logFile '/var/log/aa.log'
}
} android {
compileSdkVersion 19
buildToolsVersion "21.1.1" defaultConfig {
minSdkVersion 9
targetSdkVersion 19
}
}

最后再在AndroidManifest.xml中的Activity的名字后面加上 _(下划线)

然后编译项目 完成! 如果报错,请多编译几次。编译按钮:

我的顺利编译通过。 参考博客:http://blog.csdn.net/ljphhj/article/details/37601173

android studio 框架搭建:加入注解框架Annotations的更多相关文章

  1. [转]Android Studio 里搭建自动化测试框架Robotium

    Android的自动化测试框架可选择的不多,后来选了Robotium(https://code.google.com/p/robotium/),它的语法及易用性挺像我们用在iOS里的KIF. 官方文档 ...

  2. 【Mac + Android】之Android Studio 环境搭建,AVD模拟器运行(包括:命令行运行AVD,并且Genymotion模拟器插件配置运行)

    目录: 前提.Mac环境下手动配置Android SDK 一. Android Studio下载及配置 二.AVD模拟器配置运行 扩展:命令行运行AVD模拟器 三.在Android Studio 中配 ...

  3. Android Studio3.0 配置AndroidAnnotation注解框架

    前言android学习了一段时间后,想要开发一款App,但是一些复杂的代码写多了实在麻烦,就到网上找了找简便的方法,于是在众多的注解开发框架中,找到了Android Annotation这个框架,这里 ...

  4. SSH(Struts2+Spring+Hibernate)框架搭建流程<注解的方式创建Bean>

    此篇讲的是MyEclipse9工具提供的支持搭建自加包有代码也是相同:用户登录与注册的例子,表字段只有name,password. SSH,xml方式搭建文章链接地址:http://www.cnblo ...

  5. SpringMVC框架搭建 基于注解

    本文将以一个很简单的案例实现 Springmvc框架的基于注解搭建,一下全为个人总结 ,如有错请大家指教!!!!!!!!! 第一步:创建一个动态web工程(在创建时 记得选上自动生成 web.xml ...

  6. Android Studio开发快速创建MVP框架插件AndroidMVP

    转载:https://www.jianshu.com/p/60cd98bbc358 Android开发中,我们为了代码的解耦以及后期的维护方便,都会采用一些开发框架,常用的有MVC.MVP.MVVM. ...

  7. 菜鸟水平如何在Android Studio中添加uiautomator测试框架

    1.启动AS,弹出创建Android Studio项目 2.选择 "Start a new Android Studio project",输入 application name ...

  8. 【Android测试】【随笔】Android Studio环境搭建

    ◆版权声明:本文出自胖喵~的博客,转载必须注明出处. 转载请注明出处:http://www.cnblogs.com/by-dream/p/5482778.html 随着Android Studio的推 ...

  9. android studio环境搭建-笔记1

    自己干了几年测试(功能性的),最近比较闲,就自己学习下android(以前也有所接触,但那是几年前的一点皮毛,都忘记了). 先搭建谷歌推出的android studio(以前用eclipse搭建总觉得 ...

  10. Unity 游戏框架搭建 (六) 关于框架的一些好文和一些思考

      在进行项目架构阶段,游戏框架可以解决一部分问题.剩下的架构问题还需要根据不同的项目解决.总之游戏框架是游戏架构的一部分. 关于锤子和钉子:   最近又拿起了<代码大全>和<暗时间 ...

随机推荐

  1. C#常见编译报错

    mCaster.PlayAnim(ANIMID.ASTD); No overload for method 'PlayAnim' takes '1' arguments PlayAnim()内有两个参 ...

  2. angular 工厂模式依赖注入

    import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; ...

  3. Xcode9新功能

    1.折叠代码 局部折叠(折叠一个函数):Command+Option+Left/Right 全局折叠(折叠当前文件下的全部函数): Shift+Command+Option+Left/Right 折叠 ...

  4. 20165219 2017-2018-2 《Java程序设计》第6周学习总结

    20165219 2017-2018-2 <Java程序设计>第6周学习总结 教材学习内容小结 第八章 String类 常用方法 public int length() 求字符串长度 pu ...

  5. 基于SSH协议clone GitHub远端仓库到本地-git

    经常逛 GitHub 的可能都知道,在 clone 远端仓库的时候,会有两个选项,如下图: 首先我们来说明一下两种方式的区别. 使用 HTTPS url 克隆对初学者来说会比较方便,复制HTTPS u ...

  6. 2、Tensorflow中的变量

    2.Tensorflow中的变量注意:tf中使用 变量必须先初始化下面是一个使用变量的TF代码(含注释): # __author__ = "WSX" import tensorfl ...

  7. js去重方法

    function remove(array){ var obj={}; newarray=[]; for(var i in array){ console.log(i); var arg=array[ ...

  8. AtCoder - 2568 最小割

    There is a pond with a rectangular shape. The pond is divided into a grid with H rows and W columns ...

  9. .net mvc 框架实现后台管理系统4-layedit使用

    做个简单的文章发布,使用了layui的layedit 效果: 在html页面添加: <textarea id="MyArticleContent" style="d ...

  10. Week 5: Object Oriented Programming 9. Classes and Inheritance Exercise: int set

    class intSet(object): """An intSet is a set of integers The value is represented by a ...