[HOWTO] ✏ Compiling Fairphone Open OS / Rooting

Looks like something is moving & getting pushed. Nice. :slight_smile:

1 Like

I just did a fresh build with the recent commits. And also got the same error again. I think I mixed the things up. You need to do an additional

. build/envsetup.sh

I think it copies some files from blobs to out directory (e.g. libwpa). At least it helped for me.

Can you post what kind of “same” error you get? I’m too lazy to pull the repo again without any “official” notification that everything 1.2.8-new is “in” there right now. But maybe it’s any easy problem that could be fixed?

Oh, I see now, it’s the SHARED_LIBRARIES/libwpa_client_intermediates/export_includes one. Okay.

Flashed the new build some minutes ago. It comes rooted now. Can be enabled in developer settings. :thumbsup:
I was able to flash the binaries without wiping. No need to restore any backup so far. Of course Xposed and OpenGApps must be installed again.

4 Likes

Hey I’ve been an ass about the ability to share our custom roms (and still intend to be since we haven’t had an answer that I know of) but I’d like to congratulate FP on releasing their official builds of FPOSOS. That’s really appreciated.

And the abilities to switch of signature verif. in TWRP and to one-click root the phone are too.

1 Like

I built FPOS a couple times a month or so ago (the unmodified version direct from the FP2 gerritt, then again with the patches from the first post of the uNLP thread), and with the new code it’s failing to build. Steps:

repo sync
(then the four steps from the uNLP thread:)

repo download fp2-dev/platform/frameworks/base 3
repo download fp2-dev/device/qcom/common 4
rm vendor/qcom/proprietary/target/product/FP2/system/etc/permissions/com.qualcomm.location.xml
rm vendor/qcom/proprietary/target/product/FP2/system/priv-app/com.qualcomm.location/com.qualcomm.location.apk

. build/envsetup.sh
choosecombo 1 FP2 2
make -j8

And the failure point:

Reading library jar [/home/andy/fairphone_os/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar]
frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java:964: error: cannot find symbol
            result.maybeMarkCapabilitiesRestricted();
                  ^
  symbol:   method maybeMarkCapabilitiesRestricted()
  location: variable result of type NetworkCapabilities
Reading library jar [/home/andy/fairphone_os/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar]
Reading library jar [/home/andy/fairphone_os/out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar]
Reading library jar [/home/andy/fairphone_os/out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar]
Reading library jar [/home/andy/fairphone_os/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar]
Reading library jar [/home/andy/fairphone_os/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar]
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.
Proguard: out/target/common/obj/APPS/OpenWnn_intermediates/proguard.classes.jar
ProGuard, version 4.10
Reading program jar [/home/andy/fairphone_os/out/target/common/obj/APPS/OpenWnn_intermediates/classes.jar]
Reading library jar [/home/andy/fairphone_os/out/target/common/obj/JAVA_LIBRARIES/core-junit_intermediates/classes.jar]
Reading library jar [/home/andy/fairphone_os/out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar]
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.
1 error
make: *** [out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/classes-full-debug.jar] Error 41
make: *** Waiting for unfinished jobs....
Reading library jar [/home/andy/fairphone_os/out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar]
Preparing output jar [/home/andy/fairphone_os/out/target/common/obj/APPS/HTMLViewer_intermediates/proguard.classes.jar]
  Copying resources from program jar [/home/andy/fairphone_os/out/target/common/obj/APPS/HTMLViewer_intermediates/classes.jar]
Reading library jar [/home/andy/fairphone_os/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar]
Preparing output jar [/home/andy/fairphone_os/out/target/common/obj/APPS/LiveWallpapers_intermediates/proguard.classes.jar]
  Copying resources from program jar [/home/andy/fairphone_os/out/target/common/obj/APPS/LiveWallpapers_intermediates/classes.jar]
Preparing output jar [/home/andy/fairphone_os/out/target/common/obj/APPS/KeyChain_intermediates/proguard.classes.jar]
  Copying resources from program jar [/home/andy/fairphone_os/out/target/common/obj/APPS/KeyChain_intermediates/classes.jar]
Preparing output jar [/home/andy/fairphone_os/out/target/common/obj/APPS/LiveWallpapersPicker_intermediates/proguard.classes.jar]
  Copying resources from program jar [/home/andy/fairphone_os/out/target/common/obj/APPS/LiveWallpapersPicker_intermediates/classes.jar]
Preparing output jar [/home/andy/fairphone_os/out/target/common/obj/APPS/Music_intermediates/proguard.classes.jar]
  Copying resources from program jar [/home/andy/fairphone_os/out/target/common/obj/APPS/Music_intermediates/classes.jar]
Preparing output jar [/home/andy/fairphone_os/out/target/common/obj/APPS/OpenWnn_intermediates/proguard.classes.jar]
  Copying resources from program jar [/home/andy/fairphone_os/out/target/common/obj/APPS/OpenWnn_intermediates/classes.jar]

#### make failed to build some targets (20:59 (mm:ss)) ####

Anyone sucessfully build the new code with uNLP support?

I guess you had the output of an old compilation lying around. Remove your out directory and try it again.

I thought so too, I ran make clean and restarted the compile a while ago. I also noticed that there’s newer fp2-sibon blobs than the one on the compile instruction page, should I be using the 16.04 one instead of 2.0.1?

edit:
Still failed after cleaning out the out folder with make clean. Same error as before, if I’m reading this right:

target Dex: content
frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection
            result.maybeMarkCapabilitiesRestricted();
                  ^
  symbol:   method maybeMarkCapabilitiesRestricted()
  location: variable result of type NetworkCapabilities
target Dex: dpm
target Jar: framework (out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/javalib.ja
target Dex: ime
target Dex: ims-common
target Dex: input
Copying: out/target/common/obj/JAVA_LIBRARIES/javax.btobex_intermediates/classes.dex
Copying: out/target/common/obj/JAVA_LIBRARIES/javax.obex_intermediates/classes.dex
target Dex: media_cmd
target Dex: monkey
Copying: out/target/common/obj/JAVA_LIBRARIES/org.codeaurora.Performance_intermediates/classes
target Dex: pm
target Dex: qcmediaplayer
Copying: out/target/common/obj/JAVA_LIBRARIES/qcom.fmradio_intermediates/classes.dex
target Dex: requestsync
target Dex: settings
target Dex: svc
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.
1 error
make: *** [out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/classes-full-de
make: *** Waiting for unfinished jobs....
Copying: out/target/common/obj/JAVA_LIBRARIES/uiautomator.core_intermediates/emma_out/lib/clas

#### make failed to build some targets (02:15:49 (hh:mm:ss)) ####

And the same error again after deleting out (again) and adding the new sibon blob. :frowning:

Most likely you will already know, but as it is java causing this error… are you compiling with openjdk-7 ? Because I had similar java errors, when I tried with the first version
If you don’t just tell with “update-alternatives” which java version to use for make. Otherwise please tell us your system-configuration

Same problem as @andy problem when compiling with fairphone2-build-env, which uses openjdk-7.

$ java -version
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

If I comment the line containing maybeMarkCapabilitiesRestricted(), compilation continues, but I get another error:

packages/apps/Settings/src/com/android/settings/applications/InstalledAppDetails.java:444: error: cannot find symbol
      int mode = appOpsManager.checkOpNoThrow(AppOpsManager.OP_SU, mAppEntry.info.uid, mAppEntry.info.packageName);
                                                           ^
  symbol:   variable OP_SU
  location: class AppOpsManager

I noticed that the checked-out branch of frameworks/opt/telephony was fp2-sibon. The upstream branch fp2-sibon-2.0.2 was different. Perhaps we need to repo init ... -b fp2-sibon-2.0.2 … ?

edit I was able to compile only after running this after repo sync

find . -name \*.git -execdir git checkout fp2-sibon-2.0.2 \;

It worked!! Not sure precisely what I did that fixed it…

First I updated my Ubuntu vm (which I hadn’t done since February) and actually removed the out folder instead of just counting on make clean to clear it out. Then:
repo sync -c
. build/envsetup.sh
choosecombo 1 FP2 2
make

This was after adding the new sibon blob (as mentioned in my other post).

Edit:
I’m using java-7-openjdk-amd64

1 Like

I’m just wondering: On the download site http://code.fairphone.com/projects/fp-osos/dev/fp2-blobs-download-page.html , binary blobs are available in version 16.04.0. In both this article and the official build instructions http://code.fairphone.com/projects/fp-osos/dev/fairphone-os-build-instructions.html , version 2.0.1 is linked.
The new tgz file is 47mb, whereas the old one is 199mb.

Why is that so? What’s the difference and should I use the old one or the new one?

I have downloaded the blobs via bash unpacked them but when I try to run I get the following:

~/Fairphone_Open_OS$ s̶h̶ ̶f̶p̶2̶-̶s̶i̶b̶o̶n̶-̶1̶6̶.̶0̶5̶.̶0̶-̶b̶l̶o̶b̶s̶.̶t̶g̶z̶
fp2-sibon-16.05.0-blobs.tgz: 3: fp2-sibon-16.05.0-blobs.tgz.1: Syntax error: Unterminated quoted string

Can anybody tell me where this comes from?

Edit: Okay I got it. Fairphone Team should update the build instructions on code.fairphone.com. It has to be:

sh fp2-sibon-16.05.0-blobs.sh

of course. :sweat_smile:

Can anyone help please?

libnativehelper/JniConstants.cpp:138: error: unsupported reloc 43
libnativehelper/JniConstants.cpp:139: error: unsupported reloc 43
libnativehelper/JniConstants.cpp:140: error: unsupported reloc 43
libnativehelper/toStringArray.cpp:21: error: unsupported reloc 43
libnativehelper/toStringArray.cpp:21: error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:40: error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:45: error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43
clang: error: linker command failed with exit code 1 (use -v to see invocation)
build/core/host_shared_library_internal.mk:44: recipe for target ‘out/host/linux-x86/obj32/lib/libnativehelper.so’ failed
make: *** [out/host/linux-x86/obj32/lib/libnativehelper.so] Error 1
make: *** Waiting for unfinished jobs…
host StaticLib: libsigchain_32 (out/host/linux-x86/obj32/STATIC_LIBRARIES/libsigchain_intermediates/libsigchain.a)
make: *** wait: No child processes. Stop.

make failed to build some targets (57:27 (mm:ss))

I really try to be and keep patient, but I slowly get sick that even following instructions and tutorials is running into errors :unamused:

Can you please give some more information on your build setup? Also, please let us know which instructions you were following exactly.

BTW: Did you know that there is an official release of the same code? If you don’t want to change any code, you can just download a build from code.fairphone.com.

First, thank you for your answer. Here is my environment:

  • Kubuntu 16.04 LTS
  • AMD64
  • openJDK7-amd64
  • gcc 4.8.5
  • binblobs: 16.05
  • repo init -b refs/tags/FP2-open-16.05.0
  • I followed the instructions found here and on code.fairphone.com

The only suspicious behaviour I have observed was that I have no writing permissions in my home directory, when opening a textfile through krusader (tried to edit ~/Fairphone_Open_OS/.repo/manifests/default.xml to remove Setupwizard) It didn’t work. Tried again through terminal with gksudo. It worked, but then repo denied service at all with an cryptic error message. I already deleted the whole tree and downloaded it again :confounded: but the Linker-error persists.

And what you mention about downloading the official release. I would LOVE to do so, but I need working GPS with FPOSOS on my phone which was fixed only recently in 16.05. And code.fairphone.com doesn’t provide it yet.

Actually I do not understand that the blobs for 16.05 are available but no system release yet. How other may I use the binblobs but to compile my own version?

Well, there’s a problem if you can’t write in your home (or below). Did you do anything with sudo in your home before? This should be rectified…