i was trying to build framework-res.apk
i went into android_frameworks_base/core/res from terminal
theres an Android.mk file there:
Code:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_NO_STANDARD_LIBRARIES := true
LOCAL_PACKAGE_NAME := framework-res
LOCAL_CERTIFICATE := platform
# Tell aapt to create "extending (non-application)" resource IDs,
# since these resources will be used by many apps.
LOCAL_AAPT_FLAGS := -x
LOCAL_MODULE_TAGS := optional
# Install this alongside the libraries.
LOCAL_MODULE_PATH := $(TARGET_OUT_JAVA_LIBRARIES)
# Create package-export.apk, which other packages can use to get
# PRODUCT-agnostic resource data like IDs and type definitions.
LOCAL_EXPORT_PACKAGE_RESOURCES := true
include $(BUILD_PACKAGE)
# define a global intermediate target that other module may depend on.
.PHONY: framework-res-package-target
framework-res-package-target: $(LOCAL_BUILT_MODULE)
and then i did
make framework-res
make: *** No rule to make target `framework-res'. Stop.
can u help me with the process? im just a beginner.
Related
I'm compiling android from source. I've set up the environment, and tested the builds. Everything works fine.
My current objective is to add 10 custom xml files to /system/etc/permissions. I've tried modifying the Android.mk file in frameworks/base/data/etc to include the files, but the additions aren't appearing in the compiled system. What's strange is that the default files that were in the same folder and already in the makefile appear, so the makefile seems to be read and parsed at compile.
This is the code I'm using:
Code:
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := [B]default_file_already_present.xml[/B]
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := [B]my_custom_file.xml[/B]
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
For some reason, my_custom_file is not added, while the default_file_already_present is. Any ideas?
I've searched around, but can't find any decent documentation. I feel like I’m very close, so any help is much appreciated!
tl;dr - Adding files to system partition with makefile partially fails.
Solution!
For those who also run in to this problem:
As per Jean-Baptiste Quéru's post on a google group;
The Android makefiles are essentially split into 2 primary categories,
parsed in this order.
-the product definitions, which specify what modules need to be
installed for each product.
-the module definition, which specify how to build each module.
The build system protects itself against situation where you modify
the product definition from a module definition. PRODUCT_COPY_FILES is
part of the product definition, and can't be modify from a module
definition.
JBQ
Click to expand...
Click to collapse
What this means is that in order to copy files as is to the system image, we need to use product definitions.
What I did was first run ./build/envsetup.sh, in order to get access to commands like mgrep, etc.
I noticed that in frameworks/base/data/keyboards there was a keyboards.mk file, which got included correctly.
I made a copy and modifies it to suit my needs:
Code:
# Copyright (C) 2010 The Android Open Source Project
#
blah blah blah...
#
# This is the list of custom permissions to be injected in /system/etc/permissions
permissionsfiles := \
android.hardware.camera.front.xml \
android.hardware.usb.accessory.xml \
android.hardware.usb.host.xml \
android.hardware.wifi.direct.xml \
android.hardware.wifi.xml \
android.software.sip.voip.xml \
com.google.android.maps.xml \
com.google.android.media.effects.xml \
com.google.widevine.software.drm.xml \
handheld_core_hardware.xml \
platform_plus.xml \
features.xml
PRODUCT_COPY_FILES := $(foreach file,$(permissionsfiles),\
frameworks/base/data/etc/$(file):system/etc/permissions/$(file))
I ran "mgrep keyboards" and noted which makefiles included the keyboards.mk file, then I opened each file and duplicated that line, modifying it to instead include my custom_permissions.mk located in frameworks/base/data/etc/.
I compiled and the files were all there.
Hope this helps.
I'm compiling android from source. I've set up the environment, and tested the builds. Everything works fine.
My current objective is to add 10 custom xml files to /system/etc/permissions. I've tried modifying the Android.mk file in frameworks/base/data/etc to include the files, but the additions aren't appearing in the compiled system. What's strange is that the default files that were in the same folder and already in the makefile appear, so the makefile seems to be read and parsed at compile.
This is the code I'm using:
Code:
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := [B]default_file_already_present.xml[/B]
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := [B]my_custom_file.xml[/B]
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
For some reason, my_custom_file is not added, while the default_file_already_present is. Any ideas?
I've searched around, but can't find any decent documentation. I feel like I’m very close, so any help is much appreciated!
tl;dr - Adding files to system partition with makefile partially fails.
Solution!
For those who also run in to this problem:
As per Jean-Baptiste Quéru's post on a google group;
The Android makefiles are essentially split into 2 primary categories,
parsed in this order.
-the product definitions, which specify what modules need to be
installed for each product.
-the module definition, which specify how to build each module.
The build system protects itself against situation where you modify
the product definition from a module definition. PRODUCT_COPY_FILES is
part of the product definition, and can't be modify from a module
definition.
JBQ
Click to expand...
Click to collapse
What this means is that in order to copy files as is to the system image, we need to use product definitions.
What I did was first run ./build/envsetup.sh, in order to get access to commands like mgrep, etc.
I noticed that in frameworks/base/data/keyboards there was a keyboards.mk file, which got included correctly.
I made a copy and modifies it to suit my needs:
Code:
# Copyright (C) 2010 The Android Open Source Project
#
blah blah blah...
#
# This is the list of custom permissions to be injected in /system/etc/permissions
permissionsfiles := \
android.hardware.camera.front.xml \
android.hardware.usb.accessory.xml \
android.hardware.usb.host.xml \
android.hardware.wifi.direct.xml \
android.hardware.wifi.xml \
android.software.sip.voip.xml \
com.google.android.maps.xml \
com.google.android.media.effects.xml \
com.google.widevine.software.drm.xml \
handheld_core_hardware.xml \
platform_plus.xml \
features.xml
PRODUCT_COPY_FILES := $(foreach file,$(permissionsfiles),\
frameworks/base/data/etc/$(file):system/etc/permissions/$(file))
I ran "mgrep keyboards" and noted which makefiles included the keyboards.mk file, then I opened each file and duplicated that line, modifying it to instead include my custom_permissions.mk located in frameworks/base/data/etc/.
I compiled and the files were all there.
Hope this helps.
Many people, even me, faced the following error during compilation of ROM sources:
make: *** No rule to make target `frameworks/native/data/etc/android.hardware.camera.xml', needed by `out/target/product/*/system/etc/permissions/android.hardware.camera.xml'. Stop.
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/samsung/*/cm.mk]]: "frameworks/native/build/phone-hdpi-512-dalvik-heap.mk" does not exist. Stop.
These are just two. But many errors are similar to this as the packages are different but pointer location reference is the same. Here's the following that you can do to stop the error.
change all references from frameworks/base to frameworks/native
cat `grep -r "frameworks/base" ./*` | sed 's/frameworks\/base/frameworks\/native/'
The above command really works but takes a longer time and it is not 100% guaranteed that it will link the files properly!
(or)
grep -r "frameworks" *
I never tested this!
If trying to convert native to base, go the device tree to cm.mk or where the error is pointed.
If that file doesn't have any location, search in the include files.
Example:
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/common_full_phone.mk)
# Inherit device configuration
$(call inherit-product, device/samsung/device/device.mk)
# Device identifier. This must come after all inclusions
PRODUCT_DEVICE := kdevice
PRODUCT_NAME := cm_device
PRODUCT_BRAND := samsung
PRODUCT_MODEL := device
PRODUCT_MANUFACTURER := samsung
PRODUCT_RELEASE_NAME := device
# Bootanimation
TARGET_SCREEN_HEIGHT := 800
TARGET_SCREEN_WIDTH := 480
The above cm.mk doesn't have any value but it includes two files.
Search in the included file which here is:
$(call inherit-product, vendor/cm/config/common_full_phone.mk)
$(call inherit-product, device/samsung/device/device.mk)
In one of the file, there must be pointer location. So search for it.
# Hardware features available on this device
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.camera.autofocus.xml:system/etc/permissions/android.hardware.camera.autofocus.xml \
frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \
frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \
frameworks/native/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \
frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml \
frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml \
frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml \
frameworks/native/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml
Change the above code which contains frameworks/native to frameworks/base by find and replace option in text editor.
This method is very easy and takes up no time to work.
Save the file and you are done.
I personally solved the error by this method!
Hope it helps you too!
I am working with AOSP. I downloaded the Gingerbread 2.3.7 code and compiled successfully. Now I added an apk in the system/apps/ folder. After running make it is compiled successfully and the installed-files.txt contain the name of apk I included. But once I run the emulator after replacing the system.img, user.img and ramdisk generated in the out folder, I am unable to see the app in emulator anywhere.
Makefile
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS)
# Module name should match apk name to be installed.
LOCAL_MODULE := ThemeChooser
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_TAGS := optional
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
include $(BUILD_PREBUILT
Hi,
I currently try building this one myself:
http://forum.xda-developers.com/android/development/rom-cyanogenmod-12-0-samsung-express-gt-t2949359
it's CM 12.1 for the Samsung Galaxy Express GT-I8730
After hours of building it breaks with a missing library.
Code:
frameworks/testing/runner/src/main/java/android/support/test/internal/runner/ClassPathScanner.java:19: error: package android.support.annotation does not exist
import android.support.annotation.VisibleForTesting;
build/core/java.mk:346: recipe for target '~/src/cm-12.1-main/out/target/common/obj/JAVA_LIBRARIES/android-support-test-src_intermediates/classes-full-debug.jar' failed
make: *** [~/src/cm-12.1-main/out/target/common/obj/JAVA_LIBRARIES/android-support-test-src_intermediates/classes-full-debug.jar] Error 41
package android.support.annotation is missing. It's available here
Code:
./frameworks/support/annotations/src/android/support/annotation
./prebuilts/sdk/current/support/annotations/android-support-annotations.jar
But it's not included in build.
This is the code in question, in build/core/java.mk:346
Code:
# Compile the java files to a .jar file.
# This intentionally depends on java_sources, not all_java_sources.
# Deps for generated source files must be handled separately,
# via deps on the target that generates the sources.
$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS)
$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES := $(LOCAL_JAR_EXCLUDE_FILES)
$(full_classes_compiled_jar): PRIVATE_JAR_PACKAGES := $(LOCAL_JAR_PACKAGES)
$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_PACKAGES := $(LOCAL_JAR_EXCLUDE_PACKAGES)
$(full_classes_compiled_jar): PRIVATE_RMTYPEDEFS := $(LOCAL_RMTYPEDEFS)
$(full_classes_compiled_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_compiled_jar): $(java_sources) $(java_resource_sources) $(full_java_lib_deps) \
$(jar_manifest_file) $(layers_file) $(RenderScript_file_stamp) \
$(proto_java_sources_file_stamp) $(LOCAL_ADDITIONAL_DEPENDENCIES)
$(transform-java-to-classes.jar)
How do I find out the content of the variables? How do I modify it?
Since I am building from a branch, it probably is a temporary problem. I issued a repo sync, but it dit not help (yet).
any idea?
thanks
JPT