[GUIDE]Compile AOKP and CyanogenMod for HTC Sensation on Ubuntu (ONLY 64-bit)

Search This thread

sparksco

Inactive Recognized Developer
Feb 27, 2010
10,048
8,861
docs.google.com
I'm glad the title removed the word KANG :) Kang shouldn't be included in the mod version either I.m.o. by cm because it means stolen leaked source code. How can you steal open source code that is on github?
 

drewtang

Senior Member
Jun 29, 2010
834
232
Boise
Error message

i keep getting this error message at the very end of the process

Code:
running:  java -Xmx2048m -jar out/host/linux-x86/framework/signapk.jar -w build/target/product/security/testkey.x509.pem build/target/product/security/testkey.pk8 /tmp/tmpamHamk out/target/product/maguro/aokp_maguro-ota-eng.mandrew.zip
Could not create the Java virtual machine.

   ERROR: signapk.jar failed: return code 1

I know it's related to Java, I have followed the insctuctions in the OP, and tried redoing the steps related to java several times, and keep getting the same error. Is there something I'm doing wrong?

Edit:I know this shows I'm building aokp, but I was getting the same issue when building for the sensation as well..
 
Last edited:

AntiBillOS

Senior Member
Jun 21, 2011
796
1,447
Запорожье
i keep getting this error message at the very end of the process

Code:
running:  java -Xmx2048m -jar out/host/linux-x86/framework/signapk.jar -w build/target/product/security/testkey.x509.pem build/target/product/security/testkey.pk8 /tmp/tmpamHamk out/target/product/maguro/aokp_maguro-ota-eng.mandrew.zip
Could not create the Java virtual machine.

   ERROR: signapk.jar failed: return code 1

I know it's related to Java, I have followed the insctuctions in the OP, and tried redoing the steps related to java several times, and keep getting the same error. Is there something I'm doing wrong?

Edit:I know this shows I'm building aokp, but I was getting the same issue when building for the sensation as well..

You building is done but complier cant sing you build zip update.
 

Vorbeth

Senior Member
Mar 10, 2006
2,180
2,355
I'm glad the title removed the word KANG :) Kang shouldn't be included in the mod version either I.m.o. by cm because it means stolen leaked source code. How can you steal open source code that is on github?

It's actually in their build script!!

I'm actually getting annoyed by CM, they apparently are working on msm8660, but most of the updates they are merging are either broken on break msm8660.
 
  • Like
Reactions: sparksco

sparksco

Inactive Recognized Developer
Feb 27, 2010
10,048
8,861
docs.google.com
It's actually in their build script!!

I'm actually getting annoyed by CM, they apparently are working on msm8660, but most of the updates they are merging are either broken on break msm8660.

Yeah I just think it's lame they put KANG in the mod version script in vendor. That's why for my repo I made my own vendor repo and build repo so I can build it the way I want and not have that word KANG in the mod versions and .zips. and yes I agree it does seem like they break a lot of things for no reason at all when they know what they are doing!
 

mpmilestogo

Senior Member
Aug 9, 2009
348
66
Union City California
Lots of troubles building tonight

Hey guys-

Just did a repo sync and am seeing all kinds of stuff even after making clean. Seems a lot of framework and apps stuff came down from CM.


Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
56 errors
make: *** [out/target/common/obj/APPS/Settings_intermediates/classes-full-debug.jar] Error 41
make: *** Waiting for unfinished jobs....
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: packages/providers/TelephonyProvider/src/com/android/providers/telephony/SmsProvider.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
DroidDoc took 84 sec. to write docs to out/target/common/docs/api-stubs
root@androidbuild:~/android/system# repo sync -j2
Fetching projects: 100% (249/249), done.
Syncing work tree: 100% (249/249), done.

This is data all around the Error 41 reported earlier.
 

blahbl4hblah

Inactive Recognized Developer
Oct 3, 2010
6,061
1,514
Los Angeles, CA
Please help me!
How to fix Error 41?

Here's the solution:
https://github.com/greg-pe/platform_build/commit/1d32fac3f01acf64b31ed6150e980566f9296256

Looks like your using a 32-bit ubuntu version on a virtual machine, Most likely for ICS you need 64-bit to compile so you don't run into this error.

To fix this error:
Code:
cd ~/android/system/build/tools/releasetools
gedit common.py
gedit ota_from_target_files

Just do ctrl+f to find each of the red lines and replace it with the green lines
 

mpmilestogo

Senior Member
Aug 9, 2009
348
66
Union City California
Seems like the error 41 persists for me. On a AMD64 ubuntu server box with 4g of memory. I lowered the Xmx java setting to 1024 but I am seeing this ever since the last repo sync this evening.

http://pastebin.com/EREcLfX6

This only started occurring after syncing this evening and seeing a lot of changes to apps and framework from CM9.
 

blahbl4hblah

Inactive Recognized Developer
Oct 3, 2010
6,061
1,514
Los Angeles, CA
I haven't had the issue ever that I could remember
But for me to find out more about this error can you tell me if your using virtual machine or dual boot or something else. Whether your using 64bit or 32bit

I've only compiled on a 64bit so I wouldn't know how this goes with 32bit

Sent from my HTC Sensation using Tapatalk
 

mpmilestogo

Senior Member
Aug 9, 2009
348
66
Union City California
I haven't had the issue ever that I could remember
But for me to find out more about this error can you tell me if your using virtual machine or dual boot or something else. Whether your using 64bit or 32bit

I've only compiled on a 64bit so I wouldn't know how this goes with 32bit

Sent from my HTC Sensation using Tapatalk

Hi. I'm running this on real hardware. Its a AMD64 Shuttle system with Ubuntu 11.10 64bit server with 4gb of memory and all the packages installed necessary to compile. I have been successfully compiling ROMs until late last night when after a repo sync it all fell apart with the symbol errors and the error 41.

I tried backing off the java virtual machine memory to 1024 since initially I believed that perhaps I had been too aggressive with the -j switch for the system and it failed. There are a few causes of this I found online so tried those and the one posted a few posts up from here.

Nothing has really resolved this problem. Kinda considering just redoing the entire thing all over again since I have a decent internet connection. I have never had problems compiling although it does take about 2 hours on this sytem after doing a make clobber.
 

kmmxracer

Senior Member
Oct 5, 2010
236
67
Phoenix, AZ
I haven't had the issue ever that I could remember
But for me to find out more about this error can you tell me if your using virtual machine or dual boot or something else. Whether your using 64bit or 32bit

I've only compiled on a 64bit so I wouldn't know how this goes with 32bit

Sent from my HTC Sensation using Tapatalk

I'm building on a dedicated machine, no VM. Running 64-bit Ubuntu 11.10. So I was thrown of by the suggestion to try the fix for 32-bit. I didn't make any changes, followed the guide exactly, I have even had successful build in the past, before the switch to the OpenSensation repo.

I just woke us, so I'm trying
#make cobbler
#repo sync
#make -j4 bacon

to see how it goes. I'll post all errors if I get any.

---------- Post added at 06:29 PM ---------- Previous post was at 06:21 PM ----------

Kinda considering just redoing the entire thing all over again since I have a decent internet connection. I have never had problems compiling although it does take about 2 hours on this sytem after doing a make clobber.

I did start from a fresh install of Ubuntu and followed the newest guide, and I'm getting errors for the first time.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 69
    First of all, BIG BIG thanks to SparksCo for his guide for compiling CM7, I used his guide as a base for this

    Credits:
    CyanogenMod for giving their source to everyone
    SparksCo for teaching me what I know
    Vorbeth for releasing the original source for Sensation
    Elelinux for his hardwork on adding things to the device tree

    I'm making this guide for those who don't want to wait for a new CyanogenMod or AOKP build and want to build it themselves.
    Working on both ubuntu 11.10 and 12.04

    NOTE: DEPENDING ON YOUR COMPUTER'S HARDWARE, COMPILING TIME WILL BE DIFFERENT
    If you have a MAC OSX, I do not have a guide for that as I don't have one.

    Be aware for which part is for AOKP and CyanogenMod
    I have put "AOKP" and "CyanogenMod" Labels to help


    EVERYTHING THAT IS IN A BOX, OPEN TERMINAL AND ENTER THE COMMAND IN THAT SECTION

    Guide Requirements:
    - Computer
    - Common Sense
    - Some Linux Experience
    - Ubuntu 64-bit Installed
    - At least 4GB of ram with a dual core processor.


    Required Software to Install:

    For 32-bit and 64-bit System
    Code:
    sudo apt-get install git-core gnupg flex bison python rar original-awk gawk p7zip-full gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool xsltproc

    For 64-bit System
    Code:
    sudo apt-get install g++-multilib lib32z1-dev ia32-libs lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib g++-multilib

    Other Required Software:
    Code:
    sudo apt-get install libc6-dev x11proto-core-dev libx11-dev libgl1-mesa-dev mingw32 tofrodos python-markdown libxml2-utils

    Link libx11
    Code:
    sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so

    You must have a 1.6.x to compile on the ics branch of cyanogenmod.

    MUST Install Java 1.6 (NOT Java 1.7):

    1a. Download Java JDK for Linux 64-bit from Java site
    Code:
    http://www.oracle.com/technetwork/java/javase/downloads/index.html

    Be sure to download (## will change if there's an update):
    Code:
    jdk-6u##-linux-x64.bin

    1b. Move the downloaded Java JDK into your home directory

    1c. Be sure to completely remove ALL OTHER JAVA

    Don't worry if some things are asked to be installed just accept!

    Code:
    sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*

    1d. Copy Java JDK into /opt/java/64
    Code:
    sudo mkdir -p /opt/java/64/
    sudo cp jdk-6u##-linux-x64.bin /opt/java/64
    sudo su -
    cd /opt/java/64
    chmod +x jdk-6u##-linux-x64.bin
    ./jdk-6u##-linux-x64.bin
    exit

    1e. Add the needed PATH to .bashrc
    Code:
    gedit ~/.bashrc

    Add these lines to .bashrc (Better to be near the top):
    Code:
    # Java PATHs
    export JAVA_HOME=/opt/java/64/jdk1.6.0_##
    export PATH=$PATH:$JAVA_HOME/bin

    Setting Up Android SDK

    2a. Download Android SDK at http://developer.android.com/sdk/index.html

    2b. Extract it to your home folder [Ex. ~/android/sdk]

    2c. Add Android SDK Path

    gedit ~/.bashrc
    Enter the Following:
    Code:
    #Android PATH
    export PATH=$PATH:~/android/sdk
    export PATH=$PATH:~/android/sdk/platform-tools
    export PATH=$PATH:~/android/sdk/tools

    2d. Add Extra Path For Device:

    sudo gedit /etc/udev/rules.d/99-android.rules (Text Editor will open up)
    Enter this in it:
    Code:
    #Acer
    SUBSYSTEM==usb, SYSFS{idVendor}==0502, MODE=0666
    #ASUS
    SUBSYSTEM==usb, SYSFS{idVendor}==0b05, MODE=0666
    #Dell
    SUBSYSTEM==usb, SYSFS{idVendor}==413c, MODE=0666
    #Foxconn
    SUBSYSTEM==usb, SYSFS{idVendor}==0489, MODE=0666
    #Garmin-Asus
    SUBSYSTEM==usb, SYSFS{idVendor}==091E, MODE=0666
    #Google
    SUBSYSTEM==usb, SYSFS{idVendor}==18d1, MODE=0666
    #HTC
    SUBSYSTEM==usb, SYSFS{idVendor}==0bb4, MODE=0666
    #Huawei
    SUBSYSTEM==usb, SYSFS{idVendor}==12d1, MODE=0666
    #K-Touch
    SUBSYSTEM==usb, SYSFS{idVendor}==24e3, MODE=0666
    #KT Tech
    SUBSYSTEM==usb, SYSFS{idVendor}==2116, MODE=0666
    #Kyocera
    SUBSYSTEM==usb, SYSFS{idVendor}==0482, MODE=0666
    #Lenevo
    SUBSYSTEM==usb, SYSFS{idVendor}==17EF, MODE=0666
    #LG
    SUBSYSTEM==usb, SYSFS{idVendor}==1004, MODE=0666
    #Motorola
    SUBSYSTEM==usb, SYSFS{idVendor}==22b8, MODE=0666
    #NEC
    SUBSYSTEM==usb, SYSFS{idVendor}==0409, MODE=0666
    #Nook
    SUBSYSTEM==usb, SYSFS{idVendor}==2080, MODE=0666
    #Nvidia
    SUBSYSTEM==usb, SYSFS{idVendor}==0955, MODE=0666
    #OTGV
    SUBSYSTEM==usb, SYSFS{idVendor}==2257, MODE=0666
    #Pantech
    SUBSYSTEM==usb, SYSFS{idVendor}==10A9, MODE=0666
    #Philips
    SUBSYSTEM==usb, SYSFS{idVendor}==0471, MODE=0666
    #PMC-Sierra
    SUBSYSTEM==usb, SYSFS{idVendor}==04da, MODE=0666
    #Qualcomm
    SUBSYSTEM==usb, SYSFS{idVendor}==05c6, MODE=0666
    #SK Telesys
    SUBSYSTEM==usb, SYSFS{idVendor}==1f53, MODE=0666
    #Samsung
    SUBSYSTEM==usb, SYSFS{idVendor}==04e8, MODE=0666
    #Sharp
    SUBSYSTEM==usb, SYSFS{idVendor}==04dd, MODE=0666
    #Sony Ericsson
    SUBSYSTEM==usb, SYSFS{idVendor}==0fce, MODE=0666
    #Toshiba
    SUBSYSTEM==usb, SYSFS{idVendor}==0930, MODE=0666
    #ZTE
    SUBSYSTEM==usb, SYSFS{idVendor}==19D2, MODE=0666
    
    
    SUBSYSTEM=="usb", ATTRS{idVendor}=="####:####", SYMLINK+="android_adb", MODE="0666" GROUP="plugdev"
    TEST=="/var/run/ConsoleKit/database", \
    RUN+="udev-acl --action=$env{action} --device=$env{DEVNAME}"

    After this, close it and then enter:
    Code:
    sudo chmod +x /etc/udev/rules.d/99-android.rules

    If your using ANY AOSP rom like AOKP or CM9 and CM10
    Go into developer options and go to root access and change it from "Apps only" to Apps and ADB"

    2e. Install Certain Android SDK Tools

    Type:
    Code:
    android
    Check Android SDK Tools and Android SDK platform-tools and Install them

    Setting Up the .bashrc file

    gedit ~/.bashrc
    Enter the Following:
    Code:
    #Android PATH
    export PATH=$PATH:~/android/sdk
    export PATH=$PATH:~/android/sdk/platform-tools
    export PATH=$PATH:~/android/sdk/tools
    
    #Java PATH
    export JAVA_HOME=/opt/java/64/jdk1.6.0_32
    export PATH=$PATH:$JAVA_HOME/bin

    3b. After your done setting this up, close .bashrc file.

    Setup Workplace

    4a. Download CyanogenMod 9 Source
    Code:
    mkdir -p ~/bin
    mkdir -p ~/android/system
    curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
    chmod a+x ~/bin/repo (Reboot your computer after this)

    4b. Add Repo Path

    gedit ~/.bashrc

    Enter the following:
    Code:
    export PATH=$PATH:~/bin

    4c. Setup Necessary Source

    For CyanogenMod 9
    Code:
    cd ~/android/system
    repo init -u git://github.com/CyanogenMod/android.git -b ics

    For CyanogenMod 10
    Code:
    cd ~/android/system
    repo init -u git://github.com/CyanogenMod/android.git -b jellybean

    4d. Download Necessary Source
    Code:
    repo sync

    4e. Download Extra Needed Files
    Code:
    ~/android/system/vendor/cm/get-prebuilts

    Your Final .bashrc

    It SHOULD Look Something Like This:
    Code:
    #Android PATH
    export PATH=$PATH:~/android/sdk
    export PATH=$PATH:~/android/sdk/platform-tools
    export PATH=$PATH:~/android/sdk/tools
    export PATH=$PATH:~/bin
    
    #Java PATH
    export JAVA_HOME=/opt/java/64/jdk1.6.0_##
    export PATH=$PATH:$JAVA_HOME/bin

    Building CyanogenMod
    Code:
    . build/envsetup.sh; lunch cm_pyramid-userdebug; mka bacon

    Making a New Build

    Go inside to your source folder and delete the 'out' folder

    THEN Do This:
    Code:
    repo sync

    Code:
    . build/envsetup.sh; lunch cm_pyramid-userdebug; mka bacon
    16
    Compile AOKP Section

    Be sure to follow the steps from the above post and ONLY use this instead of the part called 4c. Setup Necessary Source

    FOR AOKP (ICS Version)
    Code:
    cd ~/android/system
    repo init -u https://github.com/AOKP/platform_manifest.git -b ics

    Temporary fix to build:
    Code:
    install -d prebuilt/android-arm/kernel

    Then do:
    Code:
    curl -o prebuilt/android-arm/kernel/LINUX_KERNEL_COPYING -O https://raw.github.com/ezterry/kernel-biff-testing/ezgb-2636/COPYING

    FOR AOKP (JELLYBEAN Version)
    Code:
    cd ~/android/system
    repo init -u https://github.com/AOKP/platform_manifest.git -b jb

    5b. Building AOKP
    Code:
    . build/envsetup.sh; lunch aokp_pyramid-userdebug; mka bacon
    11
    Reference

    This section is to help those who may look for answers

    Basic Linux Commands
    http://ss64.com/bash/

    CyanogenMod Wiki
    http://wiki.cyanogenmod.com/wiki/Main_Page

    Difference between breakfast, brunch and lunch
    http://synrgi.wordpress.com/2011/09/16/breakfast-brunch-and-lunch/

    Installing Android SDK
    http://developer.android.com/sdk/installing.html
    4
    Added it to the OP, sorry it took forever
    Can you also add my page with nightlies to the OP?