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

[webview_flutter] Contributions require special tooling #152352

Open
sumanthratna opened this issue Jul 26, 2024 · 8 comments · May be fixed by flutter/packages#8311
Open

[webview_flutter] Contributions require special tooling #152352

sumanthratna opened this issue Jul 26, 2024 · 8 comments · May be fixed by flutter/packages#8311
Assignees
Labels
p: webview The WebView plugin P1 High-priority issues at the top of the work list package flutter/packages repository. See also p: labels. team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team

Comments

@sumanthratna
Copy link

sumanthratna commented Jul 26, 2024

What package does this bug report belong to?

webview_flutter

What target platforms are you seeing this bug on?

iOS

Have you already upgraded your packages?

Yes

Dependency versions

N/A

Steps to reproduce

  1. git clone [email protected]:flutter/packages.git --depth 1
  2. cd packages/packages/webview_flutter/webview_flutter_wkwebview
  3. dart run pigeon --input pigeons/web_kit.dart
  4. cd example/
  5. flutter run

Expected results

The example app opens in the simulator without issue.

Actual results

When I run flutter run, I get an error caused by incorrect Pigeon codegen results.

When I run flutter run without running dart run pigeon --input pigeons/web_kit.dart, the example app opens without issue.

When I pin pigeon to 13.0.0, Pigeon still produces incorrect codegen results.

When I fix the mistake manually across all the generated files, flutter run succeeds.

I want to submit a PR to the webview_flutter package to implement a feature I need (flutter_inappwebview is not an alternative at the moment, since it does not provide a Privacy Manifest). I'd love to be able to contribute but am stuck as to why I can't run pigeon correctly.

What is the command that the Flutter team uses to run Pigeon for this package?

Code sample

N/A

Screenshots or Videos

N/A

Logs

flutter run Logs
Launching lib/main.dart on iPhone 15 Pro Max in debug mode...
Warning: Missing build name (CFBundleShortVersionString).
Warning: Missing build number (CFBundleVersion).
Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store.
Running Xcode build...                                                  
Xcode build done.                                            3.7s
Failed to build iOS app
Semantic Issue (Xcode): Unknown type name 'FWFFWFWKNavigationResponsePolicyEnumBox'; did you mean
'FWFWKNavigationResponsePolicyEnumBox'?
.../flutter-packages/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/So
urces/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h:707:226


Could not build the application for the simulator.
Error launching application on iPhone 15 Pro Max.

This is the diff produced by running Pigeon: pigeon.patch

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.22.3, on macOS 14.5 23F79 darwin-arm64, locale en-US)
    • Flutter version 3.22.3 on channel stable at /Users/sumanthratna/flutter
    • Upstream repository [email protected]:flutter/flutter.git
    • Framework revision b0850beeb2 (9 days ago), 2024-07-16 21:43:41 -0700
    • Engine revision 235db911ba
    • Dart version 3.4.4
    • DevTools version 2.34.3

[✗] Android toolchain - develop for Android devices
    ✗ ANDROID_HOME = /Users/sumanthratna/android-sdks
      but Android SDK not found at this location.

[✓] 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 (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

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

[✓] Connected device (1 available)
    • iPhone 15 Pro Max (mobile)      • 27C05A15-B3F2-47E0-9D20-7F8D0AB558B9 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-17-5 (simulator)

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

! Doctor found issues in 2 categories.
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Jul 26, 2024
@darshankawar
Copy link
Member

@sumanthratna
I followed the steps to replicate and was able to compile and build the app properly without throwing any errors.

Screenshot 2024-07-26 at 3 35 07 PM

I also tried on 3.22.3. Can you try to run through XCode and see if you get same error or not ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 26, 2024
@stuartmorgan stuartmorgan changed the title [webview_flutter_wkwebview] Pigeon is outdated? [webview_flutter] Contributions require special tooling Jul 26, 2024
@stuartmorgan stuartmorgan added p: webview The WebView plugin package flutter/packages repository. See also p: labels. team-ecosystem Owned by Ecosystem team P1 High-priority issues at the top of the work list triaged-ecosystem Triaged by Ecosystem team and removed waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds in triage Presently being triaged by the triage team labels Jul 26, 2024
@stuartmorgan
Copy link
Contributor

stuartmorgan commented Jul 26, 2024

webview_flutter is currently in a transition state, where it is difficult to contribute directly. We have some existing community PRs that are currently on hold for that reason, but never filed an issue, so we can use this to track that being resolved by a switch to production tooling.

@bparrishMines If it's plausible for someone sufficiently motivated to update things now, e.g., by using a branch, maybe you could post those instructions here, in case anyone really wants to try in the interim? If not though, we can just track this being unblocked probably in August.

@sumanthratna
Copy link
Author

Thanks for your reply @stuartmorgan!

@bparrishMines I don't mind waiting a few months to create the actual PR (i.e., until tooling work is finished), but would greatly appreciate instructions on how I can properly run the current tooling locally, as the feature I am working on is an urgent need.

@bparrishMines
Copy link
Contributor

bparrishMines commented Jul 31, 2024

@sumanthratna The Flutter team also uses dart run pigeon --input pigeons/web_kit.dart to generate the pigeon code as explained in https://github.com/flutter/packages/blob/main/packages/webview_flutter/webview_flutter_wkwebview/README.md#contributing.

I ran into the same issue when regenerating and it looks like it was due to a bug that was fixed in 17.1.3: flutter/packages#6263. I tried just pinning pigeon to 17.1.3 and the generated code worked without needing to change anything.

This should work for you until the wrapper is rewritten with flutter/packages#6602 next month.

@sumanthratna
Copy link
Author

Thanks @bparrishMines. Will keep an eye out for the new Pigeon implementation. I suppose we could close this issue then? But if you all have a spare cycle I might suggest a quick addition to the README to note that webview_flutter is mid-transition and link to this issue. I saw that the last commit was 2 months ago and assumed that package development was stable/reliable now.

I would send a PR myself but I think I lack context on rationale for this whole set of changes

@bparrishMines
Copy link
Contributor

We can keep this open to ensure that I come back to create a comprehensive CONTRIBUTING.md for the webview implementations. Currently the pigeon wrapper structure is similar to what is explained in camera_android_camerax https://github.com/flutter/packages/blob/main/packages/camera/camera_android_camerax/CONTRIBUTING.md. But it should be easier to use once flutter/packages#6371 lands

@bparrishMines bparrishMines self-assigned this Aug 2, 2024
@flutter-triage-bot flutter-triage-bot bot added the Bot is counting down the days until it unassigns the issue label Dec 6, 2024
@flutter-triage-bot
Copy link

This issue is assigned to @bparrishMines but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

@bparrishMines bparrishMines linked a pull request Dec 23, 2024 that will close this issue
11 tasks
@bparrishMines
Copy link
Contributor

bparrishMines commented Dec 23, 2024

Android has already been updated with a CONTRIBUTING.md and this PR will update it for iOS/macOS: flutter/packages#8311

@flutter-triage-bot flutter-triage-bot bot removed the Bot is counting down the days until it unassigns the issue label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: webview The WebView plugin P1 High-priority issues at the top of the work list package flutter/packages repository. See also p: labels. team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants