Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android 4.3 build error

Tags:

android

build

I found some same errors posted on other forums but no answer found yet for fixing this.

Running on my newly installed 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
..
..
..

It's obviously that the gsm.SmsMessage has some unknown issue with the building environment.

I tried to switch my java version from 1.7 to 1.6. But it still does not work.

Does anyone know how to fix this?

Thanks

like image 265
Sam Avatar asked Sep 13 '13 02:09

Sam


3 Answers

In my case, the problem was caused by javadoc from OpenJDK7, when I should be using JDK6 (Oracle).

As of now, JDK7 is needed to build the master branch of Android, and JDK6 for building Gingerbread (2.3) through Kitkat (4.4.4).

If you have several JDKs, make sure you select the right one for java/javac/javadoc. You can use these commands:

$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config javadoc

Output example for selecting java (first command above):

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: 
like image 142
milpita Avatar answered Nov 09 '22 08:11

milpita


The problem is exactly with javadoc which is 1.7 but what is really wrong is that after changing it to 1.6 from oracle and "make clean" it doesn't help. Removing and downloading sources helps. I was looking for some make target like "make distclean" or "make mrproper" to avoid redownloading sources which is time consuming. I found nothing.

like image 39
pulse Avatar answered Nov 09 '22 07:11

pulse


I could fix it after touching the files to rebuild them.

$ touch frameworks/opt/telephony/src/java/android/telephony/gsm/SmsManager.java
$ touch frameworks/opt/telephony/src/java/android/telephony/gsm/SmsMessage.java

$ make
like image 34
Joon Avatar answered Nov 09 '22 07:11

Joon