As an experiment I am trying to rebuild some standard android applications and replace them in system/app on the G1. I have been through all the steps to get the source code and build for the dream platform and have built the various .apk files of interest (e.g. AlarmClock.apk, Browser.apk etc)
To put the files on the device I delete the old .apk and .odex files and copy my newly built .apk file on to the device. However when I try to run the application it crashes with the following message.
The application Alarm Clock (process com.android.alarmclock) has stopped unexpectedly. Please try again.
I know that replacing the applications like this is possible, because the AutoRotating Browser build works fine when copies over in this manner.
I'm using JF1.31 (RC8)
My initial reaction was that I was not signing the applications properly but having read some posts I think the default built .apk should have the right key already in it.
Another theory I have is that perhaps the applications from the head of the source tree are not compatible with the RC8 (or RC30) Android OS releases. Can anyone tell me how to get the source tree which corresponds to this baseline, I've done some reading around but cannot figure it out. I presume I need to do a repo init -u git://android.git.kernel.org/platofrm/manifest.git -b BASELINE but I can't figure out what BASELINE should be.
Many thanks in advance for any help you can give me!!!
There are some branches in android sources:
master
cupcake
release-1.0
Apps from the first two will not run on default G1, you need to reinstall a whole system. I think by default, following google docs you'll get master. So you need to download a release-1.0 sources.
I may be wrong, but that is what I'm see from my experience.
Thanks for that, I'll get the 1.0 branch downloaded and have a go with that.
Cheers for your help!
I was also trying to recompile some of the built-in apps, specifically the browser, but I can't even get it to build. I get a bunch of import errors, stating that it can't find some of the android libraries, such as android.net.http.AndroidHttpClient, android.os.AsyncTask, etc. I've got the android.jar from the SDK in my build path, and it finds some of them, such as android.webkit.URLUtil.
Can anyone shed some light on what I need to do to get it to see the missing libraries? Thanks.
UndeadCretin said:
Thanks for that, I'll get the 1.0 branch downloaded and have a go with that.
Cheers for your help!
Click to expand...
Click to collapse
There are around a dozen build breaks in release-1.0... all of them are due to missing header #includes in various .c and .h files. So, when it doesn't work, don't give up. Fix the breaks and everything will build properly.
Are you resigning the .apk files? Cuz you have to do that for them to work correctly.
Koush said:
There are around a dozen build breaks in release-1.0... all of them are due to missing header #includes in various .c and .h files. So, when it doesn't work, don't give up. Fix the breaks and everything will build properly.
Click to expand...
Click to collapse
Yep I fixed these problems but I have now hit upon the following problem:
(unknown): error 17: Field android.hardware.SensorManager.LIGHT_NO_MOON has changed value from 0.0010f to 0.001f
******************************
You have tried to change the API from what has been previously released in
an SDK. Please fix the errors listed above.
******************************
I've been in and modified SensorManager back to 0.0010f and that let me build get further but I hit the same error again later in the build.
Given that release-1.0 should be a stable branch is it normal to get all these build issues?
Managed to fix the java issue by modifying public_api.xml. Then hit several more C++ problems which I fixed and finally I can build the lot!
Just tried building the AlarmClock application and running on the G1 and it works fine. Thanks everyone for your help!
>Managed to fix the java issue by modifying public_api.xml. Then hit several more C++ problems which I fixed and finally I can build the lot!
Can you write, what did you fix?
^ Agreed, let us know which files need modifying and what needs doing, i've been trying to get my release-1.0 build root working too!
Alternatively, UndeadCretin, could you build the firmware (release-1.0) with a modified framework-res i can send you?
Ok, I managed to compile it without any editing of xml.
Just added stdlib, string, vector headers to dozen of cpp/h.
worry said:
>Managed to fix the java issue by modifying public_api.xml. Then hit several more C++ problems which I fixed and finally I can build the lot!
Can you write, what did you fix?
Click to expand...
Click to collapse
To fix the java issue, I modified frameworks/base/core/java/android/hardware/SensorManager to change the LIGHT_NO_MOON value to 0.0010f (from 0.001f) and in out/target/common/obj/PACKAGING I modified the <field name="LIGHT_NO_MOON" to have value-"0.0010f">
After this there were several other c++ files which were missing relevant includes. I'm afraid I didn't keep a note of these so cannot provide much detail but mostly they were missing one of the following
#include "stdlib.h"
#include "string.h"
#include "stdio.h"
I think one file needed the following include
#include <string>
and there were a couple of other files that needed other includes. The best way to find these is to google for the function name that isn't building and you should be able to find the appropriate include (that's how I did it).
Hope that helps a bit!
were you able to repo sync after adding the local_manifest.xml?
ximonx said:
were you able to repo sync after adding the local_manifest.xml?
Click to expand...
Click to collapse
I did try that previously but it didn't work. I don't think the relevant files for the dream build are available in the release-1.0 branch. This wasn't a problem for me since I'm only interested in building the applications which work fine with the generic build.
I would like to do the same for the mms application. Could you give me the steps or a link how to do it? I mean do I need the whole sources from android platform to do it? How can I just compile one application?
Phlogiston said:
I would like to do the same for the mms application. Could you give me the steps or a link how to do it? I mean do I need the whole sources from android platform to do it? How can I just compile one application?
Click to expand...
Click to collapse
I downloaded the whole Android source (the release-1.0 branch) and compiled the lot. It may be possible to just build the individual application but I do not know how. It is not vital to build for the dream platform if you only care about the applications since they will work fine with the generic build.
So the basic steps to start are:
Get yourself a Linux or Mac OS platform (I use Ubuntu running in VMWare on my XP box).
Follow the instructions here: http://source.android.com/download but when you come to repo init add the flag -b release-1.0
Fix various build problems
When recompiling individual apps to replace system apps is there a way of just building a single application or does the entire thing need making?
ximonx said:
When recompiling individual apps to replace system apps is there a way of just building a single application or does the entire thing need making?
Click to expand...
Click to collapse
My experience is that you have to do the whole thing if you are building from source. There is one way I know of to get around this, which is to use baksmali and smali.
Just to be clear, making the entire thing = build from source root?
ximonx said:
Just to be clear, making the entire thing = build from source root?
Click to expand...
Click to collapse
If you are asking me--yes, that's what I mean. Make sure to build for dream-open as the target (it's generic by default).
I have recently unwillingly upgraded from my Samsung Mesmerize I500.01 to the newer Samsung Mesmerize I500.04 in the process of reinstalling my OpenVPN client (the whole reason my company pays for me to have the phone). I discovered that the version of the tun.ko module i have will not work with the newer phone.
I have scoured the internet trying as many different versions of the tun.ko as i could and none will work they all fail with "failed (exec format error)".
After realizing there may not be a pre-compiled one available i moved on to trying to compile my own (which I've never done) . Now it seems as though not only is my directory layout a bit different but I'm missing key files that are referenced in the process ( config.gz ) and cannot find any how-to's that take into account the unique obstacles of this particular version of phone. Of course if someone has this exact same phone and a working module that would be great otherwise I'd love to get help compiling my own.
The Phone is Samsung Mesmerize SCH-I500.EC10 Kernel Version 2.6.32.9 (no additional subversion) Firmware Version 2.2.1
I downloaded a couple source versions off of the Samsung site that seem to be for this phone but I'm not sure exactly which one i should use.
I have experience in Linux but none in development/compiling.
Help would be very much appreciated. And i did search for 4 full work days before posting this thread.
-Jace
Solution Found
After much trial and error i finally managed to compile a working Kernel module for this phone. I will post it here so others with this model may use it.
I know this is an old thread ... but I'm now looking for tun.ko for 2.3.4 ...
Or instructions on compiling it my self ...
Thanks
compiling
Guidojones,
I bellieve i have a document that i made while compiling my tun driver that should be able to help you through the process. I will scour for it this evening and see if i can't come up with something for you.
-Jace
tinookoo said:
Guidojones,
I bellieve i have a document that i made while compiling my tun driver that should be able to help you through the process. I will scour for it this evening and see if i can't come up with something for you.
-Jace
Click to expand...
Click to collapse
Tinookoo,
Were you able to find the document for creating the tun.ko file? I am also interested in compiling it for 2.3.4.
Thank you,
craknjak
i am looking for new threads please help me to find new threads
I'm trying to follow this tutorial.. http://forum.xda-developers.com/showthread.php?t=1455382 the thing is when I type:
make -j5 modules I get this error:
/bin/sh: arm-none-linux-gnueabi-gcc: not found
I'm using chroot Ubuntu 9.10 in my device (Aurora 2), please help me ... I've been reading a lot but cannot find a solution. :crying:
any idea?
azaotl said:
I'm trying to follow this tutorial.. http://forum.xda-developers.com/showthread.php?t=1455382 the thing is when I type:
make -j5 modules I get this error:
/bin/sh: arm-none-linux-gnueabi-gcc: not found
I'm using chroot Ubuntu 9.10 in my device (Aurora 2), please help me ... I've been reading a lot but cannot find a solution. :crying:
Click to expand...
Click to collapse
anyone'?? if I'm compiling and not cross-compiling (my guess)... so why is asking for that?
It's been some time since I compiled my kernel, but somewhere there's a setting that's making the compiler think you want to cross-compile. Search your files for "arm-none-linux-gnueabi-gcc" and see where that setting is.
post-mortem said:
It's been some time since I compiled my kernel, but somewhere there's a setting that's making the compiler think you want to cross-compile. Search your files for "arm-none-linux-gnueabi-gcc" and see where that setting is.
Click to expand...
Click to collapse
Thank you, so You mean that I have to find somewhere in my chroot-system the arm-none-linux-gnueabi-gcc or somewhere in my kernel files that i'm trying to compile?? I've been suffering a lot with this.. I'm trying to compile RTL8187 for my aurora 2 because my onboard wifi isn't working at all so that's why... I need this... =( I have cross-compiled the modules before using ubuntu, but the thing was that Android is ignoring them, so I just can use the browser but can't enter to market , 'cause Android is not detecting my wifi or something. So my guess is that if I compiled this "natively" wifi would function in a better way... thank you for the idea... I will try to search for that setting...
alright im trying to build aosp for the p505. i have a ubuntu 10.04 build environment set up, adb working, and some knowledge with repo and git. though nothing to brag about.
my problem is trying to get the prop files for lgp505 gingerbead. i dont know what files to pull from stock, or how to make the make files, let alone how to put them into the device folder correctly. then theres the manifest.xml that i dont quite understand.
if anyone would give me some pointers or point me towards a guide that would be greatly appreciated.
thanks.
savagephoenix said:
alright im trying to build aosp for the p505. i have a ubuntu 10.04 build environment set up, adb working, and some knowledge with repo and git. though nothing to brag about.
my problem is trying to get the prop files for lgp505 gingerbead. i dont know what files to pull from stock, or how to make the make files, let alone how to put them into the device folder correctly. then theres the manifest.xml that i dont quite understand.
if anyone would give me some pointers or point me towards a guide that would be greatly appreciated.
thanks.
Click to expand...
Click to collapse
With basic knowledge its gonna be hard to build aosp for your device. What ver of aosp? 2.3.7?
Remember it is required to have a x64 operating system for build aosp onward from froyo. Try compiling cm7 a couple times then move towards aosp. Cm7 will help a lot ! I know from experience
it is 64bit. yes 2.3.7, yes i plan to try cm7 also...
still need to get prop files for my device in the gingerbread branch.
thanks
111 views and not a one can atleast point me in a direction, or tell me im off my rocker.
a book , a guide... something that would help. please...
maybe this thread being moved will help... not holding my breath though...
I want to build a module for my atrix HD w/ kernel ver 3.0.42-gebf622c. I think I found the source code, but I cannot figure out which config file to use. I have never built a linux kernel for an android before, so I am sure I will run into all kinds of trouble. Can someone give me some pointers for bootstrapping this process? I at least need to know where to find the .config file used to configure this kernel. Shorter term, does anyone have a tun.ko for this kernel?
Thanks!