[GUIDE CM11] How to build your own CyanogenMod 11.0 ROM from sources for the Nexus 4

Search This thread

ocarinaz64

Senior Member
Jul 1, 2013
392
235
Crete, IL
Hm, I'll try. Thanks for the paste. It seems jni_generator.py it's putting weird '<E>'s where they don't belong.

This is in response to some older posts. If your HashSet.jni.h file is giving you problems, you need to first make sure you are using JDK 6. Then, if you don't want to lose your progress, instead of resetting your entire build with a "make clobber", you can just remove the <E>'s wherever they are. I did it to mine and it kept right on building. Or, better yet, you could just paste in my HashSet_jni.h as follows:
Code:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file is autogenerated by
//     base/android/jni_generator/jni_generator.py
// For
//     java/util/HashSet

#ifndef java_util_HashSet_JNI
#define java_util_HashSet_JNI

#include <jni.h>

#include "base/android/jni_android.h"
#include "base/android/scoped_java_ref.h"
#include "base/basictypes.h"
#include "base/logging.h"

using base::android::ScopedJavaLocalRef;

// Step 1: forward declarations.
namespace {
const char kHashSetClassPath[] = "java/util/HashSet";
// Leaking this jclass as we cannot use LazyInstance from some threads.
jclass g_HashSet_clazz = NULL;
}  // namespace

namespace JNI_HashSet {

// Step 2: method stubs.

static base::subtle::AtomicWord g_HashSet_add = 0;
static jboolean Java_HashSet_add(JNIEnv* env, jobject obj, jobject p0)
    __attribute__ ((unused));
static jboolean Java_HashSet_add(JNIEnv* env, jobject obj, jobject p0) {
  /* Must call RegisterNativesImpl()  */
  DCHECK(g_HashSet_clazz);
  jmethodID method_id =
      base::android::MethodID::LazyGet<
      base::android::MethodID::TYPE_INSTANCE>(
      env, g_HashSet_clazz,
      "add",

"("
"Ljava/util/E;"
")"
"Z",
      &g_HashSet_add);

  jboolean ret =
    env->CallBooleanMethod(obj,
      method_id, p0);
  base::android::CheckException(env);
  return ret;
}

static base::subtle::AtomicWord g_HashSet_clear = 0;
static void Java_HashSet_clear(JNIEnv* env, jobject obj) __attribute__
    ((unused));
static void Java_HashSet_clear(JNIEnv* env, jobject obj) {
  /* Must call RegisterNativesImpl()  */
  DCHECK(g_HashSet_clazz);
  jmethodID method_id =
      base::android::MethodID::LazyGet<
      base::android::MethodID::TYPE_INSTANCE>(
      env, g_HashSet_clazz,
      "clear",

"("
")"
"V",
      &g_HashSet_clear);

  env->CallVoidMethod(obj,
      method_id);
  base::android::CheckException(env);

}

static base::subtle::AtomicWord g_HashSet_clone = 0;
static ScopedJavaLocalRef<jobject> Java_HashSet_clone(JNIEnv* env, jobject
    obj) __attribute__ ((unused));
static ScopedJavaLocalRef<jobject> Java_HashSet_clone(JNIEnv* env, jobject
    obj) {
  /* Must call RegisterNativesImpl()  */
  DCHECK(g_HashSet_clazz);
  jmethodID method_id =
      base::android::MethodID::LazyGet<
      base::android::MethodID::TYPE_INSTANCE>(
      env, g_HashSet_clazz,
      "clone",

"("
")"
"Ljava/lang/Object;",
      &g_HashSet_clone);

  jobject ret =
    env->CallObjectMethod(obj,
      method_id);
  base::android::CheckException(env);
  return ScopedJavaLocalRef<jobject>(env, ret);
}

static base::subtle::AtomicWord g_HashSet_contains = 0;
static jboolean Java_HashSet_contains(JNIEnv* env, jobject obj, jobject p0)
    __attribute__ ((unused));
static jboolean Java_HashSet_contains(JNIEnv* env, jobject obj, jobject p0) {
  /* Must call RegisterNativesImpl()  */
  DCHECK(g_HashSet_clazz);
  jmethodID method_id =
      base::android::MethodID::LazyGet<
      base::android::MethodID::TYPE_INSTANCE>(
      env, g_HashSet_clazz,
      "contains",

"("
"Ljava/lang/Object;"
")"
"Z",
      &g_HashSet_contains);

  jboolean ret =
    env->CallBooleanMethod(obj,
      method_id, p0);
  base::android::CheckException(env);
  return ret;
}

static base::subtle::AtomicWord g_HashSet_isEmpty = 0;
static jboolean Java_HashSet_isEmpty(JNIEnv* env, jobject obj) __attribute__
    ((unused));
static jboolean Java_HashSet_isEmpty(JNIEnv* env, jobject obj) {
  /* Must call RegisterNativesImpl()  */
  DCHECK(g_HashSet_clazz);
  jmethodID method_id =
      base::android::MethodID::LazyGet<
      base::android::MethodID::TYPE_INSTANCE>(
      env, g_HashSet_clazz,
      "isEmpty",

"("
")"
"Z",
      &g_HashSet_isEmpty);

  jboolean ret =
    env->CallBooleanMethod(obj,
      method_id);
  base::android::CheckException(env);
  return ret;
}

static base::subtle::AtomicWord g_HashSet_iterator = 0;
static ScopedJavaLocalRef<jobject> Java_HashSet_iterator(JNIEnv* env, jobject
    obj) __attribute__ ((unused));
static ScopedJavaLocalRef<jobject> Java_HashSet_iterator(JNIEnv* env, jobject
    obj) {
  /* Must call RegisterNativesImpl()  */
  DCHECK(g_HashSet_clazz);
  jmethodID method_id =
      base::android::MethodID::LazyGet<
      base::android::MethodID::TYPE_INSTANCE>(
      env, g_HashSet_clazz,
      "iterator",

"("
")"
"Ljava/util/Iterator;",
      &g_HashSet_iterator);

  jobject ret =
    env->CallObjectMethod(obj,
      method_id);
  base::android::CheckException(env);
  return ScopedJavaLocalRef<jobject>(env, ret);
}

static base::subtle::AtomicWord g_HashSet_remove = 0;
static jboolean Java_HashSet_remove(JNIEnv* env, jobject obj, jobject p0)
    __attribute__ ((unused));
static jboolean Java_HashSet_remove(JNIEnv* env, jobject obj, jobject p0) {
  /* Must call RegisterNativesImpl()  */
  DCHECK(g_HashSet_clazz);
  jmethodID method_id =
      base::android::MethodID::LazyGet<
      base::android::MethodID::TYPE_INSTANCE>(
      env, g_HashSet_clazz,
      "remove",

"("
"Ljava/lang/Object;"
")"
"Z",
      &g_HashSet_remove);

  jboolean ret =
    env->CallBooleanMethod(obj,
      method_id, p0);
  base::android::CheckException(env);
  return ret;
}

static base::subtle::AtomicWord g_HashSet_size = 0;
static jint Java_HashSet_size(JNIEnv* env, jobject obj) __attribute__
    ((unused));
static jint Java_HashSet_size(JNIEnv* env, jobject obj) {
  /* Must call RegisterNativesImpl()  */
  DCHECK(g_HashSet_clazz);
  jmethodID method_id =
      base::android::MethodID::LazyGet<
      base::android::MethodID::TYPE_INSTANCE>(
      env, g_HashSet_clazz,
      "size",

"("
")"
"I",
      &g_HashSet_size);

  jint ret =
    env->CallIntMethod(obj,
      method_id);
  base::android::CheckException(env);
  return ret;
}

// Step 3: RegisterNatives.

static bool RegisterNativesImpl(JNIEnv* env) {

  g_HashSet_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
      base::android::GetClass(env, kHashSetClassPath).obj()));
  return true;
}
}  // namespace JNI_HashSet

#endif  // java_util_HashSet_JNI
 
Last edited:
  • Like
Reactions: x1123

x1123

Senior Member
Mar 27, 2011
887
586
Pekalongan
semayi.blogspot.com
I was wondering if you could tell me what I would need to change to be able to do this for a Samsung Galaxy Note 2 SGH-I317. That's the att version

basic information must have for compiling :
- find kernel sources for your device
- find device specific source tree on the Net (github, google code etc), otherwise you need to create your self.
- create local_manifest for your device for device unsupported
- obtain proprietary drivers for your device
- stay awake .... :D
 
  • Like
Reactions: rogersb11

rogersb11

Senior Member
Nov 18, 2013
3,345
6,888
Indianapolis
Samsung Galaxy S21 Ultra
basic information must have for compiling :
- find kernel sources for your device
- find device specific source tree on the Net (github, google code etc), otherwise you need to create your self.
- create local_manifest for your device for device unsupported
- obtain proprietary drivers for your device
- stay awake .... :D

Just saw this lol. I ended up figuring it out. The STAY AWAKE part was the key. Builds going. Thanks
 

QuickS_NL

Member
May 27, 2014
44
116
Hi guys currently i'm building CM11 for the Xperia Z2. I'm running into this error every time. I dont have any idea how to fix this. Do you guys know how to fix this?

Code:
using device-specific extensions in device/sony/shinano-common
using custom bootimage makefile device/sony/shinano-common/custombootimg.mk...
using prebuilt boot.img...
using custom bootimage makefile device/sony/shinano-common/custombootimg.mk...
using prebuilt recovery.img...
  running:  imgdiff -b /tmp/targetfiles-9t0vAB/SYSTEM/etc/recovery-resource.dat /tmp/tmpZwd7Gp /tmp/tmpQcmSqN /tmp/tmpjENpDi
Traceback (most recent call last):
  File "./build/tools/releasetools/ota_from_target_files", line 971, in <module>
    main(sys.argv[1:])
  File "./build/tools/releasetools/ota_from_target_files", line 939, in main
    WriteFullOTAPackage(input_zip, output_zip)
  File "./build/tools/releasetools/ota_from_target_files", line 491, in WriteFullOTAPackage
    MakeRecoveryPatch(OPTIONS.input_tmp, output_zip, recovery_img, boot_img)
  File "./build/tools/releasetools/ota_from_target_files", line 404, in MakeRecoveryPatch
    recovery_type, recovery_device = common.GetTypeAndDevice("/recovery", OPTIONS.info_dict)
  File "/home/jaap/Android/CM11/build/tools/releasetools/common.py", line 985, in GetTypeAndDevice
    return PARTITION_TYPES[fstab[mount_point].fs_type], fstab[mount_point].device
KeyError: '/recovery'
make: *** [/home/jaap/Android/CM11/out/target/product/sirius/cm_sirius-ota-df84df7ef8.zip] Error 1
 
Last edited:

wulsic

Senior Member
Aug 21, 2013
1,880
2,316
24
Nijmegen
OnePlus 8 Pro
Hi guys currently i'm building CM11 for the Xperia Z2. I'm running into this error every time. I dont have any idea how to fix this. Do you guys know how to fix this?

Code:
using device-specific extensions in device/sony/shinano-common
using custom bootimage makefile device/sony/shinano-common/custombootimg.mk...
using prebuilt boot.img...
using custom bootimage makefile device/sony/shinano-common/custombootimg.mk...
using prebuilt recovery.img...
  running:  imgdiff -b /tmp/targetfiles-9t0vAB/SYSTEM/etc/recovery-resource.dat /tmp/tmpZwd7Gp /tmp/tmpQcmSqN /tmp/tmpjENpDi
Traceback (most recent call last):
  File "./build/tools/releasetools/ota_from_target_files", line 971, in 
    main(sys.argv[1:])
  File "./build/tools/releasetools/ota_from_target_files", line 939, in main
    WriteFullOTAPackage(input_zip, output_zip)
  File "./build/tools/releasetools/ota_from_target_files", line 491, in WriteFullOTAPackage
    MakeRecoveryPatch(OPTIONS.input_tmp, output_zip, recovery_img, boot_img)
  File "./build/tools/releasetools/ota_from_target_files", line 404, in MakeRecoveryPatch
    recovery_type, recovery_device = common.GetTypeAndDevice("/recovery", OPTIONS.info_dict)
  File "/home/jaap/Android/CM11/build/tools/releasetools/common.py", line 985, in GetTypeAndDevice
    return PARTITION_TYPES[fstab[mount_point].fs_type], fstab[mount_point].device
KeyError: '/recovery'
make: *** [/home/jaap/Android/CM11/out/target/product/sirius/cm_sirius-ota-df84df7ef8.zip] Error 1

Quicks look at Your fstab file i dont know out of my head which but its an fstab file in your device folder.. It says it goes wrong by /recovery so look at that point.

Oftewel Jaap kijk op je fstab bestand in je device folder wat waarschijnlijk cm11/device/Sony/sirius zal zijn. Controlleer de bestanden of ze wel goed kloppen.want daar is dus iets mee khad dat probleem ook toen ik cyanogenmod10 voor de mobiel van MN vriend bouwde. Ik kan je het bijna definitief zeggen het heeft te maken met de fstab bestanden.

Verstuurd vanaf mijn Nexus 4 met Tapatalk
 
Last edited:

QuickS_NL

Member
May 27, 2014
44
116
Quicks look at Your fstab file i dont know out of my head which but its an fstab file in your device folder.. It says it goes wrong by /recovery so look at that point.

Oftewel Jaap kijk op je fstab bestand in je device folder wat waarschijnlijk cm11/device/Sony/sirius zal zijn. Controlleer de bestanden of ze wel goed kloppen.want daar is dus iets mee khad dat probleem ook toen ik cyanogenmod10 voor de mobiel van MN vriend bouwde. Ik kan je het bijna definitief zeggen het heeft te maken met de fstab bestanden.

Verstuurd vanaf mijn Nexus 4 met Tapatalk

I allready fixed it but not with the .fstab file :) I fixed it with the BoardConfig. How do you know my real name?:confused:
 

wizzardsk

Senior Member
Aug 16, 2013
980
130
Bratislava
Sorry for asking, but is it possible to use this guide to build CM11 also for another phone, for example my LG E455? Thank you very much.
 

mukulsoni

Senior Member
Aug 16, 2013
721
4,790
Bangkok
While executing this command : $ repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
getting this error:
Code:
mukul@mukul-HP-Pavilion-g6-Notebook-PC:~/cm11$ repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
error: in `init -u git://github.com/CyanogenMod/android.git -b cm-11.0`: [Errno 21] Is a directory: '/home/mukul/.repo/manifests/.git/HEAD'
error: manifest missing or unreadable -- please run init
anyone could give some light please.
 

sykopompos

Recognized Developer
Jun 26, 2008
15,322
29,134
flithydelphia
While executing this command : $ repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
getting this error:
Code:
mukul@mukul-HP-Pavilion-g6-Notebook-PC:~/cm11$ repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
error: in `init -u git://github.com/CyanogenMod/android.git -b cm-11.0`: [Errno 21] Is a directory: '/home/mukul/.repo/manifests/.git/HEAD'
error: manifest missing or unreadable -- please run init
anyone could give some light please.

Delete out the init file in your building directory and rerun the init line then repo sync

Sent from my C6916
 
  • Like
Reactions: mukulsoni

Top Liked Posts

  • There are no posts matching your filters.
  • 159
    Make your 'own' KitKat-ROM today!

    V1.1 - 20131108 Update 1: Java part added. Error remarks. Local_manifest: branch update.
    V1.0 - 20131106 Initial release

    Thank you note: Thank you to the whole CM-Team for bringing up-to-date-Android to so many devices.

    04b27f97370641a3fa2ac35b50dd9fbc.jpg


    Overview

    I. Preparation
    II. Installation of the required packages
    III. Installing Java
    IV. The sources
    V. Building the ROM
    VI. Rebuilding with newest sources


    I. Preparation

    Things you need for building:

    A computer
    An internet connection
    An open mind
    Time
    Patience

    First of all, you need a running up-to-date Ubuntu/Linux system. I am using Ubuntu 13.10 64-bit.

    Use the terminal to make the steps. A terminal window can be opened by pressing Ctrl+Alt+T. Every single command for the terminal is marked with a $ sign. Just paste every command (without the $ sign) to your terminal window and there shouldn't be any problem.

    IMPORTANT: INSTALL EVERYTHING AS A NORMAL USER. DON'T INSTALL AS ROOT!


    II. Installation of the required packages (Ubuntu 13.10 64-bit)

    Install packages:
    Code:
    $ sudo apt-get install bison build-essential curl flex \
    g++-multilib gcc-multilib git-core gnupg gperf \
    lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev \
    libesd0-dev libncurses5-dev libsdl1.2-dev \
    libwxgtk2.8-dev libxml2 libxml2-utils lzop \
    openjdk-6-jdk openjdk-6-jre pngcrush schedtool \
    squashfs-tools xsltproc zip zlib1g-dev
    III. Installing Java

    You need a version 6 Java Development Kit for building CM11.0. Usually, the SUN JDK 6 is recommended. But there is another way: you can use the OpenJDK 6. When you installed the required packages as described above, you will just need to configure your Java installation.

    Check your Java version:
    Code:
    $ java -version
    Verify the symlinks. Javac, Java, Javaws, Javadoc, Javah, Javap and Jar should all point to the right Java location and version:

    Code:
    $ ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
    If they are pointing to the wrong versions you have to change that to OpenJDK6.

    Select the default Java version for your system:
    Code:
    $ sudo update-alternatives --config javac 
    $ sudo update-alternatives --config java 
    $ sudo update-alternatives --config javaws 
    $ sudo update-alternatives --config javadoc 
    $ sudo update-alternatives --config javah 
    $ sudo update-alternatives --config javap 
    $ sudo update-alternatives --config jar
    That's it.



    IV. The sources

    Install repo:

    Repo is a tool that makes it quite easy to download and maintain the sources of Cyanogenmod.
    Code:
    $ mkdir ~/bin
    $ PATH=~/bin:$PATH
    $ cd ~/bin
    $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    $ chmod a+x ~/bin/repo
    Create the working directory:
    Code:
    $ mkdir ~/cm11
    $ cd ~/cm11
    Initialize Repo:
    Code:
    $ repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
    and enter your credentials.

    Download the sources:
    Code:
    $ repo sync
    Wait until it's finished - takes some time to download the hefty 12 GB of source code!

    Have a break, have a KitKat!

    If the process hangs use Ctrl+C to break out of it and resume the download with another
    Code:
    $ repo sync
    If you are running into a lot of syncing errors the reason might be that the 'repo sync' command is establishing four threads automatically. This might be too much. So try to change the command to run with one thread only by using
    Code:
    $ repo sync -j1
    Initialize the environment
    Code:
    $ . build/envsetup.sh
    Obtain the proprietary files:

    First get two missing repositories for the Nexus 4 by running
    Code:
    $ breakfast mako
    Then create a file with the name local_manifest.xml in the local_manifests directory. To see this directory, you have to press Ctrl-H in your file manager.

    Use this code
    Code:
    $ gedit ~/cm11/.repo/local_manifests/local_manifest.xml


    Update: Branch revision is now cm-11.0
    Paste the following lines to the editor
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest>
      <project name="TheMuppets/proprietary_vendor_lge.git" path="vendor/lge" remote="github" revision="cm-11.0"/>
    </manifest>
    Save the file.

    Run
    Code:
    $ repo sync
    again to get the files needed.

    Download the necessary prebuilts from cyanogenmod by running
    Code:
    $ cd ~/cm11/vendor/cm
    $ . get-prebuilts
    $ croot
    And you're done!


    V. Building the ROM

    Now build it:
    Code:
    $ brunch mako
    And the building process starts. Now have patience. Building takes around half an hour on fast systems and a lot more on older and slower machines.


    Update 20131108: The errors from 20131106 are gone now. If you made the changes revert them, sync the repo and then brunch again. There is no need to edit the source at the moment.


    YOU ONLY NEED THIS PART IF YOU WANT TO REVERT THE CHANGES YOU MADE BEFORE
    As of writing, you will run into two errors:

    First error you will encounter:
    Code:
    build/core/java.mk:23: *** frameworks/support/v4:
    Invalid LOCAL_SDK_VERSION '19' Choices are: current 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18.  Stop.
    Go to frameworks/support/v4/Android.mk and edit line 128 (it's at the end of the file):
    Look for

    Code:
    # A helper sub-library that makes direct use of KitKat APIs.
    include $(CLEAR_VARS)
    LOCAL_MODULE := android-support-v4-kitkat
    LOCAL_SDK_VERSION := [COLOR=DarkRed]19[/COLOR]
    and change the "19" to "current"

    It should look like this
    Code:
    # A helper sub-library that makes direct use of KitKat APIs.
    include $(CLEAR_VARS)
    LOCAL_MODULE := android-support-v4-kitkat
    LOCAL_SDK_VERSION := [COLOR=DarkRed]current[/COLOR]
    Save the file.

    Re-run

    Code:
    $ brunch mako
    The second error you will see:
    Code:
    build/core/java.mk:23: *** packages/apps/Launcher3:
    Invalid LOCAL_SDK_VERSION '19' Choices are: current 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18.  Stop.
    Go to packages/apps/Launcher3/Android.mk and edit line 35 (it's in the middle of the file):
    Look for
    Code:
    LOCAL_PROTOC_OPTIMIZE_TYPE := nano
    LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/protos/
    
    LOCAL_SDK_VERSION := [COLOR=DarkRed]19[/COLOR]
    
    LOCAL_PACKAGE_NAME := Launcher3
    and change the "19" to "current"

    It should look like this
    Code:
    LOCAL_PROTOC_OPTIMIZE_TYPE := nano
    LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/protos/
    
    LOCAL_SDK_VERSION := [COLOR=DarkRed]current[/COLOR]
    
    LOCAL_PACKAGE_NAME := Launcher3
    Save the file.

    Re-run

    Code:
    $ brunch mako
    -END OF THE OLD ERROR CORRECTION-


    When everything worked as it should you will find your new ROM-image in ~/cm11/out/target/product/mako

    It is called cm-11-DATE-UNOFFICIAL-mako-zip. You can flash it via CWM/TWRP as usual.

    VI. Rebuilding with newest sources

    Whenever you like to update your sources and build a new version you have to run these four simple commands:
    Code:
    $ cd ~/cm11
    $ repo sync
    $ . build/envsetup.sh
    $ brunch mako
    Compiling takes less time than it took for creating the ROM the first time because it's only building new parts while reusing old parts that haven't changed.


    Happy building!
    13
    Reserved

    Reserved
    7
    Don't have a way to build, anyway someone would be willing to upload one?

    Sent from my Nexus 4 using xda app-developers app

    You may try http://fitsnugly.euroskank.com/?rom=cm11&device=mako
    6
    I am having some trouble with brunching. I get this error:
    Code:
    target thumb C++: libbluetooth_jni <= packages/apps/Bluetooth/jni/com_android_bluetooth_hfp.cpp
    packages/apps/Bluetooth/jni/com_android_bluetooth_hfp.cpp:229:1: error: too many initializers for 'bthf_callbacks_t'
    packages/apps/Bluetooth/jni/com_android_bluetooth_hfp.cpp: In function 'void android::initializeFeaturesNative(JNIEnv*, jobject, jint)':
    packages/apps/Bluetooth/jni/com_android_bluetooth_hfp.cpp:327:47: error: 'const struct bthf_interface_t' has no member named 'init_features'
    make: *** [/home/holmen/source/cm11/out/target/product/mako/obj/SHARED_LIBRARIES/libbluetooth_jni_intermediates/com_android_bluetooth_hfp.o] Error 1
    make: *** Waiting for unfinished jobs....
    packages/apps/Bluetooth/jni/com_android_bluetooth_btservice_AdapterService.cpp:462:1: error: invalid conversion from 'void (*)(bt_bdaddr_t*, bt_bdname_t*, uint32_t, uint8_t) {aka void (*)(bt_bdaddr_t*, bt_bdname_t*, unsigned int, unsigned char)}' to 'pin_request_callback {aka void (*)(bt_bdaddr_t*, bt_bdname_t*, unsigned int)}' [-fpermissive]
    packages/apps/Bluetooth/jni/com_android_bluetooth_btservice_AdapterService.cpp: In function 'int android::getSocketOptNative(JNIEnv*, jobject, jint, jint, jint, jbyteArray)':
    packages/apps/Bluetooth/jni/com_android_bluetooth_btservice_AdapterService.cpp:919:47: error: 'const struct btsock_interface_t' has no member named 'get_sock_opt'
    packages/apps/Bluetooth/jni/com_android_bluetooth_btservice_AdapterService.cpp:920:11: error: 'btsock_option_type_t' was not declared in this scope
    packages/apps/Bluetooth/jni/com_android_bluetooth_btservice_AdapterService.cpp: In function 'int android::setSocketOptNative(JNIEnv*, jobject, jint, jint, jint, jbyteArray, jint)':
    packages/apps/Bluetooth/jni/com_android_bluetooth_btservice_AdapterService.cpp:949:47: error: 'const struct btsock_interface_t' has no member named 'set_sock_opt'
    packages/apps/Bluetooth/jni/com_android_bluetooth_btservice_AdapterService.cpp:950:11: error: 'btsock_option_type_t' was not declared in this scope
    packages/apps/Bluetooth/jni/com_android_bluetooth_btservice_AdapterService.cpp: In function 'jboolean android::getRemoteMasInstancesNative(JNIEnv*, jobject, jbyteArray)':
    packages/apps/Bluetooth/jni/com_android_bluetooth_btservice_AdapterService.cpp:996:54: warning: passing NULL to non-pointer argument 3 of 'void _JNIEnv::ReleaseByteArrayElements(jbyteArray, jbyte*, jint)' [-Wconversion-null]
    make: *** [/home/holmen/source/cm11/out/target/product/mako/obj/SHARED_LIBRARIES/libbluetooth_jni_intermediates/com_android_bluetooth_btservice_AdapterService.o] Error 1

    I have searching for this error but haven't found anything

    I got this error, too! And i am looking at which source had been changed!

    Looks like there are/were some problems in the source code today. I couldn't build the whole day so I don't know if the problems still persist.

    Here is what you can do in situations like this:

    repo sync again. Sometimes you got only one part of a multi-part-commit.
    brunch again, when the error is still there and also still the same
    read the error message to find the erroneous file and remember the path/repo it is in. Here the file is com_android_bluetooth_hfp.cpp and repo is packages_apps_Bluetooth.
    Then change to this directory and check with 'git' what has been changed lately
    Code:
    $ cd packages/apps/Bluetooth/
    $ git log
    press 'q' to get out of 'git'.

    Most probably one of the last changes (at the top!) is the culprit.
    You can try to revert it. To do this you'll have to remember the commit ID. The first six numbers/letters are sufficient, e.g.0123456789abcedf...
    Code:
    $ git revert 012345
    Press Ctrl+X when the commit window pops up to save your reverting commit.
    Code:
    $ croot
    to get back to your root directory.
    Then brunch again.

    You can also go to http://review.cyanogenmod.org/#/q/status:eek:pen,n,z and have a look if there is a commit coming that hasn't been merged in the source code. If you want to try it, you have to cherry-pick it:

    E.g. go to
    http://review.cyanogenmod.org/#/c/53584/
    Press cherry-pick, right of Download. Then press the clipboard sign on the very right of this line.

    Have a look at the type of project at the beginning of the page. Here it is 'CyanogenMod/android_device_lge_mako'
    So go to this directory in your terminal window.
    Code:
    $ cd device/lge/mako/
    Paste with a right click the copied cherry-pick line from the clipboard to the terminal window. Press return.
    Now brunch again.
    6
    Clear Cache

    I saw and subscribed this very interesting Thread. I think this guide is one of best guide over XDA. For whom not so familiar with linux and going to familiarizing him/herself due to android rom building. After compiling and compling again normally your RAM will be cached / occupied by compiler and causing the machine getting slower and slower. The best way for freeing RAM is by rebooting the machine, too often rebooting is not good and annoying. Attached is small scripts will help you a lot. This scripts is usable to free your RAM.

    1.Download attached script and extract in your home folder.
    Code:
    $ unzip clearcache.zip
    2.copy extracted file to /usr/bin/
    Code:
    $ sudo cp clearcache /usr/bin/
    give your password if requested
    3.Edit the permission of the clearcache
    Code:
    $ sudo chmod 755 /usr/bin/clearcache
    give your password if requested

    after long compiling check your Ram with command
    Code:
    $ free
    
                 total       used       free     shared    buffers     cached
    Mem:       8046976    2418956    5628020          0      57996    1646916

    for freeing the ram just execute
    Code:
    $ clearcache
    give your password if requested
    check current free ram
    Code:
    free
     total       used       free     shared    buffers     cached
    Mem:       8046976    1015608    7031368          0       1664     322464

    Have nice compiling ...