事件背景:
苹果废弃uiwebview,强制wkwebview
transporter提示上传成功,无报错,苹果后台看不到包
但是邮件提示如下
1.png
问题原因:
1、工程包含uiwebview
2、用到的第三方SDK有uiwebview
解决方法:
1、如果是工程删除uiwebview,或者用wkwebview替换
2、怎么检测第三方SDK有uiwebview:
grep -r UIWebView xcode工程文件夹
3、如果第三方SDK没更新的话怎么办:以libiPhone-lib.a去掉WebView为例
以下命令只针对arm64架构
将以下代码保存至URLUtility.mm文件
#include <iostream>
#import <UIKit/UIKit.h>
using namespace std;
namespace core {
template <class type>
class StringStorageDefault {};
template <class type,class type2>
class basic_string {
public:
char * str;
basic_string( char* arg){
str = arg;
}
};
}
void OpenURLInGame(core::basic_string< char,core::StringStorageDefault<char> > const&arg){}
void OpenURL(core::basic_string<char,core::StringStorageDefault<char> >const &arg){
const void *arg2 = arg.str;
UIApplication *app = [UIApplication sharedApplication];
NSString *urlStr = [NSString stringWithUTF8String:(char *)arg2];
NSURL *url = [NSURL URLWithString:urlStr];
[app openURL:url];
}
void OpenURL(std::string const&arg){
UIApplication *app = [UIApplication sharedApplication];
NSString *urlStr = [NSString stringWithUTF8String:arg.c_str()];
NSURL *url = [NSURL URLWithString:urlStr];
[app openURL:url];
}
编译成新的目标文件:URLUtility.o
clang -c URLUtility.mm -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
去掉原来的目标文件:URLUtility.o
ar -d libiPhone-lib.a URLUtility.o
将新的URLUtility.o增加进静态库末端
ar -q libiPhone-lib.a URLUtility.o
网友评论