IOS发布

作者: 啥啊_73ae | 来源:发表于2021-01-03 21:34 被阅读0次

一,生成工程


image.png

二,配置cocoapad
1,cd 进入到ios工程目录

pod init

执行初始化,会多出Podfile 文件


image.png

2,配置sdk到Podfile 内

#source 'https://git.xiaojukeji.com/ios/cocoapods-specs.git'
#source 'https://ruby.taobao.org/'
#source 'https://git.oschina.net/akuandev/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'

target 'puzzlescape2_2_0-desktop' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for puzzlescape2_2_0-desktop

end

target 'puzzlescape2_2_0-mobile' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for puzzlescape2_2_0-mobile
  # Pods for gameBox_new-mobile
  pod 'FairBidSDK', '~> 2.3.0'
  # pod 'Google-Mobile-Ads-SDK', '7.50.0'
#  pod 'AppLovinSDK'
#  pod 'FBAudienceNetwork', '5.5.1'
#  pod 'VungleSDK-iOS', '6.4.3'
 pod 'Firebase/Core', '~> 6.12.0'
# pod 'Firebase/Core'
# pod 'Firebase/Analytics'

end

source 'https://github.com/CocoaPods/Specs.git' 为配置的pad的源,如果加载比较慢需要翻墙,并添加github本地翻墙的代理。

3,安装install命令

pod install
或者
pod install --verbose --no-repo-update

安装后


image.png

会多出以上三个文件

4,运行pod生成的.xcworkspace 工程文件
5,运行报错--“The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.”
解决办法
选中Project->选择Info tab->看看Configurations是不是被设置为 None了,如果是None的话请改为Pods,如图:


image.png

要选择pods 方式。

三,添加广告sdk等

1,添加ObjC 选项,target >> Build Settings >> Other Linker Flags. Once there, click add new (+), and enter -ObjC.

image.png

2,Link Libraries

libsqlite3.tbd
libxml2.tbd


image.png

2,添加google 统计配置

image.png

3,icon配置

image.png

4,名称多语言

https://www.jianshu.com/p/3afd030be497

5, @import 报错问题

出现如下报错信息

image.png
修改方法
将target中的build setting 设置为enable modules 为YES
image.png
即可解决

相关文章

网友评论

      本文标题:IOS发布

      本文链接:https://www.haomeiwen.com/subject/erfinctx.html