I got the following error while compiling android source code for the first time on Ubuntu 12.04, I have not chenged the source code at all abd suggested command in error "make update-api" didn't help me
repo sync
source build/envsetup.sh
lunch full-eng
make
http://pastebin.com/5gEjkTLV
As the problem is in the java part here is my java installation information. I downloaded jdk-6u39-linux-x64.bin and run it and copy the file into /usr/lib/jvm/jdk1.6.0_39/ and set the this java as the main java application by :
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_39/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_39/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_39/bin/javaws" 1
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
here is the result:
echo $JAVA-HOME
/usr/lib/jvm/jdk1.6.0_39/
java -version
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
javac
javac 1.6.0_39
Look at the dump again. you need to regenerate api/current.txt. You need to run make update-api to regenerate that file. You should be able to build again after that .
******************************
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.
******************************
Related
I've successfully downloaded the CyanogenMod 10 source tree by syncing the latest repo. I've also installed the Java JDK properly and already set a ANDROID_JAVA_HOME variable but still getting those errors while executing this command "make -j4 otatools"
/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Permission denied
/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Permission denied
/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Permission denied
/bin/bash: build/core/find-jdk-tools-jar.sh: Permission denied
build/core/config.mk:348: *** Error: could not find jdk tools.jar, please install JDK6, which you can download from java.sun.com. Stop.
I used these steps to register the downloaded version of Java as an alternative, and switching it to be used as the default
update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_60/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_60/bin/javac 1
update-alternatives --set java /opt/jdk1.7.0_60/bin/java
update-alternatives --set javac /opt/jdk1.7.0_60/bin/javac
Output for java -version
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
Output for ANDROID_JAVA_HOME
echo $ANDROID_JAVA_HOME
/opt/jdk1.7.0_60/bin/
My Machine configuration is Debian Wheezy 64 bit with 4GB RAM
Errrrrrrrm, correct me if I'm wrong but looking at your update-alternatives, you are actually setting your Java version to JDK 7
First make sure you have actually Java 6 installed, then try running:
sudo update-alternatives --config java
You should see something like this:
Selection Pad Prioriteit Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 auto mode
1 /usr/lib/jvm/java-6-oracle/jre/bin/java 1 manual mode
Now type in the version you would like to use, for me that is : 1
type enter and then run java -version
Tell me if it worked!
EDIT: Whoops didn't even notice that this is a thread from 5 months ago...
Sorry for that!
Still Other people who have your problem could find my answer usefull though
I need to modify Chromium for Android. Because I have little or no experience with Linux, I've been having difficulties with getting it to compile and now I'm stumped for good.
I've been following the steps here: https://code.google.com/p/chromium/wiki/AndroidBuildInstructions
This is roughly a list of commands that I have executed on a fresh Ubuntu 13.04 (raring) installation:
sudo apt-get install git-svn subversion g++ gtk+-2.0 gyp ant
# here I download depot_tools into the home dir
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH"\:`pwd`/depot_tools
# here I download the Chromium source code into ~/src
fetch android --nosvn=True
sudo ./src/build/install-build-deps.sh
gclient sync --nohooks
# download "jdk-6u38-linux-x64.bin" from the Oracle website, then
chmod 755 ~/Downloads/
sudo mkdir /usr/lib/jvm
cd /usr/lib/jvm && sudo /bin/sh ~/Downloads/jdk-6u38-linux-x64.bin -noregister
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_38/bin/javac 50000
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_38/bin/java 50000
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_38/bin/javaws 50000
sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk1.6.0_38/bin/javap 50000
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws
sudo update-alternatives --config javap
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_38
export PATH=$JAVA_HOME/bin\:"$PATH"
unset CC
unset CXX
cd ~/src
./build/android/envsetup.sh
# edit install-build-deps-android.sh
# replacing "ant1.8" with "ant" (a hack of mine)
sudo ./build/install-build-deps-android.sh
export GYP_DEFINES="target_arch=x64"
Now I'm missing android_gyp and I can't find it anywhere in the ~/src folder.
This is where it says I should execute it:
http://code.google.com/p/chromium/wiki/AndroidBuildInstructions#Compile
If I try to skip the command, it says that I don't have "build.ninja", so yeah...
Could anyone please help me? I'm new at this.
Thank you
./build/android/envsetup.sh
Should be:
. build/android/envsetup.sh
The dot + space sources the script so that any bash definitions will be kept around after the script runs. See: http://ss64.com/bash/source.html.
android_gyp is a bash function defined in envsetup.sh, so sourcing it provides the definition in your shell.
I tried installing Android Studio on a Samsung Chromebook Series 3 with an ARM processor, but I'm stuck with the Java. Any help would be appreciated.
Downloaded and extracted Android Studio
Downloaded and extracted Java 1.7.0_21 JDK ARM
Completed the below commands except the javaws commands as they error-ed out doesn't exist
tar xzvf ~/Downloads/jdk-7u21-linux-arm.tar.gz sudo mv jdk1.7.0_21/ /usr/lib/jvm/
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_21/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_21/bin/javac 1 sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7.0_21/bin/javaws 1
sudo update-alternatives --config java
sudo update-alternatives --config javaws
I tried the JAVA_HOME=/usr/lib/jvm/jdk1.7.0_21 command and it would still give me the error.
Please check whether your system configuration is 32bit or 64bit and according to that download respective JDK and provide its path in JAVA_HOME
No It's not in the studio. What you should do:
Change your JRE to use the JRE found inside your JDK
Add tools.jar that can be found in the JDK Libraries folder
That's it. It's a known issue, but they're working on it. But this is a workaround.
Couple of things, you can check:
1. check jdk is in your path
2. from your command line, execute this command: java -version
and see what it shows
3. and execute this command: javac -version
If both command gives no error then try again otherwise fix those issue.btw, Do not forget to check your system configuration to make sure that it is 32bit or 64 bit
I've been trying all day to compile the Android source code on my Ubuntu 12.04 64bit OS.
For some reason, I'm stuck on the phase of having the Sun/Oracle JDK 1.6 version installed. I've been trying many commands (and the official link of course) and I end up either having nothing, having JDK 1.7 or OpenJDK, or not having the jdk-tools.
What are the exact steps to successfully compile the code (or part of it) using JDK? I'm stuck at the phase of "make j4" on this link.
installing the proper java version(1.6) for android do the below
1) Installing JDK
Since Sun JDK is no longer in Ubuntu’s main package repository, we have to manually install it in ubuntu 12.04 from oracle website
Please go the below link and download the JDK
http://www.oracle.com/technetwork/java/javase/downloads/jdk6-downloads-1637591.html
Follow the below steps to install the java and configuring it for the usage
$ chmod +x jdk-6u33-linux-x64.bin
$ sudo ./jdk-6u33-linux-x64.bin
$ sudo mv jdk1.6.0_33 /usr/lib/jvm/
$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_33/bin/java 1
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_33/bin/javac 1
$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_33/bin/javaws 1
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config javaws
To verify the isntallation is proper do the belwo steps. It should now show that the Sun JDK is running instead of IcedTea
$ java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)
For compiling android on ubuntu 12.04 and installing the proper java version
visit http://www.embeddedcircle.com/android-compilation-in-ubuntu-12-04-lts-precise-for-pandaboard/
thanks
dino
In Ubuntu, when you download the jdk (32-bit version if it is for android programming, and in my opinion better the tar.gz than the .rpm one) it is important to 'install' and also to export using the commands you can see in the page of Oracle if I'm not wrong. You also need to go to your editor (Eclipse, Netbeans or which one?) and add the new Java platform to make sure you are using the version of the JDK you want to.To export means that you can compile the project when you want to.If not,you have to go to the java directory and inside the /bin folder do the command (probably with sudo at the beginning) to compile your project.
P.S.: You can find how to export here
I got this same problem. Some people reporting even JDK SE will see errors.
Another work-around is modifying two lines of source code, see here:
https://github.com/CyanogenMod/android_external_guava/commit/c8b97210aa31c9b80b5fd136d8617ebe4e731e09
I successfully Downloaded the source code for Android 4.0.3.
But I am unable to compile it on my machine.
My Machine configuration is UBUNTU 11.10 64 bit,4 GB RAM
When I am running the lunch command getting the following error.
/bin/bash: prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc: Permission denied
/bin/bash: prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc: Permission denied
/bin/bash: prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc: Permission denied
/bin/bash: build/core/find-jdk-tools-jar.sh: Permission denied
build/core/config.mk:268: *** Error: could not find jdk tools.jar, please install JDK6, which you can download from java.sun.com. Stop.
** Don't have a product spec for: 'full'
** Do you have the right repo manifest?
JDK is already in a path.When I Run the Command java -version I am getting following OutPut
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
Can Anyone Help to proceed?
If you check the script build/core/find-jdk-tools-jar.sh, you can see that it first checks an environment variable called ANDROID_JAVA_HOME. If you set the ANDROID_JAVA_HOME environment variable to your JDK path, it should fix this error.
This is caused by build/core/find-jdk-tools-jar.sh with wrong result for "which javac".
Usually, this is caused by javac is not configured as a alternative for system. So there is no link of /usr/bin/javac for your javac.
Please setup the alternative for javac:
$sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_32/bin/javac" 1
note: the installed directory of javac for me is "/usr/lib/jvm/jdk1.6.0_32/", you can change it by your configuration.
You are trying to run 32-bit binaries (the NDK toolchain) on a 64-bit OS, so first make sure you have the 32-bit compatibility libs installed:
sudo apt-get install ia32-libs
If that doesn't solve it, then make sure you do have execute permission on those files.
-Open terminal
-type: chmod 777 WORKING_DIR -R
-this will fix the error