First of all, thank you guys for all of the work that already went into this thread. It helped a lot to avoid some pitfalls.
I tried to build yesterday with limited success (i’ll list the steps I took below). I ended up with a successful build and was able to flash it to the FP. If I turn on the phone now, one of two things happen, and I’m not exactly sure what the conditions are under which each of them happens:
- Boot to the black/white Fairphone logo (fastboot)
- Boot to the black/white Fairphone logo (fastboot), then the blue logo shows (“start a movement”), then it goes into a grey screen with “LOADING…” flashing in white and the green LED goes on and off once in a while.
I left the phone in mode 2. over night but nothing changed.
Does anyone have an idea what to try next?
Details
For reference, here are the steps I took, and problems I ran into along the way:
My host system is a 64 bit Ubuntu 15.04, where I installed all recommended packages. For zlib1g-dev I first installed the wrong version (64 bit) which made the installation of zlib1g-dev:i386 fail. I then removed zlib1g-dev and installed zlib1g-dev:i386, which worked fine. For the jdk I first installed version 8 as recommended by the general android site the was linked from the build instructions, I then noticed that the build instructions recommend to use version 7 and installed that as well. I also installed gcc-4.8 and g+±4.8 and used update-alternatives
to make them the default compiler (I also used this to select jdk version 7 of java and javac). I verified that gcc --version
, g++ --version
, java -version
, javac -version
all show the expected values (gcc/g++: 4.8.5, java/javac: 1.7.0_95). I also added export USE_CCACHE=1
to my zshrc, but that should not matter because I later switched to bash and ccache should only really help if you do make clean
a lot. I also added the rules for USB access as described here: https://source.android.com/source/initializing.html
After registering an account with gerrit, adding my ssh key, I got error messages because the host was not known. The page where you add your ssh key (user preferences?) also shows a line that should be added to ~/.ssh/known_hosts
. After adding this, there was a different error (can’t remember), so I retried over https, which worked fine.
Syncing the repository showed a 404 error after every subrepo but @kuleszdl mentioned those are normal. I then downloaded the blobs (version 2.0.1) extracted them and ran the shell script. This gave a warning because it only supports bash and I was using zsh so far. After switching to bash, it worked.
. build/envsetup.sh
and choosecombo 1 FP2 2
worked with anything unusual, so I ran make -j4 2>&1 | tee build.log
(I don’t have enough cores for -j8
). The compile got stuck with the same message that @sjjh reported earlier: You have tried to change the API from what has been previously approved.
. I ran make update-api
followed by another call to make -j4 2>&1 | tee build.log
and the compile was successful. I had a look at the build logs but did’nt read all of it (90k+ lines). I noticed a lot of warnings about uninitialized fields, implicitly defined functions and so on. Some of them sounded like code smells (uninitialized values, etc.), others sounded like legit bugs (checking that and unsigned int is >= 0 is always true, so the test probably does not have the intended effect). I don’t think they are problematic here, though, because you would probably get the same warnings in every android build.
As a next step I tried flashing the images. My user shell did not have the access rights to the Fairphone despite the USB rules, so I started a root shell (bash), repeated . build/envsetup.sh
and choosecombo 1 FP2 2
and used fastboot from there. I flashed the following images in this order:
fastboot flash recovery recovery.img
fastboot flash system system.img
Then rebooted and got to the “LOADING…” screen I described above.
This morning, I tried fastboot flashall
with the same result. I then booted to recovery, wiped the cache and used fastboot flashall
again. Same result: I got to the “LOADING…” screen but not further.
If you read this far (thank you), I have two more questions:
Is it ok to flash the images as the root user?
Is there some way to see what’s going on during the loading screen?