Decreasing the size of google maps sdk for ios

房东的猫 提交于 2019-12-02 06:34:28

问题


i dowloaded google maps sdk (1.8.1) for ios,I'm using it in my app.But what i noticed is that size of the framework is about 55MB.Is there any way to decrease the size of framework. A file named "A" in directory structure "GoogleMaps.framework/Versions/A" is about 54MB.Is google maps depended on this file.please suggest some help.


回答1:


Keep GoogleMap framework outside of the project and just drag it in your project without copy file. It will reduce the file size. Only bundle file keep inside of your project.




回答2:


a framework is bound to be larger than the compiled in code thats ending up in your ipa.

  • the framework has the code for N architectures, the headers and the resources
  • what you will use in the end is the code for 1 architecture and the resources

As far as I can remember it adds about about 1mb to your ipa


they now ship bitcode as the iPad is compiled on apple's side for each customer.




回答3:


cd GoogleMaps.framework/Versions/Current
ls -lh GoogleMaps # 113 MB

If you don't support phones higher than the iPhone 5:

lipo -remove arm_v7 GoogleMaps -o GoogleMaps

If your development machine is a 64 bit machine:

lipo -remove i386 GoogleMaps -o GoogleMaps

And then:

ls -lh GoogleMaps # 75MB


来源:https://stackoverflow.com/questions/24197994/decreasing-the-size-of-google-maps-sdk-for-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!