Prebuilt .apk with library supposed to go into data/app-lib

1,753 views
Skip to first unread message

Dennis Meier

unread,
Mar 13, 2014, 6:43:32 AM3/13/14
to android-...@googlegroups.com
After long searching and figuring out how to add a prebuilt angrybirds .apk (for a prove of concept) to my Android build I have two questions:

  1. I figured out how to add the libraries form within the .apk to the system (see answer with 5 upvotes in this http://stackoverflow.com/questions/14687287/adding-prebuilt-apk-with-shared-libraries-to-aosp post). But the library doesn't get put into data/app-lib, where angrybirds searches for it. My .mk file:

    LOCAL_PATH := $(call my-dir)

    include $(CLEAR_VARS)

    LOCAL_MODULE := angrybirds_200

    LOCAL_REQUIRED_MODULES := libangrybirds

    LOCAL_CERTIFICATE := shared

    LOCAL_SRC_FILES := angrybirds_200.apk

    LOCAL_MODULE_CLASS := APPS

    LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)

    include $(BUILD_PREBUILT)


    include $(CLEAR_VARS)
    LOCAL_MODULE := libangrybirds
    LOCAL_SRC_FILES := libangrybirds.so # or wherever your so is
    LOCAL_MODULE_TAGS := optional
    LOCAL_MODULE_SUFFIX := .so
    LOCAL_MODULE_CLASS := SHARED_LIBRARIES
    include $(BUILD_PREBUILT)

    How can I make the build process put it there?

  2. Is there really no *serious* documentation of the Android build system? A reference for variables in the .mk files for example (LOCAL_MODULE_CLASS, etc.). It is really annoying to dig everything up in forums and question-sites.

Thank you and best regards,
Dennis

Magnus Bäck

unread,
Mar 27, 2014, 5:04:41 AM3/27/14
to android-...@googlegroups.com
On Thursday, March 13, 2014 at 11:43 CET,
Dennis Meier <den...@gmail.com> wrote:

> After long searching and figuring out how to add a prebuilt
> angrybirds .apk (for a prove of concept) to my Android build
> I have two questions:
> 1. I figured out how to add the libraries form within the .apk to
> the system (see answer with 5 upvotes in this
> [1]http://stackoverflow.com/questions/14687287/adding-prebuilt-apk-with-shared-libraries-to-aosp
> post). But the library doesn't get put into data/app-lib,
> where angrybirds searches for it.

Right, I suppose it goes into /system/lib right now.

> My .mk file:
> LOCAL_PATH := $(call my-dir)
> include $(CLEAR_VARS)
> LOCAL_MODULE := angrybirds_200
> LOCAL_REQUIRED_MODULES := libangrybirds
> LOCAL_CERTIFICATE := shared
> LOCAL_SRC_FILES := angrybirds_200.apk
> LOCAL_MODULE_CLASS := APPS
> LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
> include $(BUILD_PREBUILT)
> include $(CLEAR_VARS)
> LOCAL_MODULE := libangrybirds
> LOCAL_SRC_FILES := libangrybirds.so # or wherever your so is
> LOCAL_MODULE_TAGS := optional
> LOCAL_MODULE_SUFFIX := .so
> LOCAL_MODULE_CLASS := SHARED_LIBRARIES
> include $(BUILD_PREBUILT)
> How can I make the build process put it there?

You'll want to set LOCAL_MODULE_PATH for the library.

LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/app-lib

> 2. Is there really no *serious* documentation of the Android build
> system? A reference for variables in the .mk files for example
> (LOCAL_MODULE_CLASS, etc.). It is really annoying to dig
> everything up in forums and question-sites.

Yes, that would be nice to have. I usually head straight for the source
code.

--
Magnus Bäck | Software Engineer, Development Tools
magnu...@sonymobile.com | Sony Mobile Communications
Reply all
Reply to author
Forward
0 new messages