作者:陈可1993_532 | 来源:互联网 | 2023-05-16 03:59
MyteamandIhaveinheritedalargeAndroidprojectfromanotherteam.Thewholeapplicationwitha
My team and I have inherited a large Android project from another team. The whole application with all the included libraries is reported to have around 35000 methods. We now have the task to implement a new service in the app where we need to use Protocol Buffers.
我的团队和我继承了另一个团队的大型Android项目。据报道,包含所有包含库的整个应用程序有大约35000种方法。我们现在的任务是在应用程序中实现我们需要使用Protocol Buffers的新服务。
The problem is that the generated .jar file with all the required .proto files creates another couple of 35000 methods, that's 70000 methods. And if you are not aware, the Android compiler has a limitation of 65536 methods per .dex file. We are clearly over that limit and we are getting the following error trying to compile the app:
问题是生成的.jar文件包含所有必需的.proto文件,会创建另外35000个方法,即70000个方法。如果您不知道,Android编译器每个.dex文件的限制为65536个方法。我们显然超过了这个限制,我们在尝试编译应用程序时遇到以下错误:
Unable to execute dex: method ID not in [0, 0xffff]: 65536
Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536
Yes, the application architecture should probably be restructured but that will take time. And for now we are trying to figure out a solution to work around this problem temporarily.
是的,应用程序架构可能应该进行重组,但这需要时间。目前我们正试图找出解决方案来暂时解决这个问题。
Any suggestions?
7 个解决方案