Problem of building Android for A20 board

Started by hankgong, April 09, 2014, 07:24:56 PM

Previous topic - Next topic

hankgong

Hello guys,

Now I'm building Android from source code for A20 Olinuxino Board. I'm following the guide of the official web page and downloaded source code from http://dl.linux-sunxi.org/users/tsvetan/ANDROID-4.2.2-SDK2.0-KERNEL-3.4/.

My building computer is
$ uname -a
Linux huazhi-1204 3.8.0-30-generic #44~precise1-Ubuntu SMP Fri Aug 23 18:32:41 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

$ java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

Here are the errors when I was building it.

target Java: PtsDeviceUi (out/target/common/obj/APPS/PtsDeviceUi_intermediates/classes)
target Java: uiautomator.samples (out/target/common/obj/JAVA_LIBRARIES/uiautomator.samples_intermediates/classes)
Checking API: checkapi-last
Checking API: checkapi-current
Install: out/host/linux-x86/bin/abcc
out/target/common/obj/PACKAGING/public_api.txt:21348: error 12: Class android.telephony.gsm.SmsManager changed static qualifier
out/target/common/obj/PACKAGING/public_api.txt:21348: error 13: Class android.telephony.gsm.SmsManager changed final qualifier
out/target/common/obj/PACKAGING/public_api.txt:21349: error 4: Added public method android.telephony.gsm.SmsManager.divideMessage
out/target/common/obj/PACKAGING/public_api.txt:21350: error 4: Added public method android.telephony.gsm.SmsManager.getDefault
out/target/common/obj/PACKAGING/public_api.txt:21351: error 4: Added public method android.telephony.gsm.SmsManager.sendDataMessage
out/target/common/obj/PACKAGING/public_api.txt:21352: error 4: Added public method android.telephony.gsm.SmsManager.sendMultipartTextMessage
out/target/common/obj/PACKAGING/public_api.txt:21353: error 4: Added public method android.telephony.gsm.SmsManager.sendTextMessage
out/target/common/obj/PACKAGING/public_api.txt:21354: error 5: Added public field android.telephony.gsm.SmsManager.RESULT_ERROR_GENERIC_FAILURE
out/target/common/obj/PACKAGING/public_api.txt:21355: error 5: Added public field android.telephony.gsm.SmsManager.RESULT_ERROR_NO_SERVICE
out/target/common/obj/PACKAGING/public_api.txt:21356: error 5: Added public field android.telephony.gsm.SmsManager.RESULT_ERROR_NULL_PDU
out/target/common/obj/PACKAGING/public_api.txt:21357: error 5: Added public field android.telephony.gsm.SmsManager.RESULT_ERROR_RADIO_OFF
out/target/common/obj/PACKAGING/public_api.txt:21358: error 5: Added public field android.telephony.gsm.SmsManager.STATUS_ON_SIM_FREE
out/target/common/obj/PACKAGING/public_api.txt:21359: error 5: Added public field android.telephony.gsm.SmsManager.STATUS_ON_SIM_READ
out/target/common/obj/PACKAGING/public_api.txt:21360: error 5: Added public field android.telephony.gsm.SmsManager.STATUS_ON_SIM_SENT
out/target/common/obj/PACKAGING/public_api.txt:21361: error 5: Added public field android.telephony.gsm.SmsManager.STATUS_ON_SIM_UNREAD
out/target/common/obj/PACKAGING/public_api.txt:21362: error 5: Added public field android.telephony.gsm.SmsManager.STATUS_ON_SIM_UNSENT
out/target/common/obj/PACKAGING/public_api.txt:21365: error 12: Class android.telephony.gsm.SmsMessage changed static qualifier
out/target/common/obj/PACKAGING/public_api.txt:21366: error 4: Added public constructor SmsMessage()
out/target/common/obj/PACKAGING/public_api.txt:21367: error 4: Added public method android.telephony.gsm.SmsMessage.calculateLength
out/target/common/obj/PACKAGING/public_api.txt:21368: error 4: Added public method android.telephony.gsm.SmsMessage.calculateLength
out/target/common/obj/PACKAGING/public_api.txt:21369: error 4: Added public method android.telephony.gsm.SmsMessage.createFromPdu
out/target/common/obj/PACKAGING/public_api.txt:21370: error 4: Added public method android.telephony.gsm.SmsMessage.getDisplayMessageBody
out/target/common/obj/PACKAGING/public_api.txt:21371: error 4: Added public method android.telephony.gsm.SmsMessage.getDisplayOriginatingAddress
out/target/common/obj/PACKAGING/public_api.txt:21372: error 4: Added public method android.telephony.gsm.SmsMessage.getEmailBody
out/target/common/obj/PACKAGING/public_api.txt:21373: error 4: Added public method android.telephony.gsm.SmsMessage.getEmailFrom
out/target/common/obj/PACKAGING/public_api.txt:21374: error 4: Added public method android.telephony.gsm.SmsMessage.getIndexOnSim
out/target/common/obj/PACKAGING/public_api.txt:21375: error 4: Added public method android.telephony.gsm.SmsMessage.getMessageBody
out/target/common/obj/PACKAGING/public_api.txt:21376: error 4: Added public method android.telephony.gsm.SmsMessage.getMessageClass
out/target/common/obj/PACKAGING/public_api.txt:21377: error 4: Added public method android.telephony.gsm.SmsMessage.getOriginatingAddress
out/target/common/obj/PACKAGING/public_api.txt:21378: error 4: Added public method android.telephony.gsm.SmsMessage.getPdu
out/target/common/obj/PACKAGING/public_api.txt:21379: error 4: Added public method android.telephony.gsm.SmsMessage.getProtocolIdentifier
out/target/common/obj/PACKAGING/public_api.txt:21380: error 4: Added public method android.telephony.gsm.SmsMessage.getPseudoSubject
out/target/common/obj/PACKAGING/public_api.txt:21381: error 4: Added public method android.telephony.gsm.SmsMessage.getServiceCenterAddress
out/target/common/obj/PACKAGING/public_api.txt:21382: error 4: Added public method android.telephony.gsm.SmsMessage.getStatus
out/target/common/obj/PACKAGING/public_api.txt:21383: error 4: Added public method android.telephony.gsm.SmsMessage.getStatusOnSim
out/target/common/obj/PACKAGING/public_api.txt:21384: error 4: Added public method android.telephony.gsm.SmsMessage.getSubmitPdu
out/target/common/obj/PACKAGING/public_api.txt:21385: error 4: Added public method android.telephony.gsm.SmsMessage.getSubmitPdu
out/target/common/obj/PACKAGING/public_api.txt:21386: error 4: Added public method android.telephony.gsm.SmsMessage.getTPLayerLengthForPDU
out/target/common/obj/PACKAGING/public_api.txt:21387: error 4: Added public method android.telephony.gsm.SmsMessage.getTimestampMillis
out/target/common/obj/PACKAGING/public_api.txt:21388: error 4: Added public method android.telephony.gsm.SmsMessage.getUserData
out/target/common/obj/PACKAGING/public_api.txt:21389: error 4: Added public method android.telephony.gsm.SmsMessage.isCphsMwiMessage
out/target/common/obj/PACKAGING/public_api.txt:21390: error 4: Added public method android.telephony.gsm.SmsMessage.isEmail
out/target/common/obj/PACKAGING/public_api.txt:21391: error 4: Added public method android.telephony.gsm.SmsMessage.isMWIClearMessage
out/target/common/obj/PACKAGING/public_api.txt:21392: error 4: Added public method android.telephony.gsm.SmsMessage.isMWISetMessage
out/target/common/obj/PACKAGING/public_api.txt:21393: error 4: Added public method android.telephony.gsm.SmsMessage.isMwiDontStore
out/target/common/obj/PACKAGING/public_api.txt:21394: error 4: Added public method android.telephony.gsm.SmsMessage.isReplace
out/target/common/obj/PACKAGING/public_api.txt:21395: error 4: Added public method android.telephony.gsm.SmsMessage.isReplyPathPresent
out/target/common/obj/PACKAGING/public_api.txt:21396: error 4: Added public method android.telephony.gsm.SmsMessage.isStatusReportMessage
out/target/common/obj/PACKAGING/public_api.txt:21397: error 5: Added public field android.telephony.gsm.SmsMessage.ENCODING_16BIT
out/target/common/obj/PACKAGING/public_api.txt:21398: error 5: Added public field android.telephony.gsm.SmsMessage.ENCODING_7BIT
out/target/common/obj/PACKAGING/public_api.txt:21399: error 5: Added public field android.telephony.gsm.SmsMessage.ENCODING_8BIT
out/target/common/obj/PACKAGING/public_api.txt:21400: error 5: Added public field android.telephony.gsm.SmsMessage.ENCODING_UNKNOWN
out/target/common/obj/PACKAGING/public_api.txt:21401: error 5: Added public field android.telephony.gsm.SmsMessage.MAX_USER_DATA_BYTES
out/target/common/obj/PACKAGING/public_api.txt:21402: error 5: Added public field android.telephony.gsm.SmsMessage.MAX_USER_DATA_SEPTETS
out/target/common/obj/PACKAGING/public_api.txt:21403: error 5: Added public field android.telephony.gsm.SmsMessage.MAX_USER_DATA_SEPTETS_WITH_HEADER
Install: out/host/linux-x86/bin/bcc
Install: out/host/linux-x86/bin/mcld

******************************
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.txt by executing the following command:
         make update-api

      To submit the revised current.txt to the main Android repository,
      you will need approval.
******************************



make: *** [out/target/common/obj/PACKAGING/checkapi-current-timestamp] Error 38
make: *** Waiting for unfinished jobs....
DroidDoc took 105 sec. to write docs to out/target/common/docs/doc-comment-check


I found a workaround at https://groups.google.com/forum/#!topic/android-building/Xw34n7PQJsA.

Now, after flashing the packed image onto sd card via Livesuit. The Android system can't boot into the system. I can see the A20 logo, the Allwinner logo, then it stays black. I have flashed the official android SD card image from Olimex, it worked on my board.

The console output of my built image is here.

U-Boot 2011.09-rc1 (Apr 09 2014 - 11:40:40) Allwinner Technology

CPU:   SUNXI Family
Board: SUN7I-EVB
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
In:    serial
Out:   serial
Err:   serial
--------fastboot partitions--------
-total partitions:11-
-name-        -start-       -size-     
bootloader  : 8000          8000       
env         : 10000         8000       
boot        : 18000         8000       
system      : 20000         100000     
data        : 120000        100000     
misc        : 220000        8000       
recovery    : 228000        10000       
cache       : 238000        100000     
databk      : 338000        80000       
private     : 3b8000        8000       
UDISK       : 3c0000        318000     
-----------------------------------
bootcmd set setargs_mmc
Hit any key to stop autoboot:  0

Starting kernel ...

[    2.571109] init: width = 800
[    2.574450] init: height = 480
[    2.577863] init: s.st_size = 1536000
[    3.683576] init: do_umount: /data
[    4.792730] init: do_umount: /cache
[    5.283996] init: dont need format /dev/block/UDISK
[    5.509863] init: do_umount: /databk
[    5.676451] init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
[    6.005235] i2c i2c-1: Invalid 7-bit I2C address 0x00
[    6.170155] android_usb: already disabled
[    6.175063] init: using deprecated syntax for specifying property 'sys.usb.config', use ${name} instead
[    6.186776] init: using deprecated syntax for specifying property 'sys.usb.config', use ${name} instead
[    7.062886] init: untracked pid 1117 exited
[   10.454112] init: untracked pid 1444 exited
[   17.036518] init: untracked pid 1581 exited
[   17.073726] init: untracked pid 1587 exited
[   20.986759] init: untracked pid 1623 exited
[   20.999946] init: untracked pid 1630 exited
.....
.....



From the console message, I guess it has not finished loading the kernel because there are no android related output yet.

Can anyone help me through this? Or can Olimex provide uboot, kernel, and system.img separately to let me do trouble-shoot where the problem is. Thanks...


Hank


hankgong

OK. I got it work by referring to

http://axonjakarta.wordpress.com/2014/02/14/olimex-a20-android-building-4/

You have to comment out the following two lines...

Just wondering why it's not mentioned in the building guide from Olimex.

#ifneq ($(filter wing%,$(TARGET_DEVICE)),)
include $(call all-makefiles-under,$(LOCAL_PATH))
#endif

dave-at-axon

Hi hankgong,

This was the reason I created my blog to help others as there was quite a few issues and missing files with the Olimex build file and information.

Glad you got it sorted.

I saw this in your message:

******************************
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.txt by executing the following command:
         make update-api

      To submit the revised current.txt to the main Android repository,
      you will need approval.
******************************


I just read about this the other day. It seems this happens if you make any changes to the official Android AOSP source. You got a work around but I'd be cautious that your changes won't have other effects down the line. Seemingly there are ways to get around some of these issues by locating your personal codes in a certain location during the build.

This book was pretty good to getting an understanding of how the system is put together.

http://www.amazon.com/Embedded-Android-Porting-Extending-Customizing/dp/1449308295/ref=sr_1_1?ie=UTF8&qid=1397093606&sr=8-1&keywords=embedded+android

I got the electronic version as it was half the price of the printed book and shipping made it double the book cost.