在Eclipse上的Andr​​oid ICS版本建筑物接触code [英] Android ICS version building contacts code on eclipse

查看:127
本文介绍了在Eclipse上的Andr​​oid ICS版本建筑物接触code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立ICS接触code上蚀。由于接触使用一些隐藏的类,我创建了所有必需的类一个新的jar文件,并成功地构建APK。

I am trying to build ICS contacts code on eclipse. As contacts was using some hidden classes, I created a new jar file with all the required classes and was successful in building the apk.

但现在的问题是,任何我在罐子里添加的类别中缺少最后的APK包的链接和我得到的NoClassDefFoundError例外。

But now the problem is the classes whichever I added in the jar are missing links in the final apk package and I am getting noClassDefFoundError exception.

我反编译APK,发现类是在APK present。为什么链接丢失eventhough类文件在APK present?

I decompiled the apk and found that class was present in the apk. Why the link is missing eventhough class file is present in the apk?

我使用的jar文件作为外部库,但由于其规模的尝试(> 20MB)未成功。

I tried using the jar file as an external library but because of its size (>20mb) was not successful.

推荐答案

在联系人应用程序使用多种类型的隐藏文件。他们中的一些隐藏的框架项目,如AggregationSuggestions.PARAMETER_MATCH_NAME,以及其他属于像com.android.phone.CallLogAsync静态库。第一类型的文件不应该被嵌入到您的APK,但第二个应。

The Contacts app is using several types of hidden files. Some of them are hidden framework items, like AggregationSuggestions.PARAMETER_MATCH_NAME, and others belongs to the static libraries like com.android.phone.CallLogAsync. First kind of files should never be embedded into your APK, but the second should be.

如果你看看Android.mk的联系人可以计算出需要什么样的静态库:

If you look into Android.mk for the Contacts you can figure out what static libraries are needed:

LOCAL_STATIC_JAVA_LIBRARIES := \
com.android.phone.common \
com.android.vcard \
android-common \
guava \
android-support-v13 \
android-support-v4 \
android-ex-variablespeed \

要编译联系在Eclipse中你应该添加框架类用户库和所​​有的静态库作为外部JAR。

To compile Contact in eclipse you should add framework classes as "User library" and all static libraries as "External JAR".

要获得所有需要的jar文件最简单的方法是构建Android源,看看输出/目标/普通/ OBJ / JAVA_LIBRARIES。每个图书馆都有命名的目录下的 LIBNAME 的_intermediates与IT类,全debug.jar。这些罐子正是你需要建立联系人什么。框架类位于framework_intermediates,但是你可能需要添加更多的罐子。

The easiest way to obtain all needed jars is to build Android sources and look into out/target/common/obj/JAVA_LIBRARIES. Each library has its own directory named libname_intermediates with classes-full-debug.jar in it. These jars are exactly what you need to build Contacts. Framework classes reside in framework_intermediates, however you may need to add some more jars.

您应该调整订单&安培;导出在Eclipse中的项目,以确保您的用户库与框架类是​​上面的Android 4.0

You should adjust "Order & Export" for your project in Eclipse to make sure that your "User Library" with framework classes is above of "Android 4.0".

这篇关于在Eclipse上的Andr​​oid ICS版本建筑物接触code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆