Error: File not found – The problem with using absolute paths.

While attemtping to add the Lionheart governor to my previously built kernel, I ran into an interesting problem:

[CODE]
firmware/audience-es325-fw-eur.bin.gen.S: Assembler messages:
firmware/audience-es325-fw-eur.bin.gen.S:5: Error: file not found: /home/alaskalinuxuser/Documents/projects/phones/compile/cm13/kernel/samsung/jf/firmware/audience-es325-fw-eur.bin
make[3]: *** [firmware/audience-es325-fw-eur.bin.gen.o] Error 1
make[2]: *** [firmware] Error 2
make[2]: *** Waiting for unfinished jobs….
[/CODE]

The file was right where it was supposed to be. I looked it over six times. It was right there. Then I realized the problem. It wasn’t right there, it was right here:

/home/alaskalinuxuser/Documents/projects/phones/compile/cm13-working/kernel/samsung/jf/firmware/audience-es325-fw-eur.bin

See the difference? It took me a minute as well. When I made a sucessful build of CM13, I then changed the folder to “cm13-working” to make it easy for me to distinguish which folders had good builds in them, and which folders were still a work in progress. Might sound strange, but I build for about 6 different roms in a round robbin sort of style, so a simpleton like myself can quickly become confused.

Ordinarily, this would not be a problem. Make, the program used to “make” things, is pretty smart, and usually all of the paths are dynamic, changing to the current folder. What had happened, however, was that somewhere along the line, I had a problem with a dynamic path, and as a quick and simple fix, I edited the file to have an absolute, or full, path. So, now that I had taken away the dynamic ability, the folders have to retain their original name to keep all of the files right where they are supposed to be.

Long story short, fix your dynamic paths if they have an error. If you use an absolute path, be sure you don’t ever rename or move anything. Ever. Or at least take good notes so you know what to change.

Linux – keep it simple.

Compiling CyanogenMod 13 for the Samsung Galaxy S4 T-Mobile (JFLTETMO SGH-M919)

This morning, when I came back to my computer, I was greeted with some very good news:

[CODE]
running: java -Xmx2048m -jar /home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/host/linux-x86/framework/signapk.jar -w build/target/product/security/testkey.x509.pem build/target/product/security/testkey.pk8 /tmp/tmp_q_ufQ /home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/target/product/jfltetmo/cm_jfltetmo-ota-612d9cd77f.zip
done.
Package Complete: /home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/target/product/jfltetmo/cm-13.0-20160510-UNOFFICIAL-jfltetmo.zip
make: Leaving directory `/home/alaskalinuxuser/Documents/projects/phones/compile/cm13′

#### make completed successfully (06:38:09 (hh:mm:ss)) ####
[/CODE]

Particularly that last line that says that the third build attempt was successful! That was good news indeed. However, I tend not to get my hopes up too high. Often when compiling an Android OS I have run into an issue where the rom successfully builds, but doesn’t actually work. There is error checking on the build process, but there is not error checking on the build function. It is like following instructions to build a paper airplane (a really complicated one). You get errors if the instructions are incomplete, or if they don’t make sense, but you don’t get an error if the paper airplane doesn’t actually fly.

In this case, however, the build was not only successful, but it actually booted and most of the functions were working! This is a step in the right direction to say the least. As always, after loading any new rom, mine or someone elses, I perform this less than 10 minutes basic test:

-WiFi
-Cellular 2g/3g/LTE
-Bluetooth
-GPS
-Sensors
-MTP USB connection

With this build, everything was functional except the Bluetooth. For some odd reason it will not turn on. Bluetooth is a love it/leave it sort of thing. For most, Bluetooth is an integral part of the Android experience. For others, it is something that they never use. In either event, I would rather that it works than not. That, however, is troubleshooting for another time. For now, I am just excited that the build was successful and functioned realatively well!

For any interested party, here is a download link to my home build:
http://www.mediafire.com/download/22c467sgqw0ema7/cm-13.0-20160510-AKLU-jfltetmo.zip

Linux – Keep it simple.

Compiling CyanogenMod 13 for the Samsung Galaxy S4 T-Mobile (JFLTETMO SGH-M919)

In the continuing adventures of attempting to compile CyanogenMod 13 for the Samsung Galaxy S4 T-Mobile (JFLTETMO SGH-M919), on my second build attempt, I have run into another road-block. Yesterday I had an error due to a command not found, but today we have a new error:

[CODE]
Import includes file: /home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/target/product/jfltetmo/obj/STATIC_LIBRARIES/libvterm_intermediates/import_includes
Export includes file: packages/apps/Terminal/jni/Android.mk — /home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/target/product/jfltetmo/obj/SHARED_LIBRARIES/libjni_terminal_intermediates/export_includes
Notice file: external/libvterm/NOTICE — /home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/target/product/jfltetmo/obj/NOTICE_FILES/src//system/lib/libvterm.a.txt
make: *** No rule to make target `vendor/samsung/jf-common/proprietary/app/TimeService/TimeService.apk’, needed by `/home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/target/product/jfltetmo/obj/APPS/TimeService_intermediates/package.apk’. Stop.
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 unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
make: Leaving directory `/home/alaskalinuxuser/Documents/projects/phones/compile/cm13′

#### make failed to build some targets (05:21 (mm:ss)) ####
[/CODE]

Once again, you can always spot the problems in your compiling logs by looking for 4 key words: Failed, Error, Warning, and Stop. In this case, the key word was Stop. This time, the fault is on the same line as the stop command.

[CODE]
make: *** No rule to make target `vendor/samsung/jf-common/proprietary/app/TimeService/TimeService.apk’, needed by `/home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/target/product/jfltetmo/obj/APPS/TimeService_intermediates/package.apk’. Stop.
make: *** Waiting for unfinished jobs….
[/CODE]

What we see here is a failure to create something that is needed by something else. Essentially, the compiler does not know how to make the TimeService.apk, which is needed by package.apk. Note that we are not clueless as to it’s location. It should be in the “vendor/samsung/jf-common/proprietary/app/TimeService/” directory. Upon going to that directory, which does exist, the directory is empty. There should be some sore of Android.mk file there with instructions for the compiler to follow.

Here is where we come to a crossroad. We have two choices:

1. Find the files that are needed for this apk, and put them where they need to be.

OR

2. Find the file that references building this apk and comment it out.

The first option is technically the best option. There is a reason this apk is called for. However, this may require lots of time, searching, and downloading of material. A quick search of the TimeService.apk revealed several sites that believe it to be in cahoots with the MonkeyService.apk, and the two of them automatically download and install apps on your phone. Or, as most would call it, bloat-ware.

Not being too thrilled with it’s supposed function, I decided to take the lazy route of step 2 and simply comment out the reference to build it. Here is where a little bit of Android compiling know how has to come into play. Or, if your like me, and don’t know anything, just look through all the basic files until you find what you are looking for.

The heirarchy of build seems to go somthing like this: in the device/samsung/jfltetmo folder, it has a boardconfig.mk file. That file calls the device/samsung/jf-common/boardconfig.mk file and the vendor/samsung/jf-gsm-common/BoardConfigVendor.mk file. Since our problem is in the vendor directory, I went to the vendor/samsung/jf-gsm-common/BoardConfigVendor.mk file. Well, that didn’t help. There were 3 files there, and none of them referenced the issue.

However, our error told us that the issue was in the `vendor/samsung/jf-common/proprietary/app/TimeService/TimeService.apk’, so I went to the vendor/samsung/jf-common/ directory and found that there was an Android.mk file that said (among other things):

[CODE]
include $(CLEAR_VARS)
LOCAL_MODULE := TimeService
LOCAL_MODULE_OWNER := samsung
LOCAL_SRC_FILES := proprietary/app/TimeService/TimeService.apk
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_MODULE_CLASS := APPS
LOCAL_CERTIFICATE := platform
include $(BUILD_PREBUILT)
[/CODE]

Which I changed to:

[CODE]
#include $(CLEAR_VARS)
#LOCAL_MODULE := TimeService
#LOCAL_MODULE_OWNER := samsung
#LOCAL_SRC_FILES := proprietary/app/TimeService/TimeService.apk
#LOCAL_MODULE_TAGS := optional
#LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
#LOCAL_MODULE_CLASS := APPS
#LOCAL_CERTIFICATE := platform
#WJHinclude $(BUILD_PREBUILT)
[/CODE]

Now, when I re-run the build, it will not attempt to build this package. So, let’s give it a try! I’ll let you know how it goes.

Linux – Keep it simple.

Compiling CyanogenMod 13 for the Samsung Galaxy S4 T-Mobile (JFLTETMO SGH-M919)

So I have been attempting to compile CM13 for my Samsung Galaxy S4 T-Mobile (JFLTETMO SGH-M919) phone. The first thing I did was read the entire guide here:

https://wiki.cyanogenmod.org/w/Build_for_jfltetmo

Which looked very helpful and promissing. I followed the instructions to a proverbial “T”. I even reloaded my machine with Ubuntu 14.04 just like what was used in the guide. However, the process stoped and I ran into this error:

[CODE]
Export includes file: packages/apps/Terminal/jni/Android.mk — /home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/target/product/jfltetmo/obj/SHARED_LIBRARIES/libjni_terminal_intermediates/export_includes
Notice file: external/libvterm/NOTICE — /home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/target/product/jfltetmo/obj/NOTICE_FILES/src//system/lib/libvterm.a.txt
Notice file: packages/providers/UserDictionaryProvider/NOTICE — /home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/target/product/jfltetmo/obj/NOTICE_FILES/src//system/app/UserDictionaryProvider/UserDictionaryProvider.apk.txt
Notice file: frameworks/base/packages/WAPPushManager/NOTICE — /home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/target/product/jfltetmo/obj/NOTICE_FILES/src//system/app/WAPPushManager/WAPPushManager.apk.txt
/bin/bash: mvn: command not found
make: *** [/home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/target/common/obj/JAVA_LIBRARIES/ambientsdk_intermediates/com.cyngn.ambient.ambientsdk-1.5.8.aar] Error 127
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 unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
make: Leaving directory `/home/alaskalinuxuser/Documents/projects/phones/compile/cm13′

#### make failed to build some targets (04:26 (mm:ss)) ####
[/CODE]

Note that the compile failed 4 hours and 26 minutes after I started it. So what failed? Well, apparently, these line are the key:

[CODE]
/bin/bash: mvn: command not found
make: *** [/home/alaskalinuxuser/Documents/projects/phones/compile/cm13/out/target/common/obj/JAVA_LIBRARIES/ambientsdk_intermediates/com.cyngn.ambient.ambientsdk-1.5.8.aar] Error 127
[/CODE]

Whenevery you are compiling, you can always spot the problems in your logs by looking for 4 key words: Failed, Error, Warning, and Stop. In this case, the key word was Error. Simply trace that path backwards, or in our case, up one line, and you see what looks like an error in the form of “command not found”. In this case, it cannot find the mvn command, which is a command to start the Maven system. The Maven system is a tool to build Java-based projects. If you didn’t know that, don’t feel bad, I had to look it up, too.
The question was, how do I fix it? Here I spent some time at the terminal.

[CODE]
$ mvn
The program ‘mvn’ is currently not installed. You can install it by typing:
sudo apt-get install maven2

$ sudo apt-get install maven2
[/CODE]

This required a lot of dependencies, which proves that the guide does not actually include all of the needed pre-requisites. It makes me wonder, however, if there are more missing programs or files that I need which are not put into the instructions. So, back to work, and we will see what happens when we run the compiler again.

Linux – Keep it simple.