zoukankan      html  css  js  c++  java
  • Xcode快速排错

     

    Xcode快速排错

    分类: ios技术 847人阅读 评论(0) 收藏 举报

    1,模拟器运行完全没问题,真机运行失败。

    有时候我们在模拟器上运行程序时,不会发现任何问题,但当我们放到真机上测试时,就会发生错误,此时是什么原因呢?以我的发现可能是下面的原因,

    1,因为真机测试的时候,是识别大小写的,所以首先检查你程序中的资源(图片,音乐……)的扩展名是小写的,然而在代码中你写成了大写,比如有一张图片,在程序中是test.png,然而你在代码中却写成了test.PNG。如果你改正确了,那么恭喜你。如果还是不行,确定不是这方面原因了,那么……

    2,未完待续……

    2,Code Sign error:Provisioning profile '**^ (更新证书错误)

    在Xcode中当你在更新了你得证书而再重新编译你的程序,真机调试一直会出现 Code Sign error: Provisioning profile ‘XXXX’ can't be found是不是会另你很恼火。下面说说解决方法,让你很好的解决这个问题。
                    1.关闭你的项目,找到项目文件XXXX.xcodeproj,在文件上点击右键,选择“显示包内容”(Show Package Contents)。会新打开一个Finder。注:其实XXXX.xcodeproj就是一个文件夹,这里新打开的一个Finder里面的三个文件就是该XXXX.xcodeproj文件夹里面的文件。
                     2.在新打开的Finder中找到project.pbxproj,并且打开。在这之中找到你之前的证书的编码信息。我之前报的错误信息是
    Code Sign error: Provisioning profile '37D44E7F-0339-4277-9A82-C146A944CD46',所以我用查找的方式找到了所有包括37D44E7F-0339-4277-9A82-C146A944CD46的行,并且删除。
                     3.保存,重新启动你的项目,再编译。就OK了

    3,/Developer/xcode-crack/gen_entitlements.py: No such file or directory

    有时候,我们会遇到这种错误,如下

    /Users/UserName/Library/Developer/Xcode/DerivedData/xxx-beqfpakeslcfgjghvltweyjadfjk/Build/Intermediates/xxx.build/Debug-iphoneos/xxx.build/Script-B354780B144C8CA2002C6922.sh: line 4: /Developer/xcode-crack/gen_entitlements.py: No such file or directory

    很是郁闷,那如何解决呢?

    解决方法:Targets->Build Phases中删除Run Script
    运行 问题解决

    4,Myapp.temp-caseinsensitive-rename

    有时候我们会碰见这种错误,什么错误呢,当我们给一个工程从新命名后,发现工程名变成了 Myapp.temp-caseinsensitive-rename.这时候怎么办呢?莫慌,我已经从网上找到了方法: 如下:

    Check the product name in build settings and make sure everywhere it is Myapp. If that is done, close your project -> go to finder -> right click on your .xcodeproject file and click on show package contents -> then right click on your project.pbxproj and open it in some text editor. The search for Myapp-temp-caseinsensitive-rename and manually rename it. Save it after changing and then reopen the project. Make sure you have taken a back up of your project before doing this.

    是英文的 ,比较好理解,我就不翻译了。

    5,

    ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in _mcdc from /Users/ispiano/Documents/codeSourse/ffmpeg/lib/libavcodec.a(4xm.o). To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

    这种警告解决的办法:targets-->build Settings-->Linking-->Don't create Position Independent Executables 设置为YES.警告自然消除。


    6,Xcode 工程文件打开不出来, cannot be opened because the project file cannot be parsed.

    svn更新代码后,打开xcode工程文件,会出现  xxx..xcodeproj  cannot be opened because the project file cannot be parsed.

    因为.xcodeproj工程文件冲突了,然后还是会强制更新,内部文件出现了冲突,所以解析不了文件。

    会出现这样的冲突消息

    [cpp] view plaincopy
     
    1. <<<<<<< .mine  
    2.     9ADAAC6A15DCEF6A0019ACA8 .... in Resources */,  
    3. =======  
    4.     52FD7F3D15DCEAEF009E9322 ... in Resources */,  
    5. >>>>>>> .r269  

    解决方法:1.对.xcodeproj 文件右键,显示包内容

        2.双击打开 project.pbxproj 文件

        3.找到以上类似的冲突信息(可以用commad + f 搜索)

        4.删除 <<<<<<<,======,>>>>>>这些行

        5.保存,退出

        6.重新打开.xcodeproj文件即可

    7,Could not change executable permissions on the application

    这个错误是因为 证书我们用了两次。就是说在真机上已经有了一个用了此证书的项目存在,只要把之前的项目从真机上删掉,这个项目就可以使用了。
    这提示我们,在真机测试的时候两个app的bundleid千万不能一样 ,否则就报这个错误了 
  • 相关阅读:
    反反爬 | 如何巧过 CloudFlare 5秒盾?
    Xpath高级用法
    GZIP 头解析
    学习S5
    Chrome 建立SOCKS5代理
    建立IP6隧道
    linux 配置Socks51
    linux 配置Socks5
    最近买了一个域名 哈哈,棒棒哒~~
    jquery 动态添加下拉框 需要增加 煊染 selectmenu("refresh");
  • 原文地址:https://www.cnblogs.com/chenhaosuibi/p/3464857.html
Copyright © 2011-2022 走看看