PostHog / posthog-ios

PostHog iOS SDK
https://posthog.com/docs/libraries/ios
MIT License
28 stars 37 forks source link

warning: no rule to process file 'macos/Pods/PostHog/PostHog/Resources/PrivacyInfo.xcprivacy' of type 'text.xml' for architecture 'arm64' (in target 'PostHog' from project 'Pods') #137

Closed stephane-archer closed 1 month ago

stephane-archer commented 1 month ago

Bug Description

$ flutter build macos
warning: no rule to process file 'macos/Pods/PostHog/PostHog/Resources/PrivacyInfo.xcprivacy' of type 'text.xml' for architecture 'arm64' (in target 'PostHog' from project 'Pods')
  posthog_flutter: ^4.0.0
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.5 23F79 darwin-x64, locale en-GB)
    • Flutter version 3.22.0 on channel stable at /Users/fractale/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (11 days ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/fractale/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

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

[✓] Android Studio (version 2022.2)
    • 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 17.0.6+0-17.0.6b802.4-9586694)

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 14.5 23F79 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 124.0.6367.208

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Debug info

No response

stephane-archer commented 1 month ago

Is this warning normal? How can I fix it?

Twixes commented 1 month ago

Hi @stephane-archer! This is the repo of the PostHog service, but the problems looks like a client library one. Are you perhaps using https://github.com/PostHog/posthog-flutter?

stephane-archer commented 1 month ago

@Twixes you are right, thank you @timgl for transferring the issue

marandaneto commented 1 month ago

@stephane-archer thanks for raising this issue, https://github.com/PostHog/posthog-flutter/pull/105 should fix it

stephane-archer commented 1 month ago

@marandaneto Thank you for fixing the issue :) PS: a quick and dirty version of posthog.capture for posthot-flutter for Windows would be just great.

marandaneto commented 1 month ago

Found a few similar issues https://github.com/firebase/firebase-ios-sdk/issues/12511 https://github.com/airbnb/lottie-ios/issues/2297 But we don't add the file under the Sources folder so the fix isn't the same, its just a warning anyway, I will merge my PR and wait for your feedback Edit: released as https://pub.dev/packages/posthog_flutter/versions/4.5.0 (make sure to clean your podfile lock and pods)

stephane-archer commented 1 month ago
> posthog_flutter 4.5.0 (was 4.4.1)
trash macos/Pods/ macos/Podfile.lock
warning: no rule to process file '/Users/fractale/CommercialProjects/video_proxy_generator/macos/Pods/PostHog/PostHog/Resources/PrivacyInfo.xcprivacy' of type 'text.xml' for architecture 'arm64' (in target 'PostHog' from project 'Pods')
warning: no rule to process file '/Users/fractale/CommercialProjects/video_proxy_generator/macos/Pods/PostHog/PostHog/Resources/PrivacyInfo.xcprivacy' of type 'text.xml' for architecture 'x86_64' (in target 'PostHog' from project 'Pods')

the problem doesn't seem to be solved

stephane-archer commented 1 month ago

@marandaneto please re-open this issue

marandaneto commented 1 month ago

I am not entirely sure what causing this, maybe it's a macOS issue since it's not the case for iOS? ideas? everything seems to be configured correctly (based on official docs).

stephane-archer commented 1 month ago

@marandaneto I have no idea. Do you have access to MacOS? I'm not sure how I can help you with this. Maybe you should open an issue on Flutter Git Hub? Their testing on MacOS is not always the best, the issue might not be on your side.

marandaneto commented 1 month ago

@marandaneto I have no idea. Do you have access to MacOS? I'm not sure how I can help you with this. Maybe you should open an issue on Flutter Git Hub? Their testing on MacOS is not always the best, the issue might not be on your side.

Yes, I do have a macOS and I can see the warnings on CI as well, will check if the warning appears without Flutter as well. , will give it another try later this week, as I mentioned, it is a warning and the build succeeded, so not a blocker for now I guess, thanks for testing it.

stephane-archer commented 1 month ago

@marandaneto I'm glad you can reproduce the issue.

a warning is usually not created for no reason and makes the user wonder if they have configured Posthog correctly. It also makes the package look less professional, firebase is a joke when you compile your app and you see the number of warnings they create. You wonder if they know what they are doing.

So, it is not a deal breaker but I would not consider this as useless.

marandaneto commented 1 month ago

@marandaneto I'm glad you can reproduce the issue.

a warning is usually not created for no reason and makes the user wonder if they have configured Posthog correctly. It also makes the package look less professional, firebase is a joke when you compile your app and you see the number of warnings they create. You wonder if they know what they are doing.

So, it is not a deal breaker but I would not consider this as useless.

Totally agree :)

I also see that on our iOS build (iOS native SDK, no flutter):

- NOTE  | xcodebuild:  warning: no rule to process file 'PostHog/PostHog/Resources/PrivacyInfo.xcprivacy' of type 'text.xml' for architecture 'arm64' (in target 'PostHog' from project 'Pods')
- NOTE  | xcodebuild:  warning: no rule to process file 'PostHog/PostHog/Resources/PrivacyInfo.xcprivacy' of type 'text.xml' for architecture 'x86_64' (in target 'PostHog' from project 'Pods')
- NOTE  | [watchOS] xcodebuild:  warning: no rule to process file 'PostHog/PostHog/Resources/PrivacyInfo.xcprivacy' of type 'text.xml' for architecture 'i386' (in target 'PostHog' from project 'Pods')

So if there's something on our end, it's not on the Flutter SDK wrapper

marandaneto commented 1 month ago

I also get this warning when running https://github.com/PostHog/posthog-ios/tree/main/PostHogExampleWithPods

Screenshot 2024-05-21 at 15 13 03

But if I generate a privacy report:

Screenshot 2024-05-21 at 15 13 33

Everything is working correctly, it might be something with Pods or Xcode, but I don't see any difference between our setup and other libs.

marandaneto commented 1 month ago

Hopefully https://github.com/PostHog/posthog-ios/releases/tag/3.4.0 fixes it

stephane-archer commented 1 month ago

@marandaneto Is it already available for users? can you tell me what version it is so I can test?

marandaneto commented 1 month ago

@stephane-archer 3.4.0 as linked above, if using flutter, you just have to upgrade your pods because the flutter dep always use the latest version 3.x.x

stephane-archer commented 1 month ago

Pods version - PostHog (3.2.5) I can still see this warning when building on Mac, please @marandaneto Re-open this issue

Flutter (Channel stable, 3.22.1, on macOS 14.5 23F79 darwin-x64, locale en-GB)
marandaneto commented 1 month ago

Please test it using 3.4.0 as requested.

stephane-archer commented 1 month ago

if I delete macos/Pods/ and macos/Podfile.lock this doesn't put PostHog (3.4.0), is there any commands for that? posthog_flutter: ^4.0.0

marandaneto commented 1 month ago

@stephane-archer This is just pods caching, you can see here the latest version https://cocoapods.org/pods/PostHog Delete the pods folder, delete the lock file, update the repo (pod repo update), etc.

stephane-archer commented 1 month ago

@marandaneto I was able to update the pods and I don't see the warning anymore. I'm confused about the fact that Pods and Flutter packages are independent, one does not force the other. Could you clarify why PostHog is not just a Flutter package and why it needs a Pod? I'm a bit confused about how packages and Pods are related and interact with each other.

marandaneto commented 1 month ago

@stephane-archer happy that it is fixed. this is how flutter packages work, https://docs.flutter.dev/packages-and-plugins/developing-packages

stephane-archer commented 1 month ago

@marandaneto can you force a pod update when someone updates their flutter package?