Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cant build the iOS app after upgrading to Xcode 12 #23

Closed
haelsisy opened this issue Sep 22, 2020 · 21 comments
Closed

I cant build the iOS app after upgrading to Xcode 12 #23

haelsisy opened this issue Sep 22, 2020 · 21 comments

Comments

@haelsisy
Copy link

I cant build the iOS app after upgrading to Xcode 12
It returns

Screen Shot 2020-09-22 at 9 04 38 PM

I'm using the latest of this repository with Xcode 12.0 (12A7209)
"@leanplum/react-native-sdk": "https://github.com/Leanplum/Leanplum-ReactNative-SDK",
"react": "16.11.0",
"react-native": "0.62.2"

@nzagorchev
Copy link
Contributor

Hello,
Can you try the following:

  • Delete Pod folder and Pod.lock file
  • run pod repo update
  • run pod install

I am able to compile the following app successfully with Xcode12:
https://github.com/Leanplum/Rondo-ReactNative

@haelsisy
Copy link
Author

@nzagorchev Which "@leanplum/react-native-sdk" version?

@brianephraim
Copy link

image

@nzagorchev
Copy link
Contributor

Using version 1.1.0-beta5

@brianephraim
Copy link

1.1.0-beta11

▸ Compiling Leanplum.swift

❌  /Users/my-app/ios/Pods/Leanplum-iOS-SDK/Leanplum-SDK/Classes/LPVar.h:113:1: 'LPVar' with definition in module 'Leanplum' has different definitions in different modules; first difference is this method

- (NSString *)name;
                                                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



❌  /Users/my-app/ios/Pods/Leanplum-iOS-SDK/Leanplum-SDK/Classes/Leanplum.h:463:1: 'Leanplum' with definition in module 'react_native_leanplum' has different definitions in different modules; first difference is this method

+ (void)handleActionWithIdentifier:(NSString *)identifier
^



❌  /Users/my-app/node_modules/@leanplum/react-native-sdk/ios/Leanplum.swift:119:40: type 'Leanplum' has no member 'LocationAccuracyType'

        if let accuracyType = Leanplum.LocationAccuracyType(rawValue: type) {
^


▸ Compiling LeanplumInbox.swift

❌  /Users/my-app/ios/Pods/Leanplum-iOS-SDK/Leanplum-SDK/Classes/Leanplum.h:463:1: 'Leanplum' with definition in module 'react_native_leanplum' has different definitions in different modules; first difference is this method

+ (void)handleActionWithIdentifier:(NSString *)identifier
                              ~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~


▸ Compiling LeanplumTypeUtils.swift

❌  /Users/my-app/ios/Pods/Leanplum-iOS-SDK/Leanplum-SDK/Classes/LPVar.h:113:1: 'LPVar' with definition in module 'Leanplum' has different definitions in different modules; first difference is this method

- (NSString *)name;
^

@brianephraim
Copy link

I just upgraded from React Native 0.62.2 to 0.63.3 but that actually churned up more error

▸ Compiling Leanplum.swift

❌  /Users/my-app/ios/Pods/Leanplum-iOS-SDK/Leanplum-SDK/Classes/LPVar.h:113:1: 'LPVar' with definition in module 'Leanplum' has different definitions in different modules; first difference is this method

- (NSString *)name;
                           ^



❌  /Users/my-app/ios/Pods/Leanplum-iOS-SDK/Leanplum-SDK/Classes/Leanplum.h:463:1: 'Leanplum' with definition in module 'react_native_leanplum' has different definitions in different modules; first difference is this method

+ (void)handleActionWithIdentifier:(NSString *)identifier
^



❌  /Users/my-app/node_modules/@leanplum/react-native-sdk/ios/Leanplum.swift:119:40: type 'Leanplum' has no member 'LocationAccuracyType'

        if let accuracyType = Leanplum.LocationAccuracyType(rawValue: type) {
^



❌  /Users/my-app/node_modules/@leanplum/react-native-sdk/ios/Leanplum.swift:198:24: argument passed to call that takes no arguments

        let lpVar = Var(name: name, file: filename)
                              ~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~


▸ Compiling LeanplumInbox.swift

❌  /Users/my-app/ios/Pods/Leanplum-iOS-SDK/Leanplum-SDK/Classes/Leanplum.h:463:1: 'Leanplum' with definition in module 'react_native_leanplum' has different definitions in different modules; first difference is this method

+ (void)handleActionWithIdentifier:(NSString *)identifier
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~


▸ Compiling LeanplumTypeUtils.swift

❌  /Users/my-app/ios/Pods/Leanplum-iOS-SDK/Leanplum-SDK/Classes/LPVar.h:113:1: 'LPVar' with definition in module 'Leanplum' has different definitions in different modules; first difference is this method

- (NSString *)name;
^



❌  /Users/my-app/node_modules/@leanplum/react-native-sdk/ios/LeanplumTypeUtils.swift:17:24: argument passed to call that takes no arguments

            lpVar = Var(name: key, double: value as? Double ?? 0.0)
^



❌  /Users/my-app/node_modules/@leanplum/react-native-sdk/ios/LeanplumTypeUtils.swift:19:24: argument passed to call that takes no arguments

            lpVar = Var(name: key, boolean: value as? Bool ?? false)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



❌  /Users/my-app/node_modules/@leanplum/react-native-sdk/ios/LeanplumTypeUtils.swift:21:24: argument passed to call that takes no arguments

            lpVar = Var(name: key, string: value as? String)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



❌  /Users/my-app/node_modules/@leanplum/react-native-sdk/ios/LeanplumTypeUtils.swift:23:24: argument passed to call that takes no arguments

            lpVar = Var(name: key, array: value as? Array)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



❌  /Users/my-app/node_modules/@leanplum/react-native-sdk/ios/LeanplumTypeUtils.swift:23:53: generic parameter 'Element' could not be inferred in cast to 'Array'

            lpVar = Var(name: key, array: value as? Array)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



❌  /Users/my-app/node_modules/@leanplum/react-native-sdk/ios/LeanplumTypeUtils.swift:25:24: argument passed to call that takes no arguments

            lpVar = Var(name: key, dictionary: value as? Dictionary)
                                                    ^



❌  /Users/my-app/node_modules/@leanplum/react-native-sdk/ios/LeanplumTypeUtils.swift:25:58: generic parameter 'Key' could not be inferred in cast to 'Dictionary'

            lpVar = Var(name: key, dictionary: value as? Dictionary)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



❌  /Users/my-app/node_modules/@leanplum/react-native-sdk/ios/LeanplumTypeUtils.swift:25:58: generic parameter 'Value' could not be inferred in cast to 'Dictionary'

            lpVar = Var(name: key, dictionary: value as? Dictionary)
                                                         ^

@milos1290
Copy link
Contributor

@defualt Can you make sure your pods are updated. Go to ios folder and run 'pod repo update' and 'pod install' to pull the latest version of native iOS Leanplum-iOS SDK

@brianephraim
Copy link

I'm still getting errors.
I installed Leanplum/Leanplum-ReactNative-SDK version 1.1.0.
react-native version is 0.63.3.
Here are the commands I ran after npm installing the latest leanplum/react-native-sdk.

rm -rf node_modueles
rm -rf ios/Pods
rm ios/Podfile.lock
npm install
(cd ios && pod repo update && pod install)

The Podfile.lock file has this:

  - Leanplum-iOS-SDK (3.0.0)

...

- react-native-leanplum (1.1.0):
    - Leanplum-iOS-SDK (= 3.0.0)
    - React

I ran "Clean Build Folder" from Xcode menus.
I then pressed play in Xcode.

I get these errors with a failed build:

image

Then when I try to run react-native run-ios I get these errors:

** BUILD FAILED **


The following build commands failed:
	CompileSwift normal x86_64 /Users/app/ios/Pods/FBSDKShareKit/FBSDKShareKit/FBSDKShareKit/Swift/Enums+Extensions.swift
	CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
	CompileSwift normal x86_64 /Users/app/node_modules/@leanplum/react-native-sdk/ios/Leanplum.swift
	CompileSwift normal x86_64 /Users/app/node_modules/@leanplum/react-native-sdk/ios/LeanplumInbox.swift
	CompileSwift normal x86_64 /Users/app/node_modules/@leanplum/react-native-sdk/ios/LeanplumTypeUtils.swift
	CompileSwift normal x86_64 /Users/app/node_modules/lottie-react-native/src/ios/LottieReactNative/AnimationViewManagerModule.swift
	CompileSwift normal x86_64 /Users/app/node_modules/lottie-react-native/src/ios/LottieReactNative/ContainerView.swift
(7 failures)

Then when I try to Play again from Xcode I get these errors:

image

When I uninstall Leanplum/Leanplum-ReactNative-SDK I get no errors and the build succeeds.

@haelsisy
Copy link
Author

haelsisy commented Oct 4, 2020

Any updates?

@brianephraim
Copy link

I hope to see progress on this issue because this is blocking a new release. Let me know if you need any more information.

@jgalianoz
Copy link

Any updates ?

@jgalianoz
Copy link

@defualt @zumaawad Do you compile the project in Legacy mode?

image

When I compile in Legacy mode I receive this error:

image

When I don't compile in Legacy mode I receive this error:

image

@milos1290
Copy link
Contributor

milos1290 commented Oct 20, 2020

So what i did is this

Make sure that package.json has "@leanplum/react-native-sdk": "^1.1.0"

after:

yarn upgrade @leanplum/react-native-sdk OR npm update @leanplum/react-native-sdk
cd ios && pod update

Verify in yarn.lock/package.lock that latest version is used, make sure pod i using 3.0.0 of Leanplum iOS SDK

And i was able to build iOS App from XCode

@brianephraim
Copy link

@milos1290 Please review my message above where I confirm the versions installed with a fresh node_modules and Pods folders:

  • @leanplum/react-native-sdk": "1.1.0"
  • Leanplum-iOS-SDK (3.0.0)

Have you tried installing lottie-react-native along with @leanplum/react-native-sdk? Lottie is mentioned in the errors, but only when Leanplum is also installed.

@milos1290
Copy link
Contributor

milos1290 commented Oct 20, 2020

Disregard my previous reply, i've managed to track the issue.
Recently RN switched from using dynamic linking to static due to few libraries that have static dependencies (mainly Flipper).

The only solution is to add to ios/Podfile
use_frameworks!

and remove

  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
  end

After it run pod install in ios folder and clean the project before building.

@jgalianoz
Copy link

@milos1290 I receive this error when removing this.

image

@brianephraim
Copy link

@milos1290 I assume that disables Flipper. Is there the possibility of another fix that keeps Flipper integration intact?

@milos1290
Copy link
Contributor

milos1290 commented Oct 22, 2020

@jgalianoz @defualt I'm afraid there is nothing we can do atm, we will have to wait for facebook to release a fix. I'm still trying to find other solution to would allow us to link SDK dynamically and successfully build the app

@milos1290
Copy link
Contributor

@defualt @jgalianoz I'm released a new version for RN SDK, it will contain a partial fix for XCode12 and RN 0.63 issues. I'll post a guide on how to proceed

@milos1290
Copy link
Contributor

Please refer to this issue or a fix #30

@nzagorchev
Copy link
Contributor

Please refer to this issue or a fix #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants