iOS之解决上传IPA时报错(Invalid Bundle. xx.framework contains disallowed file ‘Frameworks’ or disallowed nested bundles)的问题

起因:

由于Xcode的一些原因(缓存等)导致MOJiAccount项目编译失败,所以我重新在MOJiAccount框架中添加MOJiBase.xcframework依赖框架,然后才编译运行成功。但是在Embed这一块中,发现如下图所示的情况:

添加框架时,会默认Embed & Sign

正是因为这个原因,使得主项目在使用新的MOJiAccount.xcframework,并Archive后,会出现如下图所示的情况:

MOJiAccount框架在打包后出现子框架

然后在此基础上,上传IPA时,报错误如下图所示:

解决方案:

在Embed项中,把MOJiBase.xcframework切换成Do not Embed即可,如图所示:

同时,项目在Archive后,MOJiAccount框架不再显示子框架,如图所示:

最后,上传IPA成功。


总结:

1.MOJi框架如果引用其他MOJi框架(在主项目中已经使用的框架并且Embed & Sign)时,不需要再Embed & Sign,因为不支持框架嵌套,也不支持框架重复Embed & Sign。


2.每次打包框架后,都需要检查Embed属性是否为Do not Embed

Migrate ubuntu to another disk

  1. connect new disk {diskB}
  2. use `fdisk -l` to find current disks info
  3. format {diskB} with `GPT` partition format.
  4. partition {diskB} to have exact partitions as old disk: 
    • / (the root) fileSystem: ex4
    • /boot (for booting files including `grub`) fileSystem: ex2, flags: boot, esp
    • fileSystem: unformatted, mount point: none, flags: bios_grub
  5. mount /boot of {diskB} to point /mnt and install grub
    • > $ sudo grub-install –target=i386-pc –root-directory=/mnt –recheck –debug /dev/sdb
    • mv /mnt/boot/* /mnt/
  6. use `mount {source path} {dest. path, like /mnt}` to mount new partitions and copy all files from the corresponding folders from old disk: cp -rf -a {source path} {dest. path}
    • /bin 系统可执行文件
    • /etc 系统核心配置文件
    • /opt 用户程序文件
    • /root root用户主目录
    • /sbin 系统可执行文件
    • /usr 程序安装目录
    • /var 系统运行目录
    • /boot
  7. create essential empty directories in {diskB}
    • /dev 主要存放与设备(包括外设)有关的文件
    • /proc 正在运行的内核信息映射
    • /sys 硬件设备的驱动程序信息
  8. modify etc/fstab file to mount new /, /boot/ in {diskB} and old disk
    • use `blkid` to check current partitions uuid
    • change fstab:
      • UUID={diskB’s `/` partition uuid}             /           ext4    errors=remount-ro     0       1
      • UUID={diskB’s `/boot` partition uuid}     /boot    ext4    defaults                      0       2
  9. update-grub (if still not work, try to grub-install /dev/{diskB}
  10. reboot!

grub rescue mode if grub directory is not found at booting:

use `ls (hd0,1~9)/{any files like ./grub ./lost+found}` to check what your boot index is.

grub rescue>root=(hd0,{diskB’s boot partition index, `2` for example.})

grub rescue>prefix=/boot/grub

grub rescue>set root=(hd0,2)

grub rescue>set prefix=(hd0,2)/boot/grub

grub rescue>insmod normal

grub rescue>normal // auto enter `normal` mode

// normal mode /////////

grub>linux /vmlinuz-xxx-xxx root=/dev/{diskB} ro

grub>initrd /initrd.img-xxx-xxx

grub>boot