问题
I am trying to build the Camera App from AOSP.
I am on UBUNTU 14.04.
I followed the guide in the official documentation. At the end I execute
make Camera
I get the following error.
...
...
including ./system/media/audio_utils/Android.mk ...
including ./system/media/camera/src/Android.mk ...
including ./system/media/camera/tests/Android.mk ...
including ./system/netd/client/Android.mk ...
including ./system/netd/server/Android.mk ...
including ./system/security/keystore-engine/Android.mk ...
including ./system/security/keystore/Android.mk ...
including ./system/security/softkeymaster/Android.mk ...
including ./system/vold/Android.mk ...
including ./tools/external/fat32lib/Android.mk ...
make: *** No rule to make target `Camera'. Stop.
#### make failed to build some targets (33 seconds) ####
1)How can I build a specific app from AOSP source and where does the output located? What is the format of output? Is it possible to produce an .apk file?
2)Is it possible to edit the source in Android Studio and compile it? I know that the official AOSP page contains some resources about eclipse already.
回答1:
I believe you first need to set up your build environment by calling:
##> source build/envsetup.sh
##> launche <your-device-config>
Only then, call the make command to build the Camera:
make Camera -j8
your device should be one of the device configurations, for example "hammerhead" is for Nexus5
回答2:
You have 2 camera apps. The old version is called LegacyCamera and the newer version Camera2. You don't need to run make in order to compile them. You can just run
'mmm packages/apps/Camera2'
OR
'mmm packages/apps/LegacyCamera'
回答3:
'make camera2' will build all the dependencies and then the actual camera2 app, which will be placed somewhere in out/, depending on your selected lunch target.
Once you've built it once to get the dependencies, mmm packages/apps/Camera2 will be a fast incremental compile, but it doesn't on its own build the dependencies.
来源:https://stackoverflow.com/questions/29736503/how-to-build-aosp-app