我发现在其他论坛发布了一些相同的错误,但没有找到解决这个问题的答案.
在我刚刚安装的Ubuntu 12.10上运行,
out/target/common/obj/PACKAGING/public_api.txt:22097: error 12: Class android.telephony.gsm.SmsMessage changed static qualifier prebuilts/sdk/api/18.txt:22054: error 9: Removed public constructor SmsMessage() prebuilts/sdk/api/18.txt:22055: error 9: Removed public method android.telephony.gsm.SmsMessage.calculateLength prebuilts/sdk/api/18.txt:22056: error 9: Removed public method android.telephony.gsm.SmsMessage.calculateLength prebuilts/sdk/api/18.txt:22057: error 9: Removed public method android.telephony.gsm.SmsMessage.createFromPdu prebuilts/sdk/api/18.txt:22058: error 9: Removed public method android.telephony.gsm.SmsMessage.getDisplayMessageBody prebuilts/sdk/api/18.txt:22059: error 9: Removed public method android.telephony.gsm.SmsMessage.getDisplayOriginatingAddress prebuilts/sdk/api/18.txt:22060: error 9: Removed public method android.telephony.gsm.SmsMessage.getEmailBody prebuilts/sdk/api/18.txt:22061: error 9: Removed public method android.telephony.gsm.SmsMessage.getEmailFrom .. .. ..
显然,gsm.SmsMessage与建筑环境有一些未知的问题.
我试图将我的java版本从1.7切换到1.6.但它仍然不起作用.
有谁知道如何解决这个问题?
谢谢
解决方法
在我的情况下,问题是由OpenJDK7的javadoc引起的,当我使用JDK 6(Oracle)时.
到目前为止,JDK7需要构建Android的主分支,JDK6通过Kitkat(4.4.4)构建Gingerbread(2.3).
如果安装了多个JDK,请确保为java / javac / javadoc选择正确的JDK.您可以使用以下命令:
$sudo update-alternatives –config java
$sudo update-alternatives –config javac
$sudo update-alternatives –config javadoc
输出示例java(第一个命令):
There are 3 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1051 auto mode * 1 /usr/lib/jvm/java-6-oracle/jre/bin/java 1 manual mode 3 /usr/lib/jvm/java-7-oracle/jre/bin/java 2 manual mode Press enter to keep the current choice[*],or type selection number: