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

[Bug]: iOS Compilation error with version 0.14.3 #159

Closed
1 task done
zitob9 opened this issue Nov 4, 2021 · 34 comments · Fixed by #174
Closed
1 task done

[Bug]: iOS Compilation error with version 0.14.3 #159

zitob9 opened this issue Nov 4, 2021 · 34 comments · Fixed by #174
Labels
bug🐞 Something isn't working

Comments

@zitob9
Copy link

zitob9 commented Nov 4, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

i update to 0.14.3, i clean flutter and iOS

When building the project, I'm getting the following error messages:

Cannot convert value of type '[AppEvents.ParameterName : Any]' to expected argument type '[String : Any]'

Cannot convert value of type '[AppEvents.ParameterName : Any]' to expected argument type '[String : Any]'

problem is on this code: (SwiftFacebookAppEventsPlugin)

private func handleLogEvent(_ call: FlutterMethodCall, result: @escaping FlutterResult) { let arguments = call.arguments as? [String: Any] ?? [String: Any]() let eventName = arguments["name"] as! String let parameters = arguments["parameters"] as? [AppEvents.ParameterName: Any] ?? [AppEvents.ParameterName: Any]() if arguments["_valueToSum"] != nil && !(arguments["_valueToSum"] is NSNull) { let valueToDouble = arguments["_valueToSum"] as! Double AppEvents.logEvent(AppEvents.Name(eventName), valueToSum: valueToDouble, parameters: parameters) } else { AppEvents.logEvent(AppEvents.Name(eventName), parameters: parameters) }

Expected Behavior

Build should be successful.

Steps To Reproduce

Using Xcode 13.1, flutter version 2.2.3:

Platform

iOS

Flutter Doctor

[✓] Flutter (Channel stable, 2.2.3, on macOS 11.6 20G165 darwin-x64, locale en-FR)
    • Flutter version 2.2.3 at /Users/mac/development/flutter
    • Framework revision f4abaa0735 (4 months ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mac/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.1, Build version 13A1030d
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 95.0.4638.69
    ! Error: iPhone is not connected. Xcode will continue when iPhone is connected. (code -13)

• No issues found!
@zitob9 zitob9 added the bug🐞 Something isn't working label Nov 4, 2021
@millerovv
Copy link

millerovv commented Nov 5, 2021

Hi! I encountered the same problem yesterday. This is confusing, that is the same error as mentioned in (#156), isn't it? Although v0.14.3 was supposed to fix it?

@zitob9
Copy link
Author

zitob9 commented Nov 5, 2021

Hi! I encountered the same problem yesterday. This is confusing, that is the same error as mentioned in (#156), isn't it? Although v0.14.3 was supposed to fix it?

I use this this version but the problem is still

@tamoyal
Copy link

tamoyal commented Nov 6, 2021

Yes I also have this issue. Is there any work around?

@zitob9
Copy link
Author

zitob9 commented Nov 6, 2021

i don't find nothing about that

Yes I also have this issue. Is there any work around?

@tamoyal
Copy link

tamoyal commented Nov 6, 2021

I got it to work by bumping the version of FBSDKCoreKit

Here is the PR - #160

@zitob9
Copy link
Author

zitob9 commented Nov 8, 2021

any updates about this case?

@DennisAlund
Copy link
Member

Yes, comments waiting in PR #160 (comment)

@zitob9
Copy link
Author

zitob9 commented Nov 11, 2021

you can check the error here: https://ibb.co/DKp4MXr

@zitob9
Copy link
Author

zitob9 commented Nov 17, 2021

@DennisAlund Is there a solution because I can not publish the application?

@DennisAlund
Copy link
Member

@zitob9 you can post screenshots and logs here in Github so it's easier to review: https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/attaching-files

@deepsan98
Copy link

deepsan98 commented Nov 18, 2021

Hi, I had installed both versions 0.14.3 and 0.14.5, but I found exactly the same issue mentioned above.
I am using flutter version 2.2.2.

To solve the problem, I had to make a change in my pod file from:

pod 'FBSDKCoreKit'
(it was installing FBSDKCoreKit 12.1.0), to this.

pod 'FBSDKCoreKit', '~> 12.0.0'

This change made my code compile correctly, and I am using version 0.14.5 .

@zitob9
Copy link
Author

zitob9 commented Nov 18, 2021

@DennisAlund its works now when I use v 0.14.5

@devibrahimkarahan
Copy link

devibrahimkarahan commented Nov 18, 2021

@DennisAlund
Im using 0.14.5, still same

@deepsan98 's solution works

Error:
Cannot convert value of type '[String : Any]' to expected argument type '[AppEvents.ParameterName : Any]'

image

@chuprik
Copy link

chuprik commented Nov 18, 2021

the same issue for me

@zitob9
Copy link
Author

zitob9 commented Nov 18, 2021

clean your data.

you can use this command on your folder:

flutter clean \ && rm ios/Podfile.lock pubspec.lock \ && rm -rf ios/Pods ios/Runner.xcworkspace

@OneXeor
Copy link

OneXeor commented Nov 19, 2021

@DennisAlund Are you kidding? :)
This issue is pretty simple.
There were this one PR -> #157
Which fixed this issue but @yanivshaked forgot to change the FBSDKCoreKit version to '~> 12.1.0' in the flutter_facebook_app_events.pospec file. It's needed to avoid issue with AppEvents.ParameterName because such type appears only in 12.1.0.
Then @DennisAlund had reverted PR#157 in his PR#163.

So the thing is that to solve this forever we need to change the version of the FBSDKCoreKit to '~> 12.1.0' and apply changes from PR#157

In general take a look at this PR #170

@DennisAlund
Copy link
Member

@OneXeor why do you think I am kidding? What's the joke?

@OneXeor
Copy link

OneXeor commented Nov 20, 2021

@DennisAlund because you could solve it 16 days ago in PR#157, once and for all. But 8 days ago in PR#163, to my mind, you decided to play a joke cause you reverted the fix.

@RicardoRB
Copy link

I am having "isAdvertiserIDCollectionEnabled", does this PR fix it?

@DennisAlund
Copy link
Member

(the following was installing FBSDKCoreKit 12.1.0)

pod 'FBSDKCoreKit'

(it was installing FBSDKCoreKit 12.1.0), to this.

pod 'FBSDKCoreKit', '~> 12.0.0'

@deepsan98 I'm interested to learn more why FBSDKCoreKit resolved to 12.0.0 when declared as

s.dependency 'FBSDKCoreKit', '~> 12.0'

According to cocoapods documentation it should have resolved to 12.1 ...

image

@DennisAlund
Copy link
Member

See if v0.14.6 is fixing problems

@zitob9
Copy link
Author

zitob9 commented Nov 23, 2021

yes its work for me, thank so much bro.

@furkanvatandas
Copy link

Still not compile for me with v0.14.6

Screen Shot 2021-11-23 at 10 34 17

@DennisAlund
Copy link
Member

@furkanvatandas please provide output from flutter doctor and all other potential information if you want to have a chance for us to help you with your setup.

@furkanvatandas
Copy link

@DennisAlund sure

[✓] Flutter (Channel stable, 2.5.3, on macOS 11.6 20G165 darwin-x64, locale en-TR)
    • Flutter version 2.5.3 at /Users/furkan.vatandas/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (6 weeks ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/furkan.vatandas/Library/Android/sdk
    • Platform android-31, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.1, Build version 13A1030d
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.62.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.28.0

@OneXeor
Copy link

OneXeor commented Nov 23, 2021

@DennisAlund, I am guessing that my PR could fix that :)
I do not understand why you want to use the 12.0.0 version of FBSDKCoreKit, which will not work with AppEvents.ParameterName? Or I don’t understand something sacred?

@wwnOddbit
Copy link
Contributor

@OneXeor Please have a look at my comment on #160 in regard to CocoaPods optimistic operator. I'd love to figure out whether I'm missing something here.

@suryaoddbit
Copy link
Contributor

Hi @furkanvatandas have you try update pod repo first?
Or please do this step first.

  1. delete pubspec.lock file
  2. run pod repo update
  3. run pod install

@wwnOddbit
Copy link
Contributor

wwnOddbit commented Nov 25, 2021

@kotchuprik @furkanvatandas Basically, we're trying to figure out why FBSDKCoreKit is not updating to the latest version (12.1.0) while the optimistic operator ~> 12.0 in Podfile should have handled that. May I suggest the following:

  1. run pod outdated to check whether FBSDKCoreKit is on the latest version (12.1.0). If it's already on 12.1.0, then unfortunately we're having a different problem. 😅
  2. run pod update FBSDKCoreKit to update to the latest version.
  3. run pod outdated again to make sure it is updated to 12.1.0. If it's not, please try to start with a clean environment as suggested by @zitob9 and continue w/ steps posted by @suryaoddbit.

#159 (comment)

clean your data.

you can use this command on your folder:

flutter clean \ && rm ios/Podfile.lock pubspec.lock \ && rm -rf ios/Pods ios/Runner.xcworkspace

#159 (comment)

  1. delete pubspec.lock file
  2. run pod repo update
  3. run pod install
  1. run pod outdated for the third time. Hopefully, FBSDKCoreKit is updated to 12.1.0 by now.

I'd appreciate it if you could also provide your feedback after trying out the steps above. It will help us provide the best solution for the community on similar problems. Good luck.

@bhanuka96
Copy link

Still not compile for me with v0.14.6

Screen Shot 2021-11-23 at 10 34 17

same issues

@OneXeor
Copy link

OneXeor commented Nov 25, 2021

Anyone checked #173 PR? Because I have some doubts how can it work, it uses AppEvents.ParameterName.RawValue whereas AppEvents.ParameterName is needed for parameters in theAppEvents.logEvent method :)

@OneXeor Please have a look at my comment on #160 in regard to CocoaPods optimistic operator. I'd love to figure out whether I'm missing something here.

I saw your comment but still It makes no sense because 12.0.0 can't use [AppEvents.ParameterName:Any] and 12.1.0 can't use [String:Any]

@furkanvatandas
Copy link

furkanvatandas commented Nov 25, 2021

Hi @furkanvatandas have you try update pod repo first? Or please do this step first.

  1. delete pubspec.lock file
  2. run pod repo update
  3. run pod install

@suryaoddbit I try your all command and also this commands

rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
pod setup
pod install

Still not compile

@ferysyukur
Copy link
Contributor

hi @furkanvatandas , do you use mac m1 ?
If yes, please try this way.

sudo arch -x86_64 gem install ffi
sudo arch -x86_64 pod clean
sudo arch -x86_64 pod install

make sure you use this command after you use pod deintegrate to rebuild all generated file was deleted.

flutter packages get
/// or
flutter build

Let me know if this way is not working.

@devibrahimkarahan
Copy link

devibrahimkarahan commented Dec 7, 2021

0.14.7 working 👍 (M1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug🐞 Something isn't working
Projects
None yet