I followed the instructions on source.android.com to build the Android framework, but when I run the make command I get many errors. I'm running a virtualized 32-bit Ubuntu 11.04 on vmware under a 64-bit Windows Vista.
cat /proc/version
says
Linux version 2.6.38-8-generic (buildd#vernadsky) (gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu3) ) #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011
I have synchronized everything by using:
repo init -u https://android.googlesource.com/platform/manifest
repo sync
and I chose the full-engineering target by using:
lunch full-eng
This is a partial list of the errors I get:
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=4.0.3.0.2.0.1.0
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
OUT_DIR=out
/bin/bash: line 0: cd: cts/tools/cts-native-xml-generator/src/res: No such file or directory
host Java: doclava (out/host/common/obj/JAVA_LIBRARIES/doclava_intermediates/classes)
external/doclava/src/com/google/doclava/ClassInfo.java:20: package com.sun.javadoc does not exist
import com.sun.javadoc.ClassDoc;
^
external/doclava/src/com/google/doclava/ClassInfo.java:62: cannot find symbol
symbol : class ClassDoc
location: class com.google.doclava.ClassInfo
public ClassInfo(ClassDoc cl, String rawCommentText, SourcePositionInfo position,
^
external/doclava/src/com/google/doclava/PackageInfo.java:21: package com.sun.javadoc does not exist
import com.sun.javadoc.*;
^
external/doclava/src/com/google/doclava/ClassInfo.java:1406: cannot find symbol
symbol : class ClassDoc
location: class com.google.doclava.ClassInfo
private ClassDoc mClass;
^
external/doclava/src/com/google/doclava/PackageInfo.java:33: cannot find symbol
symbol : class PackageDoc
location: class com.google.doclava.PackageInfo
public PackageInfo(PackageDoc pkg, String name, SourcePositionInfo position) {
^
external/doclava/src/com/google/doclava/PackageInfo.java:185: cannot find symbol
symbol : class PackageDoc
location: class com.google.doclava.PackageInfo
private PackageDoc mPackage;
^
external/doclava/src/com/google/doclava/apicheck/XmlApiFile.java:28: package com.sun.javadoc does not exist
import com.sun.javadoc.ClassDoc;
^
external/doclava/src/com/google/doclava/Converter.java:19: package com.sun.javadoc does not exist
import com.sun.javadoc.*;
^
external/doclava/
Below is what removed these errors in my case. An offending extraneous '/' at the end.
bad:
export PATH=/home/rev/BIN/jdk-6u34/jdk1.6.0_34/bin/:$PATH
Good:
export PATH=/home/rev/BIN/jdk-6u34/jdk1.6.0_34/bin:$PATH
To fix this on OSX, add the Java bin directory to PATH
export PATH=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin:$PATH
PS: The jdk folder(jdk.1.7.0_51.jdk) might be different for folks as it depends on the version on jdk you have installed. Just use the jdk folder you have installed. The path to bin is the same.
Another cause of this error is if you are using something like jenv to manage multiple Java environments. The Android build tools, by default, search for tools.jar relative to the location of the javac binary. If you are using jenv (or any other tool that hijacks javac), this will not work.
However, you can set the environment variable ANDROID_JAVA_HOME to point to your "real" JDK, in which case the build tools will look in $ANDROID_JAVA_HOME/lib/tools.jar.
The following was my fix in OSX. You have to see what JVMs you have and set it appropriately.
export ANDROID_JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
It is recommended to build Android sources using 64bit Ubuntu Linux. But I do not think that this is a problem in your case. It seems to me that the problem in JDK. Have you installed JDK 6 version on your machine?
I ran into this too, and the issue was that I was missing some Ubuntu packages. Once I followed the instructions in http://source.android.com/source/initializing.html to install the packages, things worked fine.
It's confusing since the error is in Java, but the problem is in the OS.
Finally I Finished My Project with AOPS
There is a error about [doclava] that up mentioned
I check a lot information than I ADD the
export ANDROID_JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
Good Luck...
Related
I am trying to work with the native native for a school project, but when executing the following command in cmd: emulator -version he returned this error to me:
[4640]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ..\emulator\lib64\qt\lib
Could not launch 'C:\Users\gusta..\emulator\qemu\windows-x86_64\qemu-system-i386.exe': No such file or directory
already changed the path in several ways and I think the problem is not this so if someone can help me grateful
There are two emulator executables in the sdk (as of now):
sdk/tools/emulator
sdk/emulator/emulator
The emulator executable has to be added in the PATH variable, in a way so that
sdk/emulator/emulator comes before sdk/tools/emulator
Do this to solve the error:
Edit the system environment variables
Make sure you have set user variable for ANDROID_HOME
Remove any variable /path/to/android-sdk/tools from user and system environment variable.
Save and exit
To resolve this error:
Your system variables should look like below:
“C:\Users\username\AppData\Local\Android\Sdk” -ANDROID_HOME
“C:\Users\username\AppData\Local\Android\Sdk\tools\bin” -PATH
“C:\Users\username\AppData\Local\Android\Sdk\platform-tools” -PATH
“C:\Users\username\AppData\Local\Android\Sdk\emulator” - PATH
“C:\Users\username\AppData\Local\Android\Sdk\tools" -PATH
This worked for me.
Based on the answer of IronBlossom.
On mac these are the important environment variables that need to be adjusted.
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
Make sure that emulator comes before tools
I am facing the following issue when trying to compile a c program using openssl for android x-86. I set up the environment variables as follows using the following script:
setenv-android.sh
After running the script I have the following environment.
./setenv-android_x86.sh
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
Error: FIPS_SIG does not specify incore module. Please edit this script.
ANDROID_NDK_ROOT: /opt/android-ndk-r9d-x86
ANDROID_ARCH: arch-x86
ANDROID_EABI: x86-4.6
ANDROID_API: android-18
ANDROID_SYSROOT: /opt/android-ndk-r9d-x86/platforms/android-18/arch-x86
ANDROID_TOOLCHAIN: /opt/android-ndk-r9d-x86/toolchains/x86-4.6/prebuilt/darwin-x86_64/bin
FIPS_SIG:
CROSS_COMPILE: i686-linux-android-
ANDROID_DEV: /opt/android-ndk-r9d-x86/platforms/android-18/arch-x86/usr
However when trying to compile with the following command I get the following error:
pwd
/opt/android-ndk-r9d-x86/bin
./i686-linux-android-gcc Test.c -o test -lcrypto
fatal error: openssl/conf.h: No such file or directory
When I locate for the openssl/conf.h I see the file is available in many places:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/openssl/conf.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/openssl/conf.h
/data/local/arm/ssl/include/openssl/conf.h
/data/local/ssl/include/openssl/conf.h
/openssl/include/openssl/conf.h
/openssl-1.0.1e/include/openssl/conf.h
/openssl-1.0.1g/include/openssl/conf.h
/opt/local/include/openssl/conf.h
/usr/include/openssl/conf.h
/usr/local/include/openssl/conf.h
/usr/local/ssl/android-14/include/openssl/conf.h
/usr/local/ssl/android-18/include/openssl/conf.h
/usr/local/ssl/android-18-x86/include/openssl/conf.h
/usr/local/ssl/include/openssl/conf.h
I think the proper path is this:
/usr/local/ssl/android-18-x86/include/openssl/conf.h
I tried with the -L option but with no luck.
-L/usr/local/ssl/android-18-x86/include/
Can anybody please explain how to setup the path properly to solve this issue. (finally there is no issue with the C code as it compiles properly with gcc)
You are compiling your code using the Android NDK, which creates a "virtual" compiling environment by placing everything you need to compile for android into the ${ANDROID_SYSROOT} directory.
Those directories you listed are outside that sysroot, and therefore are not available to the build system, hence the errors. You must install OpenSSL for Android and putting the resulting headers and binaries there. You might follow this guide to assist you in that.
C:\Users\saurabh.trivedi\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q
.js:126
throw e;
^
Error: ERROR : executing command 'ant', make sure you have ant installed and add
ed to your path.
at C:\Users\saurabh.trivedi\.cordova\lib\android\cordova\3.3.0\bin\lib\check
_reqs.js:47:27
I faced similar error. To overcome the issue I downloaded and installed apache-ant-1.9.2 into the "C:\Program Files\apache-ant-1.9.2\" folder and added the "C:\Program Files\apache-ant-1.9.2\bin\;" to the "Path" environment variable.
Note, that additional environment variables (ANDROID_HOME) and paths to JRE, and Android SDK are also should be set for correct Cordova CLI operation under Windows for me:
ANDROID_HOME = C:\Program Files (x86)\ADT\sdk
Path = ...<some paths for other programs>... + C:\Windows\Microsoft.NET\Framework\v4.0.30319\;C:\Program Files\apache-ant-1.9.2\bin\;C:\Program Files (x86)\Java\jre7\bin\;C:\Program Files (x86)\ADT\sdk\tools\
I faced the same issue. here is the exact solution.
Control Panel\System and Security\System\
click advanced system settings
click Environment variables
In system variables :
ANT_HOME: C:\ant
path: %ANT_HOME%\bin;
This will work..
I am trying to use boost library with Android ndk in Eclipse with Windows. I tried to follow this tutorial
I am stuck in the step with "bjam" command in cygwin.
bjam --without-python --without-serialization toolset=gcc-android4.4.3 link=static runtime-link=static target-os=linux --stagedir=android
Error: bjam command not found.
What is bjam? Also I used the boost 1.53 along ndk r8e. Can someone help me with this please?
Android NDK is no longer dependent on Cygwin, so you can build Boost with the NDK from within Windows command prompt (cmd).
In order to make Boost.Build find the NDK, edit boost\tools\build\v2\user-config.jam file and append the following text:
import os ;
androidNDKRoot = C:/android-ndk-r8e ; # put the relevant path
using gcc : android :
$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi-g++ :
<compileflags>--sysroot=$(androidNDKRoot)/platforms/android-9/arch-arm
<compileflags>-mthumb
<compileflags>-Os
<compileflags>-fno-strict-aliasing
<compileflags>-O2
<compileflags>-DNDEBUG
<compileflags>-g
<compileflags>-lstdc++
<compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/include
<compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi/include
<compileflags>-D__GLIBC__
<compileflags>-D_GLIBCXX__PTHREADS
<compileflags>-D__arm__
<compileflags>-D_REENTRANT
<archiver>$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi-ar
<ranlib>$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi-ranlib
;
Certainly, instead of c:/android-ndk-r8e you have to put the right location of the NDK on your PC.
Besides, you can select more recent platform API, instead of android-9.
Also note that the NDK supplies several tool-chains, and the above settings point to gcc-4.7. If you prefer to build boost with some other tool-chain, change arm-linux-androideabi-4.7 to the relevant path.
After you've put the configuration in user-config.jam, open cmd, cd to the directory where Boost resides, and invoke bootstrap. Then invoke b2 like this (for example):
b2 --without-python --without-serialization threading=multi link=static runtime-link=static toolset=gcc-android target-os=linux threadapi=pthread --stagedir=android stage
UPDATE: As of 11/2015, older NDK toolchains seem to have issues with the newer Boost versions, causing compiler crash, so consider using a more recent compiler. To do this, just change every 4.7 occurrence in the above script to 4.9. Also, it's worth compiling with a more recent Android API (eg. andoroid-9 -> andoroid-16 or so).
I downloaded android source from source.android.com and followed the instruction to setup build environment on MAC OS X, Everything went fine except when i run make it gives me following error
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=darwin
HOST_BUILD_TYPE=release
BUILD_ID=ITL41D
============================================
host C++: aapt <= frameworks/base/tools/aapt/AaptAssets.cpp
frameworks/base/tools/aapt/AaptAssets.cpp:2161:38: warning: unused parameter 'bundle' [-Wunused-parameter]
AaptAssets::slurpResourceZip(Bundle* bundle, const char* filename)
^
In file included from frameworks/base/tools/aapt/AaptAssets.cpp:5:
In file included from frameworks/base/tools/aapt/AaptAssets.h:10:
In file included from frameworks/base/include/utils/AssetManager.h:25:
frameworks/base/include/utils/KeyedVector.h:193:17: error: use of undeclared identifier 'indexOfKey'
ssize_t i = indexOfKey(key);
^
this->
frameworks/base/tools/aapt/AaptAssets.h:446:46: note: in instantiation of member function 'android::DefaultKeyedVector<android::String8, android::sp<AaptSymbols> >::valueFor' requested here
sp<AaptSymbols> sym = mNestedSymbols.valueFor(name);
^
frameworks/base/include/utils/KeyedVector.h:66:29: note: must qualify identifier to find this declaration in dependent base class
ssize_t indexOfKey(const KEY& key) const;
^
1 warning and 1 error generated.
make: *** [out/host/darwin-x86/obj/EXECUTABLES/aapt_intermediates/AaptAssets.o] Error 1
I just started in android so do not have any clue, any small help also would be appreciated
Just to expand on Pete's answer, in case anyone really wants to know:
The indexOfKey is defined in DefaultKeyVector's parent class, KeyedVector. For class templates, a function call is resolved during compile-time, not during run-time. The error happens because at the point indexOfKey is called, the compiler wouldn't know where that template function might be located. Here is how the base and derived classes look like:
template <typename KEY, typename VALUE>
class KeyedVector
{
...
ssize_t indexOfKey(const KEY& key) const;
...
template <typename KEY, typename VALUE>
class DefaultKeyedVector : public KeyedVector<KEY, VALUE>
{
...
And the offending call:
template<typename KEY, typename VALUE> inline
const VALUE& DefaultKeyedVector<KEY,VALUE>::valueFor(const KEY& key) const {
ssize_t i = indexOfKey(key);
...
Most likely, using the older MacOS SDK compiler (or other compilers) works because it was probably just guessing the function exists in some base class, instead of failing. However, that is not standard behavior.
More info from this clang entry, and from the C++ FAQ.
I finally figured out the problem.
There's an error in the sourcecode of frameworks/base/include/utils/KeyedVector.h:193
Some of the member functions require Scope resolution operator "this->" to build the android source on MAC OS X Lion with xcode 4.3.x and on gcc version 4.9.2 (Debian 4.9.2-10).
Without scope resolution operator compiler will not be able to identify the existence of the function.
Open frameworks/base/include/utils/KeyedVector.h
Change the line 193 from:
ssize_t i = indexOfKey(key);
to
ssize_t i = this->indexOfKey(key);
and Android 4.0.1 compiles.
To build ICS on newer GCC versions, you must apply these patches:
https://groups.google.com/forum/#!msg/android-building/2EwtWQTqjdI/fbZlzXErscwJ
I faced this problem several times when building Browser for Android 4.0.3 with make -j Browser on MAC OS X 10.8.4. I dont have any problem with Android 4.2.1.
So my solution is
make CC=gcc CXX=g++ -j Browser
Hope it helps