开发者

Android platform compile problem [closed]

开发者 https://www.devze.com 2022-12-21 11:46 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

I'm compiling the android platform on my desktop.

But, i have a problem:

============================================ 
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=MASTER
============================================
/bin/bash: bison: command not found
Checking build tools versions...
************************************************************
You are attempting to build with the incorrect version of java.

Your version is: java version "1.6.0".

The correct version is: 1.5.   Please follow the machine setup

instructions at http://source.android.com/download

************************************************************ build/core/main.mk:111: *** stop. Stop.

I don't know exactl开发者_高级运维y how to compile it.

my environment is Centos5.

If it can't use java 1.6, how to be parallel between java1.6 and java1.5?


You must use Java 1.5 to compile Android.


I don't work on Android, but the Javac compiler can be told to use an older version of the Java platform:

javac -source 1.4 -target 1.4

Hopefully that will at least get you in the right direction.


I faced the same problem. The issue is that android code is not compatible properly with java 1.6, so the default biild abords if the java version is >1.5 . Unfortunately, all java computers are usually updated to 1.6 version of java automatically.

So, for compiling Android you will need to remove the 1.6 version and install the 1.5 version of java.

uninstalling is straighforward. just use your system tools for rpm management to remove.

installing 1.5 is a bit of a bother. add an older repository to the sources list, and install the sun-java5-sdk from it.

Hope this helps. Sorry I cant give exact steps as I do not have a centOS system on hand, but I have compiled it on an Ubuntu system.

Alternatively, you can change the build system and fix the java errors :)


Unfortunately it's worse than that, because later versions ([2.3 / API 9] ...) of Android require Java 1.6 and won't work with 1.5 - which seems a little perverse, making different versions of your build system dependent on different versions of a language tool, with no forward or backward compatibility.
I guess the Google people have a different computer or VM (or environment settings ...) for their separate builds, but it's not what I'd call good engineering practice; I always strive to keep things as cross-version compatible as possible ! Rant over ...

Apparently it was all done originally to accommodate some MacOs developers to ensure their builds weren't broken:

http://www.mail-archive.com/android-developers@googlegroups.com/msg48338.html


Check "Setting up your machine" section here.


As of today, Apr 27, 2011, when I try to make android, it says Java 1.6 is the correct version. However the instruction web page is not yet updated.


You can install java1.5 by going to this link http://processors.wiki.ti.com/index.php/TI-Android-GingerBread-2.3-DevKit-1.0_DeveloperGuide#For_Ubuntu_on_32-bit_machines

and choose your java version

sudo update-alternatives --config java


There's some difference in code between 1.5 and 1.6...

Exactly, 1.5 uses @ Anotations like these -> @Override, @Deprecated, @SuppressWarnings. Maybe Android developers loved these... But maybe Java platform developers hated it.(I think)

Sometimes error message occurs like this.

You are attempting to build with the incorrect version of java.

===================================================
Your version is: java version "1.5.0.19".

The correct version is: 1.6.   Please follow the machine setup instructions at
    http://source.android.com/download
===================================================

But this message is wrong itself.

In your case, the error message is adequate. Change java6 to java-1.5.0 as an alternative. search the solution. That should be an enough answer...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号