-
Notifications
You must be signed in to change notification settings - Fork 287
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
Interstitial ad fails to show in Flutter modules. "The provided view controller is already presenting another view controller." [iOS] #700
Comments
Hi @rckrd-proguitar Also, please provide the output of |
Here you go @huycozy : https://github.com/rckrd-proguitar/googleads-mobile-flutter-issue-700 The example generates the following log when the interstitial ad tries to present itself:
You find the output of |
If there is no other workaround or error on my part, the following could maybe be a solution to find the view controller on top.
|
@rckrd-proguitar Sorry for replying late. I can reproduce this issue with provided sample code at #700 (comment). Labeling this issue for further investigation from the team. Thanks! Demo videoScreen.Recording.2022-11-21.at.12.41.32.movLog
flutter doctor -v (stable and master)[✓] Flutter (Channel stable, 3.3.8, on macOS 13.0 22A380 darwin-x64, locale en-VN)
• Flutter version 3.3.8 on channel stable at /Users/huynq/Documents/GitHub/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 52b3dc25f6 (23 hours ago), 2022-11-09 12:09:26 +0800
• Engine revision 857bd6b74c
• Dart version 2.18.4
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-33, build-tools 31.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14A400
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.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.13+0-b1751.21-8125866)
[✓] IntelliJ IDEA Community Edition (version 2022.2.2)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 70.0.5
• Dart plugin version 222.4167.21
[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
• IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
• 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
[✓] VS Code (version 1.73.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.52.0
[✓] Connected device (3 available)
• iPhone 14 Pro Max (mobile) • 332079AF-E895-4685-910E-7B1E18B0C6B8 • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-0 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 13.0 22A380 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.110
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
[!] Flutter (Channel master, 3.6.0-6.0.pre.29, on macOS 13.0 22A380 darwin-x64, locale en-VN)
• Flutter version 3.6.0-6.0.pre.29 on channel master at /Users/huynq/Documents/GitHub/flutter_master
! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ee9bc784b5 (2 hours ago), 2022-11-20 19:32:24 -0500
• Engine revision 271461837e
• Dart version 2.19.0 (build 2.19.0-406.0.dev)
• DevTools version 2.19.0
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-33, build-tools 31.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14A400
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.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.13+0-b1751.21-8125866)
[✓] IntelliJ IDEA Community Edition (version 2022.2.2)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 70.0.5
• Dart plugin version 222.4167.21
[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
• IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
• 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
[✓] VS Code (version 1.73.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.52.0
[✓] Connected device (3 available)
• SM T225 (mobile) • R9JT3004VRJ • android-arm64 • Android 12 (API 31)
• macOS (desktop) • macos • darwin-x64 • macOS 13.0 22A380 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.110
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
|
@jjliu15 I am facing this issue in version 3.1.0 but if i downgrade it to 2.4.0 its working fine Anyone Resolve this? |
Hello |
I also have this issue. |
Check if you are accidentally disposing the ad at a wrong place. |
That is exactly when I do that and it still does not work. |
I am still getting "The provided view controller is not being presented." as described in previous post.. please is there any solution for this ? It only works as expected at version 2.4.0 .. but at this version CMP is not implemented, which we need in our app. Please let us know as soon as problem is solved. |
Same here, the problem is definetly not solved. |
Same here, multiple occurrences!! |
This happens the first time I show the ad. But I moved the code to an external file, and that's when it all started happening. |
Mark,same question in newest sdk version 5.1.0, anyone has some way to fix it? |
I have re-opened the case and have shared with engineering to take another look |
This has been resolved with #1153 and will be included in the next google_mobile_ads plugin release |
Plugin Version
2.3.0
Steps to Reproduce
flutter create bug -t module
.Expected results: The Interstitial ad is shown in fullscreen.
Actual results: The view fails to show. Error message: "The provided view controller is already presenting another view controller."
The view controller used to present to interstitial ad view is not the "Flutter view controller" when flutter is running in a host app.
The viewcontroller used is the rootviewcontroller of the host app, i.e the main view of the host app.
https://github.com/googleads/googleads-mobile-flutter/blob/main/packages/google_mobile_ads/ios/Classes/FLTGoogleMobileAdsPlugin.m#L196
Possible solution:
Is there any reason not to use the view controller that is on top of the stack? When a host app opens flutter it's convenient to keep the rootviewcontroller as the main native/host VC so it is easy to navigate back to the host app from flutter.
Logs
FullScreenContentCallback.onAdFailedToShowFullScreenContent: "The provided view controller is already presenting another view controller."
flutter doctor -v:
[✓] Flutter (Channel stable, 3.3.8, on macOS 12.6 21G115 darwin-x64, locale en-SE)
• Flutter version 3.3.8 on channel stable at /Users/rickard/Dev/flutter/sdk
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 52b3dc25f6 (7 days ago), 2022-11-09 12:09:26 +0800
• Engine revision 857bd6b74c
• Dart version 2.18.4
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/rickard/Dev/Android/sdk
• Platform android-31, build-tools 31.0.0
• ANDROID_HOME = /Users/rickard/Dev/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14B47b
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.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 11.0.12+0-b1504.28-7817840)
[✓] VS Code (version 1.73.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.52.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 12.6 21G115 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.110
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
The text was updated successfully, but these errors were encountered: