[Q] How to Add Project to Android Build? - Android Q&A, Help & Troubleshooting

Hi All,
I'm having a problem with building an Android ROM (galaxys2att, gingerbread). I decided it was time to get smarter about makefile processing. So I created a simple test project to play with. But it's not getting compiled. Here's what I did:
1. I create a directory ("myproject") under a buildable module (I used Mms but others had the same problem).
2. I create Android.mk in that directory containing
hello:echo "Hello from myproject"​3. I ran "mm" in the Mms directory.
Mms and other subproject compiled but no evidence of myproject.
Android.mk in Mms contained line
include $(call all-makefiles-under, $(LOCAL_PATH))
Of course I ran "envsetup.sh" originally.
What am I missing here?
Thanks
-John

Related

Questions about Android source code for N1

Hi,
Followed cyanogen's instruction in his wiki, I could build and flash my own ROM to N1, and it is working. Thanks cyanogen so much for everything he has done with Android.
However, the instruction is based on cyanogen's source code. Now, I am trying to figure out how to build a new ROM from pure Android source code (i.e. the one from AOSD).
I obtained the eclair branch as follows:
Code:
repo init -u git://android.git.kernel.org/platform/manifest.git -b eclair
repo sync
My questions are:
1. There is not any directory under ./vendor for N1 (i.e. passion). I can see only directories for Dream & Sapphire. Does it mean I can build only ROM for Dream/Sapphire? The following result seems support that point. Did I misunderstand some points?
Code:
$ sed -n -e "s/^add_lunch_combo//gp" vendor/*/vendorsetup.sh
aosp_emulator_us-eng
aosp_emulator_eu-eng
aosp_dream_us-userdebug
aosp_dream_eu-userdebug
aosp_dream_us-eng
aosp_dream_eu-eng
aosp_sapphire_us-userdebug
aosp_sapphire_eu-userdebug
aosp_sapphire_us-eng
aosp_sapphire_eu-eng
2. There is not extract-files.sh there. So I suppose I need to use the file from cyanogen. But what else should I do to be able build a new ROM?
Any help is really appreciated!
I'm just as clueless as you are to this--but when I compiled for the HTC Touch, all I did was pull down the stock AOSP build (repo sync) and simply ran "make" from the root directory, which produced a blank System image.
From there, I either copy & pasted the compiled library .so files into the image (to provide driver support), or if necessary to have the source compiled for the version, I included the source into the repo sync directory and ran the "make" which would also produce a compiled library.so that functioned.
Not sure any of this will help, but I figured I'd offer what I could.
Shidell said:
I'm just as clueless as you are to this--but when I compiled for the HTC Touch, all I did was pull down the stock AOSP build (repo sync) and simply ran "make" from the root directory, which produced a blank System image.
From there, I either copy & pasted the compiled library .so files into the image (to provide driver support), or if necessary to have the source compiled for the version, I included the source into the repo sync directory and ran the "make" which would also produce a compiled library.so that functioned.
Not sure any of this will help, but I figured I'd offer what I could.
Click to expand...
Click to collapse
Thanks Shidell. So you meant that it worked for your HTC Touch?
How do you copy & paste library files into image?
How do you include the source into the repo sync directory?

[Q] Best way to compile Superuser.apk?

android-10 target
No resource found that matches the given name 'android:Theme.Holo.Light'.
This is apparently because It needs a Honeycomb target number.
android-15 target
AppDetailsActivity.java:20: package android.support.v4.app does not exist
I found this link with the same problem:
http://groups.google.com/group/android-building/browse_thread/thread/9ae77ba4b24407db
But after adding the three lines suggested to Android.mk I still get the same errors.
The thread references the library as android.support.v4 but the original Android.mk shows android-support-v4. Does this have anything to do with the error?
Naturally, Android Support Package has been installed.
What SDK version should I be targeting?
edit:
I think I got this working by copying ~/android-sdk-linux/extras/android/support/v4/android-support-v4.jar to the lib folder in the project directory.
Without this link I would not have been able to get it fixed in a timely manner:
http://myandroidnote.blogspot.com/2011/04/using-fragment-of-android-compatibility.html
edit:
Please see first post.

Compile help with classes not in android.jar

Trying to compile some samples from the Android SDK.
I just took the AccelerometerPlay example, ran the command:
Code:
android update project -p . -t 1
which creates the Ant build file, then
Code:
ant release
which builds release APK files.
The problem is, if I add something like:
Code:
import android.util.Slog;
to the .java file, the build fails, claiming that it can't find the file (even though it exists in {sdk_path}/sources/android-15
I'm guessing that it looks for .class files inside {sdk_path}/platforms/android-15/android.jar , where android/util/Slog.class doesn't exist.
How do I get this build to work?
I've tried adding
Code:
<src path="${sdk.dir}/sources/android-15" />
under the <javac> task in {sdk_dir}/tools/ant/build.xml, but it seems to throw out more errors, whilst also appearing to try to compile every single .java file there.
I'm new to Java so really don't know what I'm doing - can anyone please point me in the correct direction?
Thanks.
Anyone have any idea?
If you're new to Java, you may want to give Eclipse a try. You won't have to mess around with Ant too much and it will help you with your syntax/imports.
From your description, it looks like you'll want to add the .jar file you mentioned to the 'classpath' attribute of the <javac> element in your ant XML file.
- chris
Thanks for the reply cttttt.
What .jar file are you referring to? android.jar? Because that doesn't have the classes as far as I know.
Eclipse gets me even less further - I can't seem to install the ADT plugin at all. On Eclipse 3.7.2, it throws the WST error, and when I try the solutions "that work", I get thrown network errors.
(so at least I can get a build actually going with Ant)

[Q] aosp initramfs/ramdisk source

I am working on building from aosp 4.4.2. I have built it with the pre-built kernel without any problems. Then, I managed to get a custom kernel code in place and it builds. Now the only thing left to do is the initramfs/ramdisk for the custom kernel I have in place. Currenlty my build will not boot. I suspect it is using the initramfs/ramdisk from aosp.
Can someone point me to the source files or files that handle the initramfs/ramdisk? I have found bits and pieces strewn throughout the source code but cannot pinpoint the indivitual files or the script/mk file that produces the ramdisk found in the out folder after my system finishes building.
I kinow I can change the initramfs/ramdisk manually by repacking the boot.img, but I would prefer everything be completed in the updatpackage.
what device do you have?
Anyways, just decompile the working boot.img with dsixda's kitchen, and replace the zImage, build it again and done
broodplank1337 said:
what device do you have?
Anyways, just decompile the working boot.img with dsixda's kitchen, and replace the zImage, build it again and done
Click to expand...
Click to collapse
I have a Nexus 5. I'm trying to avoid the, "build it again."
I would like to envsetup, lunch, make clean, make updatepackage, flash and done.
So, I'm still trying to figure out, how make knows where to get all the files and create the ramdisk in the out directory.
AOSP radisk
I am no expert but I think this is how ramdisk is built and it worked for me al the time. ramdisk is composed from the directory 'root' in the product build output folder. the contents are coming from different part of the build tree, mostly from the device source, vendor source. for eg:- check hammer head tree for omni https://github.com/omnirom/android_device_lge_hammerhead in the device.mk you can see PRODUCT_COPY entries to the root similar thing goes with vendor makefiles. If you are looking for executable built from source you can set
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) so that they will end up in initrd
related to this: I can see using PRODUCT_COPY_FILES to stage files to the root directory. but where is the directory structure created? Such as /firmware ... etc? I am trying to add a directory to the root fs. When I just create a new directory such as /foo the build fails. I want the new directory to be permanent part of the build process so solutions like unpack - modify - repack is less than satisfactory. Thanks

[SOLVED][Q] Help adding Gradle based library to my non-Gradle non-Eclipse project

I'm trying to use HoloColorPicker by Lars Werkman, now I'm not using Eclipse or the Android Studio, I'm doing everything via command line and advanced text editors (that's just how I like it). Now the problem I'm running into is HoloColorPicker uses Gradle, so it doesn't have a build.xml file, giving me this error when I try to build:
Invalid file: /HOMEFOLDER/DevTools/AndroidLibs/HoloColorPicker/build.xml
I used the `android update project` command to add the library to my project, so how do I either convert the Gradle project to a standard android proect, or get it to build the library with gradle instead of build.xml???
Any help is greately apprecieated, thanks.
Well, I think I figured it out, all I had to do was open a terminal in the folder of library project and run this:
android update lib-project --path . --target 1
Afterwards it created the appropriate files that were needed and it now compiles, of course I won't know for 100% certainty until I actually use some things from the library and get it to run.
Well, I've tested it and this did fix my issue, I was able to successfully import the library.

Categories

Resources