I am trying to add my app in Android_source/Development/apps/ folder. I confirmed that my code is compiled, as if i add syntax error compiler stopped there.
But the thing is that my app is not getting shown in apps menu. should i add my app package somewhere else too.
Android.Mk file content(i copied these contents from Bluetooth App in packages/apps/Bluetooth)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := \
$(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := Bluetooth_LE
LOCAL_CERTIFICATE := platform
#LOCAL_JNI_SHARED_LIBRARIES := libbluetooth_jni
LOCAL_JAVA_LIBRARIES := javax.obex
LOCAL_STATIC_JAVA_LIBRARIES := com.android.vcard
LOCAL_REQUIRED_MODULES := libbluetooth_jni bluetooth.default
LOCAL_PROGUARD_ENABLED := disabled
include $(BUILD_PACKAGE)
include $(call all-makefiles-under,$(LOCAL_PATH))
It seems that you've forgot to include your package into the build. Put the name of your module (Bluetooth_LE) into appropriate build file (for instance, into build/target/product/core.mk) into section PRODUCT_PACKAGES.
Related
I am building an AOSP version for the first time and trying to put my application as a system app. So i made this android.mk file but during during build process, it is giving out error - Package modules may not define LOCAL_MODULE_SUFFIX. Can please someone help me out.
Alternatives to this method are also welcome, i just need to install my application as system app so that it gets more permissions.
My android.mk file is :-
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := CallRecorder_static
LOCAL_SRC_FILES := $(call all-java-files-under, java)
LOCAL_RESOURCE_DIR = $(LOCAL_PATH)/res
include $(BUILD_STATIC_JAVA_LIBRARY)
LOCAL_MODULE_TAGS := optional
LOCAL_CERTIFICATE := platform
LOCAL_PACKAGE_NAME := CallRecorder
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_PRIVILEGED_MODULE := true
LOCAL_UNINSTALLABLE_MODULE := true
LOCAL_MODULE_PATH := $(TARGET_OUT_APPS)
LOCAL_STATIC_JAVA_LIBRARIES := libarity android-support-v4
include $(BUILD_PACKAGE)
include $(call all-makefiles-under,$(LOCAL_PATH))
I am trying to implement custom system app which has system privilege. I searched about it and I learned to make system app built in system image build result needs to be placed in system/app
First I put my custom app's java file, resource file, cpp file as in this below directory(packages/apps).
And I made Android.mk file like this below.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
$(info Ojt System Module)
#LOCAL_MODULE_CLASS := APPS
#LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_PACKAGE_NAME := OjtTestApp
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true
LOCAL_UNINSTALLABLE_MODULE := true
LOCAL_SRC_FILES := $(call all-java-files-under,src)
LOCAL_STATIC_ANDROID_LIBRARIES := \
android-support-v13 \
android-support-v4 \
android-support-compat \
android-support-v7-appcompat \
android-support-v7-gridlayout
LOCAL_JNI_SHARED_LIBRARIES := libojt
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_SDK_VERSION := current
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT_APPS)
include $(BUILD_PACKAGE)
#include $(BUILD_PREBUILT)
include $(call all-makefiles-under,$(LOCAL_PATH))
I also putted package name in aosp_sailfish.mk(device/google/marlin/aosp_sailfish.mk) file like this below.
PRODUCT_PACKAGE += OjtTestApp
After that I build my app by make OjtTestApp and build was completed without error. I tried to make apk file as in this post to system/app so that my custom app can built in system image but It keeps gave me following output(obj/APPS).
[100% 8/8] target Package: OjtTestApp (out/target/product/sailfish/obj/APPS/OjtTestApp_intermediates/package.apk)
Please help me I can't find error in my Android.mk file.
You don't need to go to that length. Build your apk normally don't sign it or sign it with system certificate. Now include the apk by writing a rule in as below in platform specific device.mk file
PRODUCT_PACKAGES += \
AppName
Sample mk file
LOCAL_PATH := $(call my-dir)
####################################
$(warning dont't include $(call my-dir)/Android.mk )
include $(CLEAR_VARS)
LOCAL_MODULE := <your app name>
LOCAL_MODULE_TAGS := optional
LOCAL_CERTIFICATE := PRESIGNED #If you have signed already using system key
LOCAL_PRIVILEGED_MODULE := true
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
#LOCAL_REQUIRED_MODULES := libnative-lib
include $(BUILD_PREBUILT)
For full privilege use
android:sharedUserId="android.uid.system" in Manifest
I am trying to add external JAR files (e.g., gson or eventbus) to my AOSP build. I tried it in two different ways:
Adding them to prebuilts/misc/common/mylibs/ and creating a Android.mk file for the dir. Then, I merely include the symbolic name of the lib in my app's Android.mk file.
Adding them in a subdir libs in my custom app source code and add it via the app's Android.mk file directly.
However, both approaches are yielding me similar errors, the following for the second method:
ninja: error: 'packages/apps/Car/MyApp/packages/apps/Car/Myapp/libs/gson-2.6.2.jar', needed by 'out/target/common/obj/JAVA_LIBRARIES/gson_intermediate/classes.jack', missing and no known rule to make it.
I noticed the weird repeating path in the error message. Does anybody have an idea what I am doing wrong?
Here is my Android.mk file for the second way:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_PACKAGE_NAME := MyApp
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_TAGS := optional
LOCAL_PRIVILEGED_MODULE := true
LOCAL_STATIC_JAVA_LIBRARIES += jsr305 gson
LOCAL_STATIC_ANDROID_LIBRARIES := android-support-v4
LOCAL_USE_AAPT2 := true
include packages/apps/Car/libs/car-stream-ui-lib/car-stream-ui-lib.mk
include packages/services/Car/car-support-lib/car-support.mk
include $(BUILD_PACKAGE)
include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := gson:$(LOCAL_PATH)/libs/gson-2.6.2.jar
include $(BUILD_MULTI_PREBUILT)
Removing $(LOCAL_PATH) from the path fixed it.
I want to build a rom from source and include my app as system app. What I've tried:
1.Copy my project into $SOURCE_DIR/packages/apps/
2.add Android.mk in root folder of my project:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_STATIC_JAVA_LIBRARIES := android-common
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := packagename
LOCAL_CERTIFICATE := platform
include $(BUILD_PACKAGE)
include $(call all-makefiles-under,$(LOCAL_PATH))
3.Configure building for maguro and:
make -j1 otapackage
But I don't see my app in output image's /system/app directory.
What am I missing?
I do not see in your mk file the following line:
LOCAL_MODULE_TAGS := optional
And I guess you have just forgotten to include your package into build/target/product/core.mk file under the section PRODUCT_PACKAGES
I'm compiling an Android ROM from source, and I have several apps that compile, but into data/app on the phone. They're uninstallable through the phone settings. I want them to be impossible to uninstall from the phone, and to compile into system/app instead of data/app.
Any advice?
edit:typo
Add:
LOCAL_MODULE_PATH := system/app
LOCAL_UNINSTALLABLE_MODULE := true
LOCAL_CERTIFICATE := platform
Here is an example of mk file that you can use. In my case the application is then build into system/app:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := package_name
LOCAL_CERTIFICATE := platform
include $(BUILD_PACKAGE)
# Use the folloing include to make our test app
include $(call all-makefiles-under,$(LOCAL_PATH))
With cm_10.2, I added my app into packages/apps and by default, mm built it into /data/app. I wanted it into system/app. It worked by adding this into Android.mk :
LOCAL_MODULE_PATH := $(TARGET_OUT_APPS)
But I'm not sure if it's a clean way to proceed since I almost found nobody doing that.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_UNINSTALLABLE_MODULE := true
LOCAL_MODULE_PATH := $(TARGET_OUT_APPS)
LOCAL_CERTIFICATE := platform
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := MyTestApp
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_PRIVILEGED_MODULE := true
LOCAL_STATIC_JAVA_LIBRARIES := libarity android-support-v4
include $(BUILD_PACKAGE)
include $(call all-makefiles-under,$(LOCAL_PATH))