You are not logged in.

#1 2014-11-18 17:37:41

franciscokurpiel
Member
Registered: 2014-11-18
Posts: 6
Website

Can't build Android 5 (Lollipop) on Arch Linux

After following the instructions on

https://wiki.archlinux.org/index.php/an … ng_android

The build failed with a python message, as if I where running with python 3:

<snip>
target thumb C++: libnativebridgetest <= art/test/115-native-bridge/nativebridge.cc
target thumb C++: libverifier <= bootable/recovery/asn1_decoder.cpp
target thumb C++: verifier_test <= bootable/recovery/verifier_test.cpp
target thumb C++: verifier_test <= bootable/recovery/asn1_decoder.cpp
target thumb C++: verifier_test <= bootable/recovery/verifier.cpp
mkdir -p out/target/common/obj/APPS/CtsSecurityTestCases_intermediates/assets/
cts/tools/selinux/src/gen_SELinux_CTS.py out/target/product/hammerhead/obj/ETC/general_sepolicy.conf_intermediates/general_sepolicy.conf out/target/common/obj/APPS/CtsSecurityTestCases_intermediates/assets/selinux_policy.xml neverallow_only=t
target thumb C++: verifier_test <= bootable/recovery/ui.cpp
  File "cts/tools/selinux/src/gen_SELinux_CTS.py", line 29
    print usage
              ^
SyntaxError: Missing parentheses in call to 'print'
cts/tests/tests/security/Android.mk:50: recipe for target 'out/target/common/obj/APPS/CtsSecurityTestCases_intermediates/assets/selinux_policy.xml' failed
make: *** [out/target/common/obj/APPS/CtsSecurityTestCases_intermediates/assets/selinux_policy.xml] Error 1
make: ** Esperando que outros processos terminem.

#### make failed to build some targets (26:45 (mm:ss)) ####

Please note, that I used virtualenv2, as requested, and if as ask python version before or after building the result is:

(venv)[xyko@arch-batman android]$ python --version
Python 2.7.8

Random additional info:

  • bash was used, instead of zsh to avoid warning on lunch;

  • Arch Linux 64 bit (fully updated);

  • Required packages: all installed, as requested on the arch wiki;

  • Java: Set to openjdk 1.7.0_71, JAVA_HOME=/usr/lib/jvm/java-7-openjdk

  • Python: Set using virtualenv2 to 2.7.8

  • repo init to branch android-5.0.0_r5

  • lunch invoked for the config aosp_hammerhead-userdebug

Last edited by franciscokurpiel (2014-11-19 18:10:41)

Offline

#2 2014-11-18 17:49:24

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,345

Re: Can't build Android 5 (Lollipop) on Arch Linux

SyntaxError: Missing parentheses in call to 'print'

I would say that Python 3 is running.  You might want to check any python scripts to ensure they are invoking the correct interpreter.

Edit:  Actually, you did say that, didn't you.   BTW, Welcome to Arch Linux

Last edited by ewaller (2014-11-18 17:50:44)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2014-11-18 17:56:47

franciscokurpiel
Member
Registered: 2014-11-18
Posts: 6
Website

Re: Can't build Android 5 (Lollipop) on Arch Linux

Thank you.

I'm an Arch user for a few years, but I never felt the need to post a question, up to now.

Did somebody managed to successful build Android 5 on Arch?

Offline

#4 2014-11-18 18:57:17

FlyingHappy
Member
From: Cincinnati, OH
Registered: 2011-04-18
Posts: 192

Re: Can't build Android 5 (Lollipop) on Arch Linux

One thing that sticks out is that you are using openJDK.  I believe you will need to install the Oracle JDK from the aur.  The ohter thing I found (haven't build android for about a year) is that I actually had to look at some of the symlinking for python (not at my arch box right now but I believe it was /usr/bin/python had to be symlinked to /usr/bin/python-2.7 or something similar) as well as a couple of other python files.  It's not a perfect suggestion, but it should be a starting point for you.

Offline

#5 2014-11-19 12:55:46

franciscokurpiel
Member
Registered: 2014-11-18
Posts: 6
Website

Re: Can't build Android 5 (Lollipop) on Arch Linux

Updating the python link helped a lot, but I still have compilation errors. I didn't implemented the oracle java suggestion, at least yet.

host C++: libLLVMBitWriter_2_9_32 <= frameworks/compile/slang/BitWriter_2_9/ValueEnumerator.cpp
host C++: libLLVMBitWriter_2_9_func_32 <= frameworks/compile/slang/BitWriter_2_9_func/BitcodeWriter.cpp
host C++: libLLVMBitWriter_2_9_func_32 <= frameworks/compile/slang/BitWriter_2_9_func/BitcodeWriterPass.cpp
host C++: libLLVMBitWriter_2_9_func_32 <= frameworks/compile/slang/BitWriter_2_9_func/ValueEnumerator.cpp
Gyp timestamp: out/target/product/hammerhead/obj/GYP/v8_tools_gyp_v8_gyp_intermediates/v8.stamp
mkdir -p /home/xyko/android/out/target/product/hammerhead/obj/GYP/shared_intermediates/blink/bindings/core/v8; cd external/chromium_org/third_party/WebKit/Source/bindings/core/v8; python -S ../../scripts/idl_compiler.py --cache-dir "/home/xyko/android/out/target/product/hammerhead/obj/GYP/shared_intermediates/blink/bindings/scripts" --output-dir "/home/xyko/android/out/target/product/hammerhead/obj/GYP/shared_intermediates/blink/bindings/core/v8" --interfaces-info "/home/xyko/android/out/target/product/hammerhead/obj/GYP/shared_intermediates/blink/bindings/modules/InterfacesInfoModules.pickle" --write-file-only-if-changed 0 ../../../core/animation/Animation.idl
Traceback (most recent call last):
  File "../../scripts/idl_compiler.py", line 36, in <module>
    from optparse import OptionParser
ImportError: No module named optparse
external/chromium_org/third_party/WebKit/Source/bindings/core/v8/bindings_core_v8_generated_individual.target.linux-arm.mk:32: recipe for target 'out/target/product/hammerhead/obj/GYP/shared_intermediates/blink/bindings/core/v8/V8Animation.cpp' failed
make: *** [out/target/product/hammerhead/obj/GYP/shared_intermediates/blink/bindings/core/v8/V8Animation.cpp] Error 1
make: ** Esperando que outros processos terminem.

#### make failed to build some targets (56:34 (mm:ss)) ####


real    56m33.864s
user    332m32.061s
sys     24m12.547s

Offline

#6 2014-11-19 21:13:51

hamzahrmalik
Member
Registered: 2014-11-19
Posts: 2

Re: Can't build Android 5 (Lollipop) on Arch Linux

Exact same issue, with lollipop on arch
Using virtualenv for python 2.7 and openjdk 7 with it

Offline

#7 2014-11-20 12:20:44

franciscokurpiel
Member
Registered: 2014-11-18
Posts: 6
Website

Re: Can't build Android 5 (Lollipop) on Arch Linux

Success! The wiki had some errors. I fixed the errors and updated with android-5-specific instructions. Summarizing:

  • FlyingHappy's suggestion about updating /usr/bin/python link, so it points to python 2.7, seams to be mandatory - virtualenv2 is necessary, but not enough. Details on the wiki

  • The workaround on the wiki regarding missing modules was wrong. I've fixed them

  • Android 5 demands jdk7, not jdk6. Wiki updated

  • I tried Oracle JDK and the Build script (make -j8 step) failed immediately. The default Arch Open JDK7 is exactly the one Google wants

  • I didn't liked the respository sync instructions, so I updated to include more info about the branch

  • Instructions on the 'build' step made me loose a lot of time. So I added info about how to list and choose the device.

  • Some people may like to flash it to devices, so I added instructions

Last edited by franciscokurpiel (2014-11-20 12:24:53)

Offline

#8 2014-11-20 14:24:10

FlyingHappy
Member
From: Cincinnati, OH
Registered: 2011-04-18
Posts: 192

Re: Can't build Android 5 (Lollipop) on Arch Linux

Glad to hear you got it working.  Awesome job on thinking to update the wiki too!

Offline

#9 2014-11-20 21:11:34

hamzahrmalik
Member
Registered: 2014-11-19
Posts: 2

Re: Can't build Android 5 (Lollipop) on Arch Linux

Thanks for updating wiki helps a lot

Offline

#10 2014-11-22 14:49:53

franciscokurpiel
Member
Registered: 2014-11-18
Posts: 6
Website

Re: Can't build Android 5 (Lollipop) on Arch Linux

Well, some punk reverted the /usr/bin/python link hack saying

Alad wrote:

Remove harmful hack, there's better ways to approach this (even if putting a temporary link in /usr→local: bin), other changes also dubious

So if you follow the wiki now you won't be able to compile Android 5. Well, your removal is harmful if you're trying to compile Android.

Dude, if you know any better don't just destroy the knowledge, as you did. Just explain the better way you say you know. Everybody is here to learn, after all.

And what about you trying to build Android youself before saying changes also dubious?

Offline

#11 2014-11-22 16:15:30

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: Can't build Android 5 (Lollipop) on Arch Linux

It's generally accepted that symlinking to get other things to work is dubious. I can understand why they wouldn't allow that in the Wiki. By all means, a forum search will turn up your suggestions and instructions so users can make up their own mind, so the information is out there at least.

And refrain from calling the staff/members names, please.

Last edited by mrunion (2014-11-22 16:21:15)


Matt

"It is very difficult to educate the educated."

Offline

#12 2014-11-22 16:50:56

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,345

Re: Can't build Android 5 (Lollipop) on Arch Linux

franciscokurpiel,

First and foremost,  again allow me to welcome you to Arch Linux.  You clearly bring a lot to the table and will be an asset to the community.  But, a couple things.  Arch Linux is really a bunch of parallel projects flying in loose formation.  The forums are pretty much independent from the wiki.  As are the AUR, the mail lists, the IRC channels, etc...   So the forums are not the best place for discussion about wiki content.  We will point out when something belongs in the wiki, and we really do appreciate when people do take the initiative to provide input.  Thank you.

We love a good argument, but we ask that you keep it technical and not ever make it personal.  Also, be ware the Alad is a staff member https://wiki.archlinux.org/index.php/Ar … aintainers.   We specifically ask for respect of the staff

Thanks


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#13 2014-11-22 18:56:06

franciscokurpiel
Member
Registered: 2014-11-18
Posts: 6
Website

Re: Can't build Android 5 (Lollipop) on Arch Linux

Thank-you and sorry. I'll try to follow the rules and conventions. It may not looks like so, but I was trying to keep each subject on the right place and just linking when I thought was appropriated.

I brought the subject here (with excessive animosity, I admit) because the solution to the subject of this thread was reverted and won't work anymore. I believe readers must know.

I'll keep technical because it's appropriated, is well remembered by ewaller, and not because he is staff.

mrunion, about editing symlinks being a dubious approach, I'll like to know the alternative. How can someone solve the error on the first message of these thread without using the FlyingHappy's suggestion?

Last edited by franciscokurpiel (2014-11-22 18:57:43)

Offline

#14 2014-12-11 12:28:50

jpamills
Member
Registered: 2013-03-12
Posts: 13

Re: Can't build Android 5 (Lollipop) on Arch Linux

Just checking in here to say thanks to franciscokurpiel and FlyingHappy. Updating the symlink was needed for me as well.

EDIT: I also encountered the build error in post #5. It is the same as here: https://code.google.com/p/chromium/issu … ?id=425932 ... figuring out how to fix it, will edit when solved.

EDIT 2: I had to remove the line containing "-S" in the file "external/chromium_org/third_party/WebKit/Source/bindings/core/v8/generated.gyp" immediately after the repo sync and before building anything.

Last edited by jpamills (2014-12-12 21:35:06)

Offline

Board footer

Powered by FluxBB