Adding a prebuilt jar dependency to frameworks/base/location

1,664 views
Skip to first unread message

Eliot Stock

unread,
Aug 15, 2013, 10:49:09 AM8/15/13
to android-...@googlegroups.com
Hi. I've modified some sources in frameworks/base/location and they now depend on a new jar file. I've added that jar file as a prebuilt under prebuilts/misc/common/bike. The Android.mk for this jar looks like this:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := bike
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := bike.jar
#LOCAL_IS_HOST_MODULE := true
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX)

include $(BUILD_PREBUILT)

I can build that with make bike just fine and I see the jar under out/host/common/obj/JAVA_LIBRARIES/bike_intermediates/bike.jar and out/target/common/obj/JAVA_LIBRARIES/bike_intermediates/*.jar. Then, in frameworks/base/location/Android.mk, I've added the following:

LOCAL_STATIC_JAVA_LIBRARIES := bike

However, that jar is not on the classpath when a full build gets to building frameworks/base/location and I get "package does not exist", "cannot find symbol" errors as you'd expect.

How do I make sure my prebuilt is on the classpath for building frameworks/base/location?

Thanks,

Eliot.

Magnus Bäck

unread,
Aug 20, 2013, 11:49:38 AM8/20/13
to android-...@googlegroups.com
On Thursday, August 15, 2013 at 10:49 EDT,
Eliot Stock <1...@eliotstock.com> wrote:

> Hi. I've modified some sources in frameworks/base/location and they
> now depend on a new jar file. I've added that jar file as a prebuilt
> under prebuilts/misc/common/bike. The Android.mk for this jar looks
> like this:
>
> LOCAL_PATH := $(call my-dir)
> include $(CLEAR_VARS)
>
> LOCAL_MODULE := bike
> LOCAL_MODULE_TAGS := optional
> LOCAL_SRC_FILES := bike.jar
> #LOCAL_IS_HOST_MODULE := true
> LOCAL_MODULE_CLASS := JAVA_LIBRARIES
> LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX)
>
> include $(BUILD_PREBUILT)
>
> I can build that with make bike just fine and I see the jar under
> out/host/common/obj/JAVA_LIBRARIES/bike_intermediates/bike.jar and
> out/target/common/obj/JAVA_LIBRARIES/bike_intermediates/*.jar. Then,
> in frameworks/base/location/Android.mk, I've added the following:
>
> LOCAL_STATIC_JAVA_LIBRARIES := bike

Where, exactly, did you add this line? At least on the master
branch frameworks/base/location/Android.mk is just an inclusion
of subdirectories' Android.mk files. Assuming it's the
com.android.location.provider module you want to affect you need
to place the assignment between the inclusion of $(CLEAR_VARS)
and $(BUILD_JAVA_LIBRARY) in lib/Android.mk.

[...]

--
Magnus Bäck
ba...@google.com

Eliot Stock

unread,
Aug 23, 2013, 9:58:42 AM8/23/13
to android-...@googlegroups.com
Thanks, that was it! I also had to add my dependency to frameworks/base/Android.mk.

Eliot.
Reply all
Reply to author
Forward
0 new messages