Saranshmalik / react-native-zendesk

React native wrapper for Zendesk SDK
MIT License
29 stars 42 forks source link

Not able to build project on IOS #10

Closed ashwaniKhuranaa closed 3 years ago

ashwaniKhuranaa commented 3 years ago

Hello

When I installed and tried to build project in iOS it gives me error - Could not build project "ChatSDK"

a396901990 commented 3 years ago

same as me

yatish3230 commented 3 years ago

I am getting same error. i don't know what is the issue?

Saranshmalik commented 3 years ago

Can you add more details to it. What RN version you guys using? I use this library on a production app and never had any issues so far, so some more details here would be helpful

yungkittty commented 3 years ago

Hello @Saranshmalik, I'm getting these errors when i'm trying to build the ios app :

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:18:3: use of undeclared identifier 'ZDKChatAPIConfiguration'

  ZDKChatAPIConfiguration *config = [[ZDKChatAPIConfiguration alloc] init];
                                                                                                                                        ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:18:28: use of undeclared identifier 'config'

  ZDKChatAPIConfiguration *config = [[ZDKChatAPIConfiguration alloc] init];
  ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:18:39: use of undeclared identifier 'ZDKChatAPIConfiguration'

  ZDKChatAPIConfiguration *config = [[ZDKChatAPIConfiguration alloc] init];
                           ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:20:5: use of undeclared identifier 'config'

    config.department = options[@"department"];
                                      ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:23:5: use of undeclared identifier 'config'

    config.tags = options[@"tags"];
    ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:25:3: use of undeclared identifier 'config'

  config.visitorInfo = [[ZDKVisitorInfo alloc] initWithName:options[@"name"]
    ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:25:26: use of undeclared identifier 'ZDKVisitorInfo'

  config.visitorInfo = [[ZDKVisitorInfo alloc] initWithName:options[@"name"]
  ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:28:3: use of undeclared identifier 'ZDKChat'

  ZDKChat.instance.configuration = config;
                         ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:28:36: use of undeclared identifier 'config'

  ZDKChat.instance.configuration = config;
  ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:30:91: use of undeclared identifier 'config'

  NSLog(@"Setting visitor info: department: %@ tags: %@, email: %@, name: %@, phone: %@", config.department, config.tags, config.visitorInfo.email, config.visitorInfo.name, config.visitorInfo.phoneNumber);
                                   ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:30:110: use of undeclared identifier 'config'

  NSLog(@"Setting visitor info: department: %@ tags: %@, email: %@, name: %@, phone: %@", config.department, config.tags, config.visitorInfo.email, config.visitorInfo.name, config.visitorInfo.phoneNumber);
                                                                                          ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:30:123: use of undeclared identifier 'config'

  NSLog(@"Setting visitor info: department: %@ tags: %@, email: %@, name: %@, phone: %@", config.department, config.tags, config.visitorInfo.email, config.visitorInfo.name, config.visitorInfo.phoneNumber);
                                                                                                             ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:30:149: use of undeclared identifier 'config'

  NSLog(@"Setting visitor info: department: %@ tags: %@, email: %@, name: %@, phone: %@", config.department, config.tags, config.visitorInfo.email, config.visitorInfo.name, config.visitorInfo.phoneNumber);
                                                                                                                          ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:30:174: use of undeclared identifier 'config'

  NSLog(@"Setting visitor info: department: %@ tags: %@, email: %@, name: %@, phone: %@", config.department, config.tags, config.visitorInfo.email, config.visitorInfo.name, config.visitorInfo.phoneNumber);
                                                                                                                                                    ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:34:5: use of undeclared identifier 'ZDKChatConfiguration'

    ZDKChatConfiguration *chatConfiguration = [[ZDKChatConfiguration alloc] init];
                                                                                                                                                                             ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:34:27: use of undeclared identifier 'chatConfiguration'

    ZDKChatConfiguration *chatConfiguration = [[ZDKChatConfiguration alloc] init];
    ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:34:49: use of undeclared identifier 'ZDKChatConfiguration'

    ZDKChatConfiguration *chatConfiguration = [[ZDKChatConfiguration alloc] init];
                          ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:36:9: unknown type name 'chatConfiguration'; did you mean 'UIPasteConfiguration'?

        chatConfiguration.chatMenuActions = options[@"chatMenuActions"];
                                                ^

❌  /Users/yungkittty/Clones/b2c-app/node_modules/react-native-zendesk-v2/ios/RNZendeskChat.m:36:9: use of undeclared identifier 'chatConfiguration'

        chatConfiguration.chatMenuActions = options[@"chatMenuActions"];
           ^

❌  fatal error: too many errors emitted, stopping now [-ferror-limit=]

I'm using React Native 0.63.3 and the latest version of the package.

Saranshmalik commented 3 years ago

This feels like, Pods not available, could you confirm you did pod install after installing the package and then make sure you see Zendesk Pods in your project.

yatish3230 commented 3 years ago

Hi Saranshmalik Problem is in particular ios. ZDKChat is giving some error while importing it. It says It doen't find any thing like this. so all the things from ZDKChat in RNZendesk file is throwing error.

On Thu, Feb 4, 2021 at 3:31 PM Saransh Malik notifications@github.com wrote:

This feels like, Pods not available, could you confirm you did pod install after installing the package and then make sure you see Zendesk Pods in your project.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Saranshmalik/react-native-zendesk/issues/10#issuecomment-773185554, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO6LZESPQZYYKHWBEQWCEQDS5JWA7ANCNFSM4VEMYUOQ .

Saranshmalik commented 3 years ago

But do you see Zendesk SDKs in your pods? I use this package in a production app and see no issues in builds. Please make sure pods are installed and let me know

yungkittty commented 3 years ago

I have found the source of my errors. They were due to my react native configuration (several schemas). If this is your case too, here is the fix (to add in your podfile) :

project 'awesome',
        'Dev.Debug' => :debug,
        'Dev.Release' => :release, 
        'Qa.Debug' => :debug,
        'Qa.Release' => :release, 
        'Prod.Debug' => :debug,
        'Prod.Release' => :release

http://blog.logicwind.com/adding-multiple-target/

ajw-m commented 3 years ago

I'm not using several schemas. What worked for me is going to Pods => Selecting the pod (RNZendeskChat) and going to Build Settings tab => Build Active Architecture Only => Release => Yes

The Release value was No for me. Hope this helps.

yungkittty commented 3 years ago

@ajw-m In fact both are related, in both case release wasn't set to true in some ways!

heavyskyl commented 3 years ago

Did not help me on react-native 0.63.2.

ajw-m commented 3 years ago

Did not help me on react-native 0.63.2.

You're having the same error and you tried all of the steps above? Is the error also in "Release"?

nelsona commented 3 years ago

I am having a similar error, the issue is when trying to run a Release config on the simulator.

Running a release build with the following configuration causes the build to fail:

xcodebuild -workspace ios/app.xcworkspace -scheme app -configuration Release -sdk iphonesimulator -derivedDataPath ios/build

ajw-m commented 3 years ago

@nelsona any errors?

Saranshmalik commented 3 years ago

This should be fixed, please update the version and let me know if any one still faces these issues.