本文介绍了与React Native原始版本相比,iOS中的应用程序规模更大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经重新创建了一个简单的应用程序,该应用程序最初是由React Native制作的,文件大小为5MB.该应用程序没有图像或任何特定大小的任何东西,但它确实使用了Admob广告.

I've recreated a simple app that was originally made in React Native with 5MB file size on the app store. The app has no images or anything of any particular size, but it does use Admob ads.

将其上传到应用程序商店后,构建显示为35MB ...不确定原因是什么,但是在打开构建档案的包内容时,似乎在SwiftSupport/iphoneos中有一堆dylib文件创建的非常大.无论如何,那是档案中最大的文件夹.我认为这与为使用Admob而创建的Pods文件夹有关.

After uploading it to the app store the build is showing as 35MB...not sure what the reason is but it when opening the package contents of the build archive it seems that a bunch of dylib files in SwiftSupport/iphoneos are created that are very large. that's the biggest folder in the archive anyway. I think it has to do with the Pods folder created in order to use Admob.

我猜它永远不可能像React Native原始应用一样小,但是可以肯定它不应该是大小的 倍...有某种方法删除SwiftSupport文件还是其他缩小文件的方法?

I'm guessing it can never be as small as the React Native original app but surely it should not be seven times the size...is there some way to remove the SwiftSupport files or another way to shrink it?

同样,在Frameworks中构建归档文件中的Runner项目文件夹中,其中也包含大量Swift dylib文件.这些Swift支持dylib文件确实占据了所有空间...

Also in the Runner project folder in the build archive in Frameworks there are loads of Swift dylib files in there too that are large. Really all the space is being taken up by these Swift support dylib files...

只是为Android构建了该应用程序,它的容量为8.33MB,即使两个版本当然都使用Admob,也是如此.

Just built the app for Android and it's 8.33MB so quite a difference there, even though both versions of course use Admob.

推荐答案

这与Flutter无关.每个包含要支持iOS 11及更低版本的代码的iOS应用程序,都需要包含其他Flutter库.

This isn't really related to Flutter. Every iOS app containing code that wants to support iOS 11 and lower, needs to contain additional flutter libraries.

您可以通过将始终嵌入Swift标准库"设置为false,然后将部署目标提高到iOS 12,在Xcode中禁用此功能.

You can disable this in Xcode by setting "Always Embed Swift Standard Libraries" to false, and raising the deployment target to iOS 12.

这篇关于与React Native原始版本相比,iOS中的应用程序规模更大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 14:37