bugfix #229: ERROR ITMS-90087: "Unsupported Architectures. The executable contains unsupported architectures [i386]
27 Oct 2017 | fixHistory RoboVM doesn’t strips all simulator archs from dynamic framework which causes ITMS-90087 during submission #228
Fix PR229
This kind of problem always was bothering me but I was under impression that stripping is not part of RoboVM and did this all time manually before submit. But it is there but broken due epic bug:
here the code of org.robovm.compiler.target.AbstractTarget:copyDynamicFrameworks
if (isDynamicLibrary(file)) {
// remove simulator archs for device builds
if (config.getOs() == OS.ios && config.getArch().isArm()) {
...
if(archs.contains(Arch.x86.getClangName())) {
ToolchainUtil.lipoRemoveArchs(config, inFile, tmpFile, Arch.x86);
}
if(archs.contains(Arch.x86_64.getClangName())) {
ToolchainUtil.lipoRemoveArchs(config, inFile, tmpFile, Arch.x86_64);
}
...
So:
- if arch contains x86 remove it and save to tmpFile
- then if it contains x86_64 do the same. But take not result of step1 but initial file where x86 still present. Done )
Fix in PR229
// remove simulator archs for device builds
if (config.getOs() == OS.ios && config.getArch().isArm()) {
String archs = ToolchainUtil.lipoInfo(config, file);
List<Arch> archesToRemove = new ArrayList<>();
if(archs.contains(Arch.x86.getClangName())) {
archesToRemove.add(Arch.x86);
}
if(archs.contains(Arch.x86_64.getClangName())) {
archesToRemove.add(Arch.x86_64);
}
if (!archesToRemove.isEmpty()) {
File inFile = new File(destDir, file.getName());
File tmpFile = new File(destDir, file.getName() + ".tmp");
ToolchainUtil.lipoRemoveArchs(config, inFile, tmpFile, archesToRemove.toArray(new Arch[archesToRemove.size()]));
FileUtils.copyFile(tmpFile, inFile);
tmpFile.delete();
}
}
beside fixing the bug is optimize:
- no copy of binary at all if there is no need to strip
- get list of arch to strip and do it in one run
Comments