1***@qq.com
1***@qq.com
  • 发布:2020-03-06 11:40
  • 更新:2020-09-08 14:55
  • 阅读:1998

【报Bug】uniapp项目 iOS离线打包一启动就崩溃

分类:5+ SDK

详细问题描述

在appDelegate里面的didFinishLaunchingWithOptions方法,程序一启动,执行到 BOOL ret = [PDRCore initEngineWihtOptions:launchOptions withRunMode:PDRCoreRunModeAppClient withDelegate:self];这个方法就崩溃,调试后发现系统的launchOptions这个参数为空,现在整个项目都跑不起来了,报错信息:

2020-03-06 11:25:29.362711+0800 GuanTongUniPlugin[827:299899] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
2020-03-06 11:29:28.955172+0800 GuanTongUniPlugin[827:299899] ######===>>>>New Device Model:[iPhone7,2]
2020-03-06 11:29:28.982210+0800 GuanTongUniPlugin[827:299899] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString appendString:]: nil argument'
First throw call stack:
(0x181602d8c 0x1807bc5ec 0x181602c6c 0x181599590 0x10194859c 0x101b25498 0x101b25420 0x101973644 0x101972bf0 0x100f61d08 0x18b1d2e38 0x18b1d2240 0x18b19f65c 0x18b7cfa0c 0x18b19ee4c 0x18b19ece8 0x18b19db78 0x18be3372c 0x18b19d268 0x18bc189b8 0x18bd66ae8 0x18b19cc88 0x18b19c624 0x18b19965c 0x18b1993ac 0x183e00470 0x183e08d6c 0x1040e9220 0x1040f5850 0x183e34878 0x183e3451c 0x183e34ab8 0x1815ab404 0x1815aac2c 0x1815a879c 0x1814c8da8 0x1834ab020 0x18b4a978c 0x100f63484 0x180f59fc0)
libc++abi.dylib: terminating with uncaught exception of type NSException

重现步骤

[步骤] 按照离线打包的示例程序改好代码后,点击xcode启动程序,马上就崩溃了

[结果]启动就闪退

[期望] 正常启动

IDE运行环境说明

HBuilderX : 2.6.1.20200226
Xcode:11.3.1
mac版本号:10.15

uni-app运行环境说明

运行端是uniapp

[项目是HBuilderX创建的]

[编译模式是自定义组件模式]

App运行环境说明

[Android版本号]

[iOS版本号] iOS11.3

[手机型号] iphone6s、iPhoneXR

附件

[IDE问题请提供HBuilderX运行日志。菜单帮助-查看运行日志,点右键打开文件所在目录,将log文件压缩成zip包上传]

[App问题请提供可重现问题的代码片段,你补充的细一点,问题就解决的快一点]

2020-03-06 11:25:29.232525+0800 GuanTongUniPlugin[827:300025] [DYMTLInitPlatform] platform initialization successful
2020-03-06 11:25:29.362591+0800 GuanTongUniPlugin[827:299899] [Application] Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?
2020-03-06 11:25:29.362711+0800 GuanTongUniPlugin[827:299899] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
2020-03-06 11:29:28.955172+0800 GuanTongUniPlugin[827:299899] ######===>>>>New Device Model:[iPhone7,2]
2020-03-06 11:29:28.982210+0800 GuanTongUniPlugin[827:299899] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString appendString:]: nil argument'
First throw call stack:
(0x181602d8c 0x1807bc5ec 0x181602c6c 0x181599590 0x10194859c 0x101b25498 0x101b25420 0x101973644 0x101972bf0 0x100f61d08 0x18b1d2e38 0x18b1d2240 0x18b19f65c 0x18b7cfa0c 0x18b19ee4c 0x18b19ece8 0x18b19db78 0x18be3372c 0x18b19d268 0x18bc189b8 0x18bd66ae8 0x18b19cc88 0x18b19c624 0x18b19965c 0x18b1993ac 0x183e00470 0x183e08d6c 0x1040e9220 0x1040f5850 0x183e34878 0x183e3451c 0x183e34ab8 0x1815ab404 0x1815aac2c 0x1815a879c 0x1814c8da8 0x1834ab020 0x18b4a978c 0x100f63484 0x180f59fc0)
libc++abi.dylib: terminating with uncaught exception of type NSException

[App安装包或H5地址]

[可重现代码片段]

  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {

    //launchOptions这个参数为空,导致闪退
    BOOL ret = [PDRCore initEngineWihtOptions:launchOptions
    withRunMode:PDRCoreRunModeAppClient withDelegate:self];
    UIViewController* adViewController = nil;

    if defined(ENABLEAD)

    DCADManager *adManager = [DCADManager adManager];  
    adManager.delegate = self;  
    adViewController = [adManager getADViewController];  

    endif

    UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];  
    self.window = window;  
    
    ViewController *viewController = [[ViewController alloc] init];  
    self.h5ViewContoller = viewController;  
    
    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];  
    self.rootViewController = navigationController;  
    navigationController.navigationBarHidden = YES;  
    if ( adViewController ) {  
        [navigationController pushViewController:adViewController animated:NO];  
    } else {  
        [self startMainApp];  
        self.h5ViewContoller.showLoadingView = YES;  
    }  
    self.window.rootViewController = navigationController;  
    [self.window makeKeyAndVisible];  
    return ret;  

    }

联系方式

[QQ]1437765139

2020-03-06 11:40 负责人:无 分享
已邀请:
i***@qq.com

i***@qq.com

同样遇到啦,UIScreen.mainScreen().plusGetAttribute('bounds'),这里会挂~ 获取不到 bounds

小E

小E

but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.

看描述,需要添加app后台运行字段

该问题目前已经被锁定, 无法添加新回复