LLDynamicLaunchScreen icon indicating copy to clipboard operation
LLDynamicLaunchScreen copied to clipboard

iPhone 12 iOS 16.3.1 执行一直不成功

Open wbzhan opened this issue 2 years ago • 4 comments

ll_getLaunchImagePath 方法返回一直为空 DEBUG发现 [NSFileManager.defaultManager fileExistsAtPath:path] 校验一直为false 路径打印出来为 "/var/mobile/Containers/Data/Application/xxx/Library/SplashBoard/Snapshots/xxx - {DEFAULT GROUP}", 对比Demo中打印路径也基本一致,但是就是校验false

wbzhan avatar Jun 29 '23 07:06 wbzhan

系统配置有多个target,对应多种语言

wbzhan avatar Jun 29 '23 08:06 wbzhan

可以提供一下示例demo吗?或者你新建一个项目;我在真机16.4.1上面测试并没有复现你的问题。

internetWei avatar Jun 29 '23 08:06 internetWei

我跑你的Demo没问题,在我自己的App上就不行 `+ (nullable NSString *)ll_getLaunchImagePath { static NSString *path = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ NSString *bundleIdentifier = NSBundle.mainBundle.bundleIdentifier;

    if (@available(iOS 13.0, *)) {
        NSString *libraryPath = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES).firstObject;
        path = [NSString pathWithComponents:@[libraryPath, @"SplashBoard", @"Snapshots", [NSString stringWithFormat:@"%@ - {DEFAULT GROUP}", bundleIdentifier]]];
    } else {
        NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
        path = [NSString pathWithComponents:@[cachePath, @"Snapshots", bundleIdentifier]];
    }
    NSLog(@"path = %@",path);
    path = [NSFileManager.defaultManager fileExistsAtPath:path] ? path : nil;
});

return path;

}`; 这个方法返回path为nil

wbzhan avatar Jun 29 '23 10:06 wbzhan

解决了,我代码早些时候添加了清理启动图的功能,一直没去掉,在debug的时候调用了 [NSFileManager.defaultManager removeItemAtPath:[NSString stringWithFormat:@"%@/Library/SplashBoard",NSHomeDirectory()] error:&clearLaunchrror], 所以导致后面再去查询系统的启动图为空;感谢

wbzhan avatar Jun 29 '23 12:06 wbzhan