Perfect answer!!
For someone who's working with Android.bp files.
Use *make javac-check-MODULE_NAME *to generate the classes.jar.
And if you wanna use it in the Android.bp file, write a *java_import*
module.
Eg.
java_import {
name: "*random_jar_name*",
jars: ["libs/classes.jar"], *// You can rename classes.jar in case if
you're importing multiple jars in your Android.bp*
sdk_version: "current",
installable: false, *// This is not really needed,*
}
Now, use this *java_import* module's name inside *static_libs* list.
Eg.
static_libs: [
"androidx.core_core",
"*random_jar_name*",
],
That's it.
On Wednesday, January 25, 2017 at 10:28:12 PM UTC+5:30 Deepak Garg wrote:
> in Android M, you can achieve that by using LOCAL_JACK_ENABLED = disabled
> variable in your makefile.
>
> In Android N it is more tricky...it is broken and the solution to this is
> yet to come in AOSP mainline of Android N.
> Solution is available in master.
>
> Checked in 7.1.1 Android N.
>
> You need to make use of javac-check target. This has been implemented for
> this purpose.
>
> make javac-check-$(LOCAL_MODULE)
>
> So, if your module name is "ABCD"
>
> make javac-check-ABCD
>
> This generates a classes-full-debug.jar, in the
> common\obj\JAVA_LIBRARIES\ABCD_intermediates.
>
> This is the jar which you can use in your Studio environment.
>
> Most important, this solution is not yet visible in any of the tags on
> Android N branch. It is part of the master hence you need to add this
> solution to your branch manually.
>
>
> https://android.googlesource.com/platform/build/+/32bd0adf9c5dcd1560d77bdb886c7acc78496657
>
>
> On Thursday, April 21, 2016 at 8:18:03 AM UTC+5:30, KYUNG HO KIM wrote:
>
>> I'v found out that classes.jar has been made after build all android with
>> "make -j<number>".
>> Before android-m, I can make classes.jar with just "mm" on library folder.
>> Thanks.
>>
>> 2016년 4월 19일 화요일 오후 12시 46분 45초 UTC+9, KYUNG HO KIM 님의 말:
>>>
>>> Hi,
>>>
>>> I used the *classes.jar* in intermediate folder for developing some
>>> applications on eclipse that including below static or shared java library.
>>> (eg. test, test2 lib)
>>> The library used the android.mk, below.
>>> But after I using android-M source, there's no classes.jar file in
>>> intermediate folder.
>>>
>>> How can I build the classes.jar as before?
>>> Or how I can I build the jar file including class files when we build
>>> the static or shared java library on android build to use on eclipse or
>>> other java IDE??
>>>
>>>
>>>
>>> Android.mk
>>> LOCAL_PATH:= $(call my-dir)
>>>
>>>
>>> include $(CLEAR_VARS)
>>> LOCAL_MODULE := test
>>> LOCAL_MODULE_TAGS := optional
>>> LOCAL_SRC_FILES := $(call all-java-files-under, src)
>>> include $(BUILD_JAVA_LIBRARY)
>>>
>>> include $(call all-makefiles-under,$(LOCAL_PATH))
>>>
>>> LOCAL_PATH:= $(call my-dir)
>>>
>>>
>>> include $(CLEAR_VARS)
>>> LOCAL_MODULE := test2
>>> LOCAL_MODULE_TAGS := optional
>>> LOCAL_SRC_FILES := $(call all-java-files-under, src)
>>> include $(BUILD_STATIC_JAVA_LIBRARY)
>>>
>>> include $(call all-makefiles-under,$(LOCAL_PATH))
>>>
>>>
>>>
>>> Thanks,
>>> Casper
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
--
--
You received this message because you are subscribed to the "Android Building"
mailing list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-building/97c51e25-8f81-4823-91d6-5f8a1572a800n%40googlegroups.com.