Android编译错误:You have tried to change the API from what has been previously approved.
来源:互联网 发布:利用淘宝店做淘宝客 编辑:程序博客网 时间:2024/05/17 02:22
Android SDK中有些Java类是开放的,有些是不开放的,API同样如此。这里所谓开放的类或API,只是javadoc的范畴,并不是java中public和private,也就是说,对于源码的编译无所谓,只是对javadoc的生成有影响关于类的开放和隐藏,但是对android的上层应用有影响,因为非开放的类或API,android上层应用无法直接访问。
类或API是否开放,是通过doc的注释{@hide}来控制的。比如android.media.Metadata 这个类就是android没有公开的类,因为在frameworks\base\media\libmedia\Metadata.java文件中,定义Metadata类之前有/**{@hide}*/此doc注释,所以Metadata类被定义为了非公开类,即是在android应用程序中无法直接访问的类。
但是如果我们在Android的公开类中添加了一些自定义的成员方法或成员变量,生成我们修改后的sdk(jar包)供上层应用程序使用,此时在编译源码生成SDK的过程中会出现这个问题:
******************************
You have tried to change the API from what has been previously approved.
To make these errors go away, you have two choices:
1) You can add "@hide" javadoc comments to the methods, etc. listed
in the
errors above.
2) You can update current.xml by executing the following commands:
p4 edit frameworks/base/api/current.xml
make update-api
To check in the revised current.xml, you will need OWNERS
approval.
******************************
google 给了两个选择:
1. 在你添加的API或者变量前面,增加javadoc 注释@hide。但是要注意的是,并不是简单写个@hide 或者 /*@hide*/ 就可以了,这些都是错误的javadoc注释格式,标准的javadoc都是这样的 /** */ 而且对于 format 变量 应该加上 { }。
所以我们应该这样写 /** {@hide} */
2. 你就是想要生成的javadoc里面出现这个方法或者变量,你必须输入:
make update-api
但是如果修改的是google没有开放出来的类,比如RIL,PhoneFactory,就不会出现这个问题,
类或API是否开放,是通过doc的注释{@hide}来控制的。比如android.media.Metadata 这个类就是android没有公开的类,因为在frameworks\base\media\libmedia\Metadata.java文件中,定义Metadata类之前有/**{@hide}*/此doc注释,所以Metadata类被定义为了非公开类,即是在android应用程序中无法直接访问的类。
但是如果我们在Android的公开类中添加了一些自定义的成员方法或成员变量,生成我们修改后的sdk(jar包)供上层应用程序使用,此时在编译源码生成SDK的过程中会出现这个问题:
******************************
You have tried to change the API from what has been previously approved.
To make these errors go away, you have two choices:
1) You can add "@hide" javadoc comments to the methods, etc. listed
in the
errors above.
2) You can update current.xml by executing the following commands:
p4 edit frameworks/base/api/current.xml
make update-api
To check in the revised current.xml, you will need OWNERS
approval.
******************************
google 给了两个选择:
1. 在你添加的API或者变量前面,增加javadoc 注释@hide。但是要注意的是,并不是简单写个@hide 或者 /*@hide*/ 就可以了,这些都是错误的javadoc注释格式,标准的javadoc都是这样的 /** */ 而且对于 format 变量 应该加上 { }。
所以我们应该这样写 /** {@hide} */
2. 你就是想要生成的javadoc里面出现这个方法或者变量,你必须输入:
make update-api
但是如果修改的是google没有开放出来的类,比如RIL,PhoneFactory,就不会出现这个问题,
0 0
- Android编译错误:You have tried to change the API from what has been previously approved.
- Android编译错误:You have tried to change the API from what has been previously approved.
- Android编译错误:You have tried to change the API from what has been previously approved.
- You have tried to change the API from what has been previously approved.
- You have tried to change the API from what has been previously approved
- 修改Android framework源码报错(You have tried to change the API from what has been previously approved)
- 修改frameworks/base/ 代码后,make提示“You have tried to change the API from what has been previously approv”
- what have you tried?
- What have you tried?
- EBS采购收货保存时,错误‘The quantity has not been converted from @@@ to Each, since 。。。’
- What have you done to the Earth, hackers?
- 关于“This file has been modified outside of the source editor. Do you want to reload it?”错误的处理
- 关于“This file has been modified outside of the source editor. Do you want to reload it?”错误的处理
- Google App Engine错误解决方案之Class com.xxx.xxx does not seem to have been enhanced. You may want to rerun the enhancer and check for
- 13.You have executed this command to change the size of the database buffer cache:
- How to solve the problem : "You have been logged on with a temporary profile"
- have you tried Google Earth?
- how to fix "The App Name you entered has already been used"
- BroadCastReceiver的基本使用方法
- L2-005. 集合相似度
- spark 1.6.0 core源码分析2 master启动流程
- IOS图像拉伸解决方案
- GreenDAO—Android ORM框架(一)
- Android编译错误:You have tried to change the API from what has been previously approved.
- 算法导论第六章6.5
- MySQL 一键生成wiki、protobuf等
- 无限轮播图 三种实现方式
- 使用ivy管理jar包
- 如何在mac上安装gradle
- C语言的控制语句
- Java提高篇(三二)-----List总结
- 7_4_D题 India and China Origins题解 [hdu 5652](并查集)