菜鸟教程小白 发表于 2022-12-13 10:42:07

ios - 在 xCode 6.4 中成功构建后,在 xCode 7 Beta 6 中构建项目时出错


                                            <p><p>在我升级我的 IDE 后,尽管没有更改任何其他内容,但仍输出以下错误:</p>

<pre><code>CompileAssetCatalog      /Users/suy/Library/Developer/Xcode/DerivedData/MyADT-enhkcdzrxjsfitcgsibsehlazpgg/Build/Products/Release-iphonesimulator/MyADT.app MyADT/Images.xcassets
cd /Users/suy/Desktop/self-service-mobile-ios
export   PATH=&#34;/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator. platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin&#34;
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /Users/suy/Library/Developer/Xcode/DerivedData/MyADT-enhkcdzrxjsfitcgsibsehlazpgg/Build/Intermediates/MyADT.build/Release-iphonesimulator/MyADT.build/assetcatalog_dependencies.txt --output-partial-info-plist /Users/suy/Library/Developer/Xcode/DerivedData/MyADT-enhkcdzrxjsfitcgsibsehlazpgg/Build/Intermediates/MyADT.build/Release-iphonesimulator/MyADT.build/assetcatalog_generated_info.plist --app-icon AppIcon --launch-image LaunchImage --platform iphonesimulator --minimum-deployment-target 7.1 --target-device iphone --target-device ipad --compress-pngs --compile /Users/suy/Library/Developer/Xcode/DerivedData/MyADT-enhkcdzrxjsfitcgsibsehlazpgg/Build/Products/Release-iphonesimulator/MyADT.app /Users/suy/Desktop/self-service-mobile-ios/MyADT/Images.xcassets

2015-09-09 11:28:44.991 IBCocoaTouchImageCatalogTool *** Terminating app due to uncaught exception &#39;IBAssertionFailure&#39;, reason: &#39;ASSERTION FAILURE:
Reason:   code which should be unreachable has been reached
File:       /SourceCache/IBAutolayoutFoundationIOS/IDEInterfaceBuilder-7706/Foundation/ImageCatalog/Compiler/IBICCoreThemeDocument.m:349
Method:   -&#39;
...
...
libc++abi.dylib: terminating with uncaught exception of type NSException
Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/actool failed with exit code 255
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您的问题确实是由于 xcode 7 中更改了 xcassets 的格式。但是,通过删除 block ,您将丢失图像拉伸(stretch)行为设置。 </p>

<p>相反,您可以通过将 <code>"cap-insets"</code> 更改为 <code>"capInsets"</code> 并将 <code>"mode": "tile"</code> 更改为 <code>“模式”:“填充”</code></p>

<p>这是您案例的结果字符串:</p>

<pre><code>{
&#34;images&#34;: [
    {
      &#34;idiom&#34;: &#34;universal&#34;,
      &#34;filename&#34;: &#34;login_show_button.png&#34;,
      &#34;scale&#34;: &#34;1x&#34;
    },
    {
      &#34;resizing&#34;: {
      &#34;mode&#34;: &#34;9-part&#34;,
      &#34;center&#34;: {
          &#34;mode&#34;: &#34;tile&#34;,
          &#34;width&#34;: 4,
          &#34;height&#34;: 3
      },
      &#34;cap-insets&#34;: {
          &#34;bottom&#34;: 5,
          &#34;top&#34;: 6,
          &#34;right&#34;: 7,
          &#34;left&#34;: 9
      }
      },
      &#34;idiom&#34;: &#34;universal&#34;,
      &#34;filename&#34;: &#34;[email protected]&#34;,
      &#34;scale&#34;: &#34;2x&#34;
    },
    {
      &#34;idiom&#34;: &#34;universal&#34;,
      &#34;scale&#34;: &#34;3x&#34;
    }
],
&#34;info&#34;: {
    &#34;version&#34;: 1,
    &#34;author&#34;: &#34;xcode&#34;
}
}
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 在 xCode 6.4 中成功构建后,在 xCode 7 Beta 6 中构建项目时出错,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/32486540/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/32486540/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 在 xCode 6.4 中成功构建后,在 xCode 7 Beta 6 中构建项目时出错