Reference to 'X' is ambiguous

后端 未结 8 1472
伪装坚强ぢ
伪装坚强ぢ 2020-12-05 23:29

After several changes to my project I suddenly get this build error:

Reference to \'kCGImageAlphaPremultipliedLast\' is ambiguous

<
相关标签:
8条回答
  • 2020-12-06 00:05

    I have got this problem when I have imported a header file twice. After one of them is removed, the problem disappears.

    0 讨论(0)
  • 2020-12-06 00:10

    Ok after creating a new Project and coping everything to this project the build was successful however i got this "Malformed or corrupted AST file" error several times again but it can be solved by:

    • Clean the project
    • Deleting everything inside '~/Library/Developer/Xcode/DerivedData/ModuleCache/' (the button inside the organizer window did not work for me)
    • Clean once more
    • Build project

    after that it works just fine except that i have to do this fix from time to time

    i also did a diff to the old project and it seems a lot of frameworks and other old stuff got stuck in there from testing things so in case you have this check your project settings file for old stuff.

    i thought that xcode and me can be friends one day. guess not...

    0 讨论(0)
  • 2020-12-06 00:16

    Remove use_frameworks! from pod file fix my ambiguous problem.

    0 讨论(0)
  • 2020-12-06 00:24

    I just had the same warnings littering up my build report (but only under the triangle). In the end what worked for me was to insure that EVERY usage of:

    #import <Module/Module.h> 
    

    in the app was replaced by:

    @import Module;
    

    Now all those annoying warnings are gone!

    0 讨论(0)
  • 2020-12-06 00:25

    Well some solutions here are nice but use_frameworks! is exactly what I need now even thou it made this problem happening. But it looks like build does not like when I use frameworks and header is referenced twice like this

    #import "TSMessage.h"
    #import "TSMessage+CSExtension.h"
    

    but problem gets away when it compiles like this

    #import "TSMessage+CSExtension.h"
    
    0 讨论(0)
  • 2020-12-06 00:29

    This's maybe you import like this:

    #import "xxxx.h"

    I fix it through this:

    #import < xxxx/xxxx.h>

    0 讨论(0)
提交回复
热议问题