Building Android source: error when executing mm?
Asked Answered
G

1

2

Update

I got this working. How I am not sure. I did no config changes at all. What I did was:

  • Modify Dialog in frameworks/base/core/java/android/app.
  • Went to my root (/path/to/source/).
  • Then I did mmm frameworks/base/.

Everything worked. Then I tried exactly what I had already tried below:

  • Modify ScrollView (I actually never said which file I was modifying) in frameworks/base/core/java/android/widget.
  • I ch'ed to frameworks/base/core/java/android/widget.
  • Then I did mm.

This time I had no errors like before when the files were removed. Now it just works.

Maybe this was some caching or bug?

/Update

I am building the Android source code for the emulator. I built the whole code with make -j32 and the system.img gets to the output out/target/product/generic/system.img. The emulator works simply by calling emulator.

When I do changes in frameworks/base/core/java/android/widget, using the hmm documentation, the most appropriate command would be mm to build the current directory.

Unfortunately I get an error:

make: * No rule to make target

`out/target/product/generic/system/framework/framework-res.apk',

needed by `out/target/product/generic/system/framework/framework.jar'.

Stop.

make: Leaving directory `/path/to/source/'

Leaving me to do make -j32 again to get the emulator to run and apply my fixes.

Checking the out/target/product/generic/ folder after using the mm command, system.img has been removed with several other things.

When I read the logs this is printed:

* Forcing "make installclean"...

* rm -rf out/target/product/generic/data/* out/target/product/generic/data-qemu/*

out/target/product/generic/userdata-qemu.img

out/host/linux-x86/obj/NOTICE_FILES out/host/linux-x86/sdk

out/target/product/generic/.img out/target/product/generic/.txt

out/target/product/generic/.xlb out/target/product/generic/.zip

out/target/product/generic/kernel out/target/product/generic/data

out/target/product/generic/obj/APPS

out/target/product/generic/obj/NOTICE_FILES

out/target/product/generic/obj/PACKAGING

out/target/product/generic/recovery out/target/product/generic/root

out/target/product/generic/system

out/target/product/generic/dex_bootjars

out/target/product/generic/obj/JAVA_LIBRARIES

out/target/product/generic/obj/FAKE

out/target/product/generic/obj/EXECUTABLES/adbd_intermediates

out/target/product/generic/obj/EXECUTABLES/init_intermediates

out/target/product/generic/obj/ETC/mac_permissions.xml_intermediates

out/target/product/generic/obj/ETC/sepolicy_intermediates

* Done with the cleaning, now starting the real build. make: Entering directory `/path/to/source/'

My guess is that it will clean "outdated" data and then rebuild it with the already prebuilt Android source code BUT with my changes in the frameworks/base/core/java/android/widget folder.

Is this the right approach? I was under the impression mm would compile what was needed in the current directory and somehow insert this data to the system.img.

I have also seen the command mm -B, what does the -B do?

Gsuit answered 10/12, 2013 at 9:5 Comment(0)
D
1

It happened to me too.

I was able to solve it by using the mmm command.

From within the framework/base folder, I did:

mmm .

and after that all "mm" commands worked.

"mm -B" vs "mm": The -B switch if forcing the build w/o the use of any existing obj files (as doing clean and then build), where the "mm" command alone will use any existing obj files and continue the build from there. If you have a successful build - you can see that running "mm" won't do a thing, where "mm -B" will do a full build of the current module.

Dorm answered 10/12, 2013 at 17:17 Comment(4)
I see, thank you. Do you know why mm did not work the first time?Gsuit
No, I have no idea. It's especially weird because I'm pretty sure that running "mmm <path>" or "mm" inside the <path> should do the same.Dorm
I did a make clean and make, after that both mm and mmm stopped working for the folder frameworks/base/. What I did to fix it was to use the command mmm frameworks/base/core/res, then I could use my previous commands.Gsuit
I had that issue again and your command "mmm frameworks/base/core/res" solved it for me too.Dorm

© 2022 - 2024 — McMap. All rights reserved.