编译罐,并将其添加到Android项目 [英] compiling Jars and add them to android project

查看:147
本文介绍了编译罐,并将其添加到Android项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

确定这里的东西,我把天进去,搜索所有数据的基础上,所以它要么我没有寻找合适的话或者有没有为它的答案,希望还没有。

Ok here is the thing, i put days into it, searching all the data base, so it's either i didn't search for the right words or there is no answer for it, hopefully "yet".

症状: -compiling的Andr​​oid项目DX编译每次项目建成所有的罐子 - 没有理由这样做一次应该是足够的,它的任何怎么做的每一次,每次构建可以利用,而不是把它需要几秒钟长的时间分钟。

Symptoms: -compiling the Android project DX compile all the jars every time the project is built - there is no reason to do it one time should be enough, any how it does it every time, every build can take long time instead of taking seconds it takes minutes.

真正的问题:

-Adding几罐造成日食崩溃 - 现在,这是使用这些设置(重罐子)  -Xms256m  -Xmx1024m  -XX:+ UseParallelGC  -XX:PermSize = 256M  -XX:MaxPermSize = 512M

-Adding several Jars cause to eclipse to crash -- now this is with these settings(heavy jars) -Xms256m -Xmx1024m -XX:+UseParallelGC -XX:PermSize=256M -XX:MaxPermSize=512M

(这实际上提供更好的性能,所以如果你的Eclipse编译慢,你可以添加-XX:+ UseParallelGC这将有助于)(我不能将它设置任何比这highr,Java堆大小到达750米当Eclipse崩溃,GC而DX编译罐子是不行的,它会尝试的,但CPU忙不让它,所以在当时,它得到第四十五罐这是3MB每次都有类似600MB堆,这就是为什么我用gcoverheadlimit)

(Which actually give better performance so if your eclipse compile slow you can add -XX:+UseParallelGC it will help)(I couldn't set it any highr than this, java heap size get to 750m when eclipse crash, gc doesn't work while DX compiling a jar, it tries between but the CPU is busy which doesn't let it, so at the time that it get to the forth-fifth jars which are 3MB each it has something like 600MB on the heap, this is why i used gcoverheadlimit)

编译每一个或几个人一起将其编译好(同样采用Android项目中),问题是,我无法找到一个方法来分别编译它们(然后我就需要安装在客户端设备上的apk)当我编译在一起Eclipse的崩溃。

Compiling each one or several of them together will compile it well(within the same android project), the problem is that i cannot find a way to compile them separately(then i will need to apks installed on the client device), and when i compile them together Eclipse crash.

我试图通过一个编译它们之一,使用CMD和DX,虽然它的建成,当我在Eclispe的建设项目来重建它,所以它就像我什么也没做,试图convet罐子到DEX文件太多,没'T的帮助。

I tried to compile them one by one, using cmd and DX, although it's built, when i build the project in eclispe it rebuild it, so it's like i did nothing, tried to convet the jars to DEX files too, didn't help.

我就红到Java堆大小许多职位,这不是我的情况下,我甚至使用gcoverheadlimit,太多的罐子导致崩溃,如果有人有一个想法/解决方案,我会向他致敬/她......

I red many posts regarding to java heap size, this is not my case i even used gcoverheadlimit, too many jars cause it to crash, if someone has an idea/solution i will salute him/her ...

要总结这一切: 我想Java正罐子转换成Dalvik的格式,然后作为一种资源添加到Android项目,所以当项目符合它不需要罐子转换成Dalvik的格式,因为它已经完成。

To summarize it all : I want to convert java regular jars to Dalvik format, then add it as a resource to an android project, so when the project is complied it won't need to convert the jars to Dalvik format because it's already done.

推荐答案

确定经过长期的研究,我认为,我知道是什么问题,但我不知道如何解决办法呢。

Ok after a long research, i think that i know what is the problem, however i don't know how to workaround it yet.

症状:编译大罐子和或几罐,造成偏食崩溃,当它不崩溃的错误消息:麻烦写输出:OP code == null,则转换为Dalvik的格式失败,错误2。

Symptoms : compiling large jar and or several jars, cause to eclipse to crash, when it doesn't crash error message : trouble writing output: opcode == null , Conversion to Dalvik format failed with error 2 .

原因:DX是无法处理多于它可以包含在16位的字符串,因此,就没有办法,包括(至少在平均时间)超过这个字符串的长度

Cause : DX is unable to process more than it can contain in a string of 16bit, thus, there is no way to include(at least not in the mean time) more than the length of this string.

结果:无法为Android复杂的应用程序编程为一个APK

Result : unable to program complicated apps for Android as one APK.

建议为Android开发者(我不太知道你如何构建它,但):您可以使用ArrayList中的这些字符串,而他们每个人自己写依次classes.dex文件,然后,就没有极限写作code一个APK,和/或添加尽可能多的罐子作为开发需求,这是一个假设,使得它不会是容易的,但不能太复杂,太,definitly不是那些谁做的Andr​​oid,同意?

Advice for android developers (i don't quite sure how you built it but): you can use arraylist for these strings, which each one of them writes itself in turn to classes.dex file, then, there will be no limit for writing code for one APK, and/or adding as many jars as the developer needs, this is an assumption, making it won't be easy but not too complicated too, definitly not to the ones who made Android, Agree ?

解决方法:抱歉,但我没有一个解决方法还没有,我花了一些时间来弄清楚这个问题,因为日食应声而我没有得到的OP code == NULL的错误信息所以我认为这是一个Eclipse的问题,我会很高兴拿到第二个和第三个观点就这一个。

Workaround : sorry but i don't have a workaround yet, it took me some time to figure this problem, because the eclipse crashed and i didn't get the "opcode == null", error message so i thought that this is an eclipse issue, I will be glad to get second and third opinion on this one.

这篇关于编译罐,并将其添加到Android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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