googleads / googleads-mobile-flutter

A Flutter plugin for the Google Mobile Ads SDK
Apache License 2.0
336 stars 276 forks source link

[Proposal] Update native ads example in github as per codelab #567

Closed ldobreira closed 1 year ago

ldobreira commented 2 years ago

Plugin Version

google_mobile_ads: ^1.2.0

Steps to Reproduce

  1. Followed the tutorial at https://developers.google.com/admob/flutter/native
  2. And also https://codelabs.developers.google.com/codelabs/admob-inline-ads-in-flutter#7
  3. Then after implementing MainActivity.java and NativeAdFactoryExample.java (even if I copy from the examples including the Github example) I always get the error below after running the App.
  4. Checked Stackoverflow, I tried the popular solutions including "flutter clean", changing the "android/app/build.gradle" file to 31 and add: android.useAndroidX=true android.enableJetifier=true to the "gradle.properties" file. Nothing worked.

Expected results:

The native ad running.

Actual results:


[ +299 ms] C:\flutter-apps\gamerpower_app\gamerpower - Copy
(12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:38: error: cannot find symbol     
[   +1 ms]     final NativeAdView adView = (NativeAdView) layoutInflater.inflate(R.layout.my_native_ad, null);
[        ]                                                                               ^
[        ]   symbol:   variable my_native_ad
[        ]   location: class layout
[        ] C:\flutter-apps\gamerpower_app\gamerpower - Copy
(12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:41: error: cannot find symbol     
[        ]     adView.setMediaView((MediaView) adView.findViewById(R.id.ad_media));
[        ]                                                             ^
[        ]   symbol:   variable ad_media
[        ]   location: class id
[        ] C:\flutter-apps\gamerpower_app\gamerpower - Copy
(12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:44: error: cannot find symbol     
[        ]     adView.setHeadlineView(adView.findViewById(R.id.ad_headline));
[        ]                                                    ^
[        ]   symbol:   variable ad_headline
[        ]   location: class id
[        ] > Task :app:compileDebugJavaWithJavac FAILED
[        ] C:\flutter-apps\gamerpower_app\gamerpower - Copy
(12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:45: error: cannot find symbol     
[        ]     adView.setBodyView(adView.findViewById(R.id.ad_body));
[        ]                                                ^
[        ]   symbol:   variable ad_body
[        ]   location: class id
[        ] C:\flutter-apps\gamerpower_app\gamerpower - Copy
(12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:46: error: cannot find symbol     
[        ]     adView.setCallToActionView(adView.findViewById(R.id.ad_call_to_action));
[        ]                                                        ^
[        ]   symbol:   variable ad_call_to_action
[        ]   location: class id
[        ] C:\flutter-apps\gamerpower_app\gamerpower - Copy
(12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:47: error: cannot find symbol     
[        ]     adView.setIconView(adView.findViewById(R.id.ad_app_icon));
[        ]                                                ^
[        ]   symbol:   variable ad_app_icon
[        ]   location: class id
[        ] C:\flutter-apps\gamerpower_app\gamerpower - Copy
(12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:48: error: cannot find symbol     
[        ]     adView.setPriceView(adView.findViewById(R.id.ad_price));
[        ]                                                 ^
[        ]   symbol:   variable ad_price
[        ]   location: class id
[        ] C:\flutter-apps\gamerpower_app\gamerpower - Copy
(12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:49: error: cannot find symbol     
[   +1 ms]     adView.setStarRatingView(adView.findViewById(R.id.ad_stars));
[        ]                                                      ^
[        ]   symbol:   variable ad_stars
[        ]   location: class id
[        ] C:\flutter-apps\gamerpower_app\gamerpower - Copy
(12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:50: error: cannot find symbol     
[        ]     adView.setStoreView(adView.findViewById(R.id.ad_store));
[        ]                                                 ^
[        ]   symbol:   variable ad_store
[        ]   location: class id
[        ] C:\flutter-apps\gamerpower_app\gamerpower - Copy
(12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:51: error: cannot find symbol     
[        ]     adView.setAdvertiserView(adView.findViewById(R.id.ad_advertiser));
[   +1 ms]                                                      ^
[        ]   symbol:   variable ad_advertiser
[        ]   location: class id
[        ] 10 errors
[  +26 ms] FAILURE: Build failed with an exception.
[        ] * What went wrong:
[        ] Execution failed for task ':app:compileDebugJavaWithJavac'.
[   +1 ms] > Compilation failed; see the compiler error output for details.
[        ] * Try:
[        ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more   
log output. Run with --scan to get full insights.
[        ] * Get more help at https://help.gradle.org
[        ] BUILD FAILED in 6s
[        ] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[        ] Use '--warning-mode all' to show the individual deprecation warnings.
[        ] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings      
[        ] 90 actionable tasks: 5 executed, 85 up-to-date
[ +534 ms] Running Gradle task 'assembleDebug'... (completed in 7.1s)
[+2710 ms] Exception: Gradle task assembleDebug failed with exit code 1
[   +1 ms] "flutter run" took 10,749ms.
[   +3 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1161:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)      
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure>
           (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
           <asynchronous suspension>
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)      
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:94:3)
           <asynchronous suspension>
Logs ``` [ +55 ms] executing: [C:\src\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H [ +61 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H [ ] 5464c5bac742001448fe4fc0597be939379f88ea [ ] executing: [C:\src\flutter/] git tag --points-at 5464c5bac742001448fe4fc0597be939379f88ea [ +49 ms] Exit code 0 from: git tag --points-at 5464c5bac742001448fe4fc0597be939379f88ea [ ] 2.10.5 [ +7 ms] executing: [C:\src\flutter/] git rev-parse --abbrev-ref --symbolic @{u} [ +38 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} [ ] origin/stable [ ] executing: [C:\src\flutter/] git ls-remote --get-url origin [ +36 ms] Exit code 0 from: git ls-remote --get-url origin [ ] https://github.com/flutter/flutter.git [ +105 ms] executing: [C:\src\flutter/] git rev-parse --abbrev-ref HEAD [ +41 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD [ ] stable [ +65 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ +6 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +54 ms] executing: C:\Users\justpaulo\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l [ +42 ms] List of devices attached emulator-5554 device product:sdk_gphone_x86 model:sdk_gphone_x86 device:generic_x86_arm transport_id:8 [ +8 ms] C:\Users\justpaulo\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell getprop [ +46 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ +7 ms] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +114 ms] Skipping pub get: version match. [ +33 ms] Found plugin google_mobile_ads at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\google_mobile_ads-1.2.0\ [ +12 ms] Found plugin path_provider at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-2.0.9\ [ +1 ms] Found plugin path_provider_android at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_android-2.0.12\ [ +2 ms] Found plugin path_provider_ios at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_ios-2.0.8\ [ +2 ms] Found plugin path_provider_linux at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_linux-2.1.5\ [ +2 ms] Found plugin path_provider_macos at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_macos-2.0.5\ [ +4 ms] Found plugin path_provider_windows at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_windows-2.0.5\ [ +9 ms] Found plugin shared_preferences at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-2.0.13\ [ +1 ms] Found plugin shared_preferences_android at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_android-2.0.11\ [ +2 ms] Found plugin shared_preferences_ios at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_ios-2.1.0\ [ +2 ms] Found plugin shared_preferences_linux at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_linux-2.1.0\ [ +2 ms] Found plugin shared_preferences_macos at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_macos-2.0.3\ [ +2 ms] Found plugin shared_preferences_web at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_web-2.0.3\ [ +2 ms] Found plugin shared_preferences_windows at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_windows-2.1.0\ [ +2 ms] Found plugin sqflite at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\sqflite-2.0.2\ [ +8 ms] Found plugin url_launcher at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-6.0.20\ [ +1 ms] Found plugin url_launcher_android at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_android-6.0.15\ [ +1 ms] Found plugin url_launcher_ios at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_ios-6.0.15\ [ +1 ms] Found plugin url_launcher_linux at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_linux-3.0.0\ [ +2 ms] Found plugin url_launcher_macos at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_macos-3.0.0\ [ +2 ms] Found plugin url_launcher_web at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_web-2.0.9\ [ +1 ms] Found plugin url_launcher_windows at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_windows-3.0.0\ [ +41 ms] Found plugin google_mobile_ads at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\google_mobile_ads-1.2.0\ [ +8 ms] Found plugin path_provider at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-2.0.9\ [ +1 ms] Found plugin path_provider_android at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_android-2.0.12\ [ +2 ms] Found plugin path_provider_ios at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_ios-2.0.8\ [ +1 ms] Found plugin path_provider_linux at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_linux-2.1.5\ [ +1 ms] Found plugin path_provider_macos at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_macos-2.0.5\ [ +2 ms] Found plugin path_provider_windows at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_windows-2.0.5\ [ +6 ms] Found plugin shared_preferences at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-2.0.13\ [ +2 ms] Found plugin shared_preferences_android at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_android-2.0.11\ [ +1 ms] Found plugin shared_preferences_ios at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_ios-2.1.0\ [ +1 ms] Found plugin shared_preferences_linux at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_linux-2.1.0\ [ +1 ms] Found plugin shared_preferences_macos at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_macos-2.0.3\ [ +2 ms] Found plugin shared_preferences_web at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_web-2.0.3\ [ +1 ms] Found plugin shared_preferences_windows at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_windows-2.1.0\ [ +2 ms] Found plugin sqflite at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\sqflite-2.0.2\ [ +6 ms] Found plugin url_launcher at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-6.0.20\ [ +1 ms] Found plugin url_launcher_android at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_android-6.0.15\ [ +1 ms] Found plugin url_launcher_ios at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_ios-6.0.15\ [ +1 ms] Found plugin url_launcher_linux at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_linux-3.0.0\ [ +2 ms] Found plugin url_launcher_macos at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_macos-3.0.0\ [ +2 ms] Found plugin url_launcher_web at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_web-2.0.9\ [ +1 ms] Found plugin url_launcher_windows at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_windows-3.0.0\ [ +12 ms] Generating C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java [ +62 ms] ro.hardware = ranchu [ +14 ms] Using hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering". [ +24 ms] Initializing file store [ +15 ms] Skipping target: gen_localizations [ +5 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputshave updated contents: C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\.dart_tool\package_config_subset,C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\.dart_tool\flutter_build\generated_main.dart} [ +19 ms] Found plugin google_mobile_ads at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\google_mobile_ads-1.2.0\ [ +8 ms] Found plugin path_provider at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-2.0.9\ [ +1 ms] Found plugin path_provider_android at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_android-2.0.12\ [ +1 ms] Found plugin path_provider_ios at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_ios-2.0.8\ [ +1 ms] Found plugin path_provider_linux at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_linux-2.1.5\ [ +1 ms] Found plugin path_provider_macos at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_macos-2.0.5\ [ +2 ms] Found plugin path_provider_windows at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_windows-2.0.5\ [ +3 ms] Found plugin shared_preferences at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-2.0.13\ [ +1 ms] Found plugin shared_preferences_android at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_android-2.0.11\ [ +2 ms] Found plugin shared_preferences_ios at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_ios-2.1.0\ [ +1 ms] Found plugin shared_preferences_linux at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_linux-2.1.0\ [ +1 ms] Found plugin shared_preferences_macos at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_macos-2.0.3\ [ +1 ms] Found plugin shared_preferences_web at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_web-2.0.3\ [ +1 ms] Found plugin shared_preferences_windows at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_windows-2.1.0\ [ +2 ms] Found plugin sqflite at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\sqflite-2.0.2\ [ +5 ms] Found plugin url_launcher at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-6.0.20\ [ +1 ms] Found plugin url_launcher_android at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_android-6.0.15\ [ +1 ms] Found plugin url_launcher_ios at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_ios-6.0.15\ [ +2 ms] Found plugin url_launcher_linux at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_linux-3.0.0\ [ +1 ms] Found plugin url_launcher_macos at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_macos-3.0.0\ [ +3 ms] Found plugin url_launcher_web at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_web-2.0.9\ [ +2 ms] Found plugin url_launcher_windows at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_windows-3.0.0\ [ +10 ms] gen_dart_plugin_registrant: Complete [ +2 ms] Skipping target: _composite [ +2 ms] complete [ +5 ms] Launching lib\main.dart on sdk gphone x86 in debug mode... [ +5 ms] C:\src\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev C:\src\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root C:\src\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter --debugger-module-names --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill C:\Users\JUSTPA~1\AppData\Local\Temp\flutter_tools.e0c200ea\flutter_tool.fdb9f58d\app.dill --packages C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\.dart_tool\package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts --track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill build\c075001b96339384a97db4862b8ab8db.cache.dill.track.dill --enable-experiment=alternative-invalidation-strategy [ +12 ms] executing: C:\Users\justpaulo\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell-x logcat -v time -t 1 [ +14 ms] <- compile file:///C:/flutter-apps/gamerpower_app/gamerpower%20-%20Copy%20(12-error)/.dart_tool/flutter_build/generated_main.dart [ +41 ms] --------- beginning of main 05-19 20:58:50.159 E/wifi_forwarder( 468): RemoteConnection failed to initialize: RemoteConnection failed to open pipe [ +29 ms] executing: C:\Users\justpaulo\AppData\Local\Android\sdk\platform-tools\adb.exe version [ +22 ms] Android Debug Bridge version 1.0.41 Version 31.0.3-7562133 Installed as C:\Users\justpaulo\AppData\Local\Android\sdk\platform-tools\adb.exe [ +2 ms] executing: C:\Users\justpaulo\AppData\Local\Android\sdk\platform-tools\adb.exe start-server [ +22 ms] Building APK [ +15 ms] Running Gradle task 'assembleDebug'... [ +4 ms] Using gradle from C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\gradlew.bat. [ +13 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version [ +123 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version [ +1 ms] openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822) OpenJDK 64-Bit Server VM (build 11.0.11+9-b60-7590822, mixed mode) [ +2 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version [ +108 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version [ ] openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822) OpenJDK 64-Bit Server VM (build 11.0.11+9-b60-7590822, mixed mode) [ +1 ms] executing: [C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android/] C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\gradlew.bat -Pverbose=true -Ptarget-platform=android-x86 -Ptarget=C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\lib\main.dart-Pbase-application-name=android.app.Application -Pdart-defines=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ== -Pdart-obfuscation=false -Ptrack-widget-creation=true -Ptree-shake-icons=false -Pfilesystem-scheme=org-dartlang-root assembleDebug [+1446 ms] Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 [ +2 ms] Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 [ ] Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 [ ] Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 [ +1 ms] Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 [+2078 ms] > Task :app:compileFlutterBuildDebug [ +1 ms] [ +55 ms] executing: [C:\src\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H [ ] [ +63 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H [ ] [ ] 5464c5bac742001448fe4fc0597be939379f88ea [ ] [ ] executing: [C:\src\flutter/] git tag --points-at 5464c5bac742001448fe4fc0597be939379f88ea [ ] [ +52 ms] Exit code 0 from: git tag --points-at 5464c5bac742001448fe4fc0597be939379f88ea [ ] [ ] 2.10.5 [ ] [ +6 ms] executing: [C:\src\flutter/] git rev-parse --abbrev-ref --symbolic @{u} [ ] [ +43 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} [ ] [ ] origin/stable [ ] [ ] executing: [C:\src\flutter/] git ls-remote --get-url origin [ ] [ +35 ms] Exit code 0 from: git ls-remote --get-url origin [ ] [ ] https://github.com/flutter/flutter.git [ ] [ +49 ms] executing: [C:\src\flutter/] git rev-parse --abbrev-ref HEAD [ +1 ms] [ +41 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD [ ] [ ] stable [ ] [ +62 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ ] [ +5 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ ] [ +103 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update. [ ] [ ] Artifact Instance of 'GradleWrapper' is not required, skipping update. [ ] [ +4 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterSdk' is not required, skipping update. [ ] [ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'PubDependencies' is not required, skipping update. [ ] [ +77 ms] Initializing file store [ ] [ +15 ms] Done initializing file store [ ] [ +47 ms] Skipping target: gen_localizations [ ] [ +12 ms] Skipping target: gen_dart_plugin_registrant [ ] [ +677 ms] Skipping target: kernel_snapshot [ ] [ +9 ms] invalidated build due to missing files: C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\DOES_NOT_EXIST_RERUN_FOR_WILDCARD714662207 [ +269 ms] [ +324 ms] debug_android_application: Starting due to {InvalidatedReasonKind.inputMissing: The following inputs were missing: C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\DOES_NOT_EXIST_RERUN_FOR_WILDCARD714662207} [ +206 ms] [ +205 ms] Manifest contained wildcard assets. Inserting missing file into build graph to force rerun. for more information see #56466. [ +303 ms] [ +242 ms] debug_android_application: Complete [ +192 ms] [ +262 ms] Persisting file store [ +1 ms] [ +9 ms] Done persisting file store [ ] [ +6 ms] build succeeded. [ ] [ +15 ms] "flutter assemble" took 2,039ms. [ +93 ms] [ +8 ms] ensureAnalyticsSent: 4ms [ +1 ms] [ ] Running shutdown hooks [ ] [ ] Shutdown hooks complete [ ] [ +1 ms] exiting with code 0 [ ] Parameter format not correct - [ ] > Task :app:packLibsflutterBuildDebug UP-TO-DATE [ ] > Task :app:preBuild UP-TO-DATE [ ] > Task :app:preDebugBuild UP-TO-DATE [ ] > Task :google_mobile_ads:preBuild UP-TO-DATE [ ] > Task :google_mobile_ads:preDebugBuild UP-TO-DATE [ ] > Task :google_mobile_ads:compileDebugAidl NO-SOURCE [ ] > Task :path_provider_android:preBuild UP-TO-DATE [ ] > Task :path_provider_android:preDebugBuild UP-TO-DATE [ ] > Task :path_provider_android:compileDebugAidl NO-SOURCE [ ] > Task :shared_preferences_android:preBuild UP-TO-DATE [ ] > Task :shared_preferences_android:preDebugBuild UP-TO-DATE [ ] > Task :shared_preferences_android:compileDebugAidl NO-SOURCE [ ] > Task :sqflite:preBuild UP-TO-DATE [ ] > Task :sqflite:preDebugBuild UP-TO-DATE [ ] > Task :sqflite:compileDebugAidl NO-SOURCE [ ] > Task :url_launcher_android:preBuild UP-TO-DATE [ ] > Task :url_launcher_android:preDebugBuild UP-TO-DATE [ +96 ms] > Task :url_launcher_android:compileDebugAidl NO-SOURCE [ ] > Task :app:compileDebugAidl NO-SOURCE [ ] > Task :google_mobile_ads:packageDebugRenderscript NO-SOURCE [ ] > Task :path_provider_android:packageDebugRenderscript NO-SOURCE [ ] > Task :shared_preferences_android:packageDebugRenderscript NO-SOURCE [ ] > Task :sqflite:packageDebugRenderscript NO-SOURCE [ ] > Task :url_launcher_android:packageDebugRenderscript NO-SOURCE [ ] > Task :app:compileDebugRenderscript NO-SOURCE [ ] > Task :app:generateDebugBuildConfig UP-TO-DATE [ ] > Task :google_mobile_ads:writeDebugAarMetadata UP-TO-DATE [ ] > Task :path_provider_android:writeDebugAarMetadata UP-TO-DATE [ ] > Task :shared_preferences_android:writeDebugAarMetadata UP-TO-DATE [ ] > Task :sqflite:writeDebugAarMetadata UP-TO-DATE [ ] > Task :url_launcher_android:writeDebugAarMetadata UP-TO-DATE [ ] > Task :app:checkDebugAarMetadata UP-TO-DATE [ +87 ms] > Task :app:cleanMergeDebugAssets [ ] > Task :app:mergeDebugShaders UP-TO-DATE [ ] > Task :app:compileDebugShaders NO-SOURCE [ ] > Task :app:generateDebugAssets UP-TO-DATE [ ] > Task :google_mobile_ads:mergeDebugShaders UP-TO-DATE [ ] > Task :google_mobile_ads:compileDebugShaders NO-SOURCE [ ] > Task :google_mobile_ads:generateDebugAssets UP-TO-DATE [ ] > Task :google_mobile_ads:packageDebugAssets UP-TO-DATE [ ] > Task :path_provider_android:mergeDebugShaders UP-TO-DATE [ ] > Task :path_provider_android:compileDebugShaders NO-SOURCE [ ] > Task :path_provider_android:generateDebugAssets UP-TO-DATE [ ] > Task :path_provider_android:packageDebugAssets UP-TO-DATE [ ] > Task :shared_preferences_android:mergeDebugShaders UP-TO-DATE [ ] > Task :shared_preferences_android:compileDebugShaders NO-SOURCE [ ] > Task :shared_preferences_android:generateDebugAssets UP-TO-DATE [ ] > Task :shared_preferences_android:packageDebugAssets UP-TO-DATE [ ] > Task :sqflite:mergeDebugShaders UP-TO-DATE [ ] > Task :sqflite:compileDebugShaders NO-SOURCE [ ] > Task :sqflite:generateDebugAssets UP-TO-DATE [ ] > Task :sqflite:packageDebugAssets UP-TO-DATE [ ] > Task :url_launcher_android:mergeDebugShaders UP-TO-DATE [ ] > Task :url_launcher_android:compileDebugShaders NO-SOURCE [ ] > Task :url_launcher_android:generateDebugAssets UP-TO-DATE [ ] > Task :url_launcher_android:packageDebugAssets UP-TO-DATE [ ] > Task :app:mergeDebugAssets [ +481 ms] > Task :app:copyFlutterAssetsDebug [ ] > Task :app:generateDebugResValues UP-TO-DATE [ ] > Task :app:generateDebugResources UP-TO-DATE [ ] > Task :app:processDebugGoogleServices UP-TO-DATE [ ] > Task :google_mobile_ads:compileDebugRenderscript NO-SOURCE [ ] > Task :google_mobile_ads:generateDebugResValues UP-TO-DATE [ ] > Task :google_mobile_ads:generateDebugResources UP-TO-DATE [ ] > Task :google_mobile_ads:packageDebugResources UP-TO-DATE [ ] > Task :path_provider_android:compileDebugRenderscript NO-SOURCE [ ] > Task :path_provider_android:generateDebugResValues UP-TO-DATE [ ] > Task :path_provider_android:generateDebugResources UP-TO-DATE [ ] > Task :path_provider_android:packageDebugResources UP-TO-DATE [ ] > Task :shared_preferences_android:compileDebugRenderscript NO-SOURCE [ ] > Task :shared_preferences_android:generateDebugResValues UP-TO-DATE [ ] > Task :shared_preferences_android:generateDebugResources UP-TO-DATE [ ] > Task :shared_preferences_android:packageDebugResources UP-TO-DATE [ ] > Task :sqflite:compileDebugRenderscript NO-SOURCE [ ] > Task :sqflite:generateDebugResValues UP-TO-DATE [ ] > Task :sqflite:generateDebugResources UP-TO-DATE [ ] > Task :sqflite:packageDebugResources UP-TO-DATE [ ] > Task :url_launcher_android:compileDebugRenderscript NO-SOURCE [ ] > Task :url_launcher_android:generateDebugResValues UP-TO-DATE [ ] > Task :url_launcher_android:generateDebugResources UP-TO-DATE [ ] > Task :url_launcher_android:packageDebugResources UP-TO-DATE [ ] > Task :app:mergeDebugResources UP-TO-DATE [ ] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE [ ] > Task :app:extractDeepLinksDebug UP-TO-DATE [ ] > Task :google_mobile_ads:extractDeepLinksDebug UP-TO-DATE [ ] > Task :google_mobile_ads:processDebugManifest UP-TO-DATE [ ] > Task :path_provider_android:extractDeepLinksDebug UP-TO-DATE [ ] > Task :path_provider_android:processDebugManifest UP-TO-DATE [ ] > Task :shared_preferences_android:extractDeepLinksDebug UP-TO-DATE [ ] > Task :shared_preferences_android:processDebugManifest UP-TO-DATE [ ] > Task :sqflite:extractDeepLinksDebug UP-TO-DATE [ ] > Task :sqflite:processDebugManifest UP-TO-DATE [ ] > Task :url_launcher_android:extractDeepLinksDebug UP-TO-DATE [ +88 ms] > Task :url_launcher_android:processDebugManifest UP-TO-DATE [ +1 ms] > Task :app:processDebugMainManifest UP-TO-DATE [ ] > Task :app:processDebugManifest UP-TO-DATE [ ] > Task :app:processDebugManifestForPackage UP-TO-DATE [ ] > Task :google_mobile_ads:compileDebugLibraryResources UP-TO-DATE [ ] > Task :google_mobile_ads:parseDebugLocalResources UP-TO-DATE [ ] > Task :google_mobile_ads:generateDebugRFile UP-TO-DATE [ ] > Task :path_provider_android:compileDebugLibraryResources UP-TO-DATE [ ] > Task :path_provider_android:parseDebugLocalResources UP-TO-DATE [ ] > Task :path_provider_android:generateDebugRFile UP-TO-DATE [ ] > Task :shared_preferences_android:compileDebugLibraryResources UP-TO-DATE [ ] > Task :shared_preferences_android:parseDebugLocalResources UP-TO-DATE [ ] > Task :shared_preferences_android:generateDebugRFile UP-TO-DATE [ ] > Task :sqflite:compileDebugLibraryResources UP-TO-DATE [ ] > Task :sqflite:parseDebugLocalResources UP-TO-DATE [ +83 ms] > Task :sqflite:generateDebugRFile UP-TO-DATE [ ] > Task :url_launcher_android:compileDebugLibraryResources UP-TO-DATE [ ] > Task :url_launcher_android:parseDebugLocalResources UP-TO-DATE [ ] > Task :url_launcher_android:generateDebugRFile UP-TO-DATE [ ] > Task :app:processDebugResources UP-TO-DATE [ ] > Task :google_mobile_ads:generateDebugBuildConfig UP-TO-DATE [ ] > Task :google_mobile_ads:javaPreCompileDebug UP-TO-DATE [ ] > Task :google_mobile_ads:compileDebugJavaWithJavac UP-TO-DATE [ ] > Task :google_mobile_ads:bundleLibCompileToJarDebug UP-TO-DATE [ ] > Task :path_provider_android:generateDebugBuildConfig UP-TO-DATE [ ] > Task :path_provider_android:javaPreCompileDebug UP-TO-DATE [ +89 ms] > Task :path_provider_android:compileDebugJavaWithJavac UP-TO-DATE [ +1 ms] > Task :path_provider_android:bundleLibCompileToJarDebug UP-TO-DATE [ ] > Task :shared_preferences_android:generateDebugBuildConfig UP-TO-DATE [ ] > Task :shared_preferences_android:javaPreCompileDebug UP-TO-DATE [ ] > Task :shared_preferences_android:compileDebugJavaWithJavac UP-TO-DATE [ ] > Task :shared_preferences_android:bundleLibCompileToJarDebug UP-TO-DATE [ ] > Task :sqflite:generateDebugBuildConfig UP-TO-DATE [ ] > Task :sqflite:javaPreCompileDebug UP-TO-DATE [ ] > Task :sqflite:compileDebugJavaWithJavac UP-TO-DATE [ ] > Task :sqflite:bundleLibCompileToJarDebug UP-TO-DATE [ ] > Task :url_launcher_android:generateDebugBuildConfig UP-TO-DATE [ ] > Task :url_launcher_android:javaPreCompileDebug UP-TO-DATE [ ] > Task :url_launcher_android:compileDebugJavaWithJavac UP-TO-DATE [ ] > Task :url_launcher_android:bundleLibCompileToJarDebug UP-TO-DATE [ ] > Task :app:compileDebugKotlin UP-TO-DATE [ ] > Task :app:javaPreCompileDebug UP-TO-DATE [ +386 ms] > Task :app:compileDebugJavaWithJavac FAILED [ +1 ms] C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:38: error: cannot find symbol [ +1 ms] final NativeAdView adView = (NativeAdView) layoutInflater.inflate(R.layout.my_native_ad, null); [ ] ^ [ ] symbol: variable my_native_ad [ ] location: class layout [ ] C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:41: error: cannot find symbol [ ] adView.setMediaView((MediaView) adView.findViewById(R.id.ad_media)); [ ] ^ [ ] symbol: variable ad_media [ ] location: class id [ ] C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:44: error: cannot find symbol [ +1 ms] adView.setHeadlineView(adView.findViewById(R.id.ad_headline)); [ ] ^ [ ] symbol: variable ad_headline [ ] location: class id [ +1 ms] C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:45: error: cannot find symbol [ +1 ms] adView.setBodyView(adView.findViewById(R.id.ad_body)); [ +1 ms] ^ [ ] symbol: variable ad_body [ ] location: class id [ ] C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:46: error: cannot find symbol [ +1 ms] adView.setCallToActionView(adView.findViewById(R.id.ad_call_to_action)); [ ] ^ [ ] symbol: variable ad_call_to_action [ ] location: class id [ ] C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:47: error: cannot find symbol [ ] adView.setIconView(adView.findViewById(R.id.ad_app_icon)); [ ] ^ [ ] symbol: variable ad_app_icon [ ] location: class id [ ] C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:48: error: cannot find symbol [ ] adView.setPriceView(adView.findViewById(R.id.ad_price)); [ ] ^ [ ] symbol: variable ad_price [ ] location: class id [ ] C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:49: error: cannot find symbol [ ] adView.setStarRatingView(adView.findViewById(R.id.ad_stars)); [ ] ^ [ ] symbol: variable ad_stars [ ] location: class id [ ] C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:50: error: cannot find symbol [ +1 ms] adView.setStoreView(adView.findViewById(R.id.ad_store)); [ ] ^ [ ] symbol: variable ad_store [ ] location: class id [ ] C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:51: error: cannot find symbol [ ] adView.setAdvertiserView(adView.findViewById(R.id.ad_advertiser)); [ ] ^ [ ] symbol: variable ad_advertiser [ ] location: class id [ ] 10 errors [ ] FAILURE: Build failed with an exception. [ ] * What went wrong: [ ] Execution failed for task ':app:compileDebugJavaWithJavac'. [ ] > Compilation failed; see the compiler error output for details. [ ] * Try: [ ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. [ ] * Get more help at https://help.gradle.org [ ] BUILD FAILED in 5s [ ] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. [ ] Use '--warning-mode all' to show the individual deprecation warnings. [ ] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings [ ] 90 actionable tasks: 5 executed, 85 up-to-date [ +527 ms] Running Gradle task 'assembleDebug'... (completed in 6.9s) [+2930 ms] Exception: Gradle task assembleDebug failed with exit code 1 [ +1 ms] "flutter run" took 10,712ms. [ +3 ms] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3) #1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:687:9) #2 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1161:27) #3 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #4 CommandRunner.runCommand (package:args/command_runner.dart:209:13) #5 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9) #6 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5) #8 run.. (package:flutter_tools/runner.dart:62:9) #9 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #10 main (package:flutter_tools/executable.dart:94:3) [ +8 ms] ensureAnalyticsSent: 2ms [ +1 ms] Running shutdown hooks [ ] Shutdown hooks complete [ ] exiting with code 1 ``` ``` warning - The include file 'package:flutter_lints/flutter.yaml' in 'C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\analysis_options.yaml' can't be found when analyzing 'C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)' - analysis_options.yaml:10:10 - include_file_not_found info - Unused import: '../models/http_exception.dart' - lib\providers\explore_provider.dart:5:8 - unused_import info - Unused import: '../models/http_exception.dart' - lib\providers\giveaways_provider.dart:5:8 - unused_import info - Unused import: '../models/http_exception.dart' - lib\providers\my_offers.dart:5:8 - unused_import info - Unused import: 'auth_provider.dart' - lib\providers\my_offers.dart:6:8 - unused_import info - Unused import: '../models/offer.dart' - lib\providers\my_stats.dart:2:8 - unused_import info - Unused import: '../models/http_exception.dart' - lib\providers\my_stats.dart:5:8 - unused_import info - Unused import: 'auth_provider.dart' - lib\providers\my_stats.dart:6:8 - unused_import info - Unused import: '../models/offer.dart' - lib\providers\search_delegate.dart:3:8 - unused_import info - Unused import: 'package:cached_network_image/cached_network_image.dart' - lib\providers\search_delegate.dart:8:8 - unused_import info - Unused import: '../models/http_exception.dart' - lib\providers\search_provider.dart:5:8 - unused_import info - Unused import: 'auth_provider.dart' - lib\providers\search_provider.dart:6:8 - unused_import info - Unused import: 'package:http/http.dart' - lib\screens\collection_screen.dart:4:8 - unused_import info - Unused import: '../widgets/badge.dart' - lib\screens\collection_screen.dart:6:8 - unused_import info - Unused import: 'package:font_awesome_flutter/font_awesome_flutter.dart' - lib\screens\collection_screen.dart:13:8 - unused_import info - Unused import: 'dart:developer' - lib\screens\details_screen.dart:7:8 - unused_import info - The value of the local variable 'rarity' isn't used - lib\screens\details_screen.dart:76:9 - unused_local_variable info - Unused import: 'package:http/http.dart' - lib\screens\explore_screen.dart:2:8 - unused_import info - Unused import: 'dart:convert' - lib\screens\explore_screen.dart:3:8 - unused_import info - Unused import: 'package:google_mobile_ads/google_mobile_ads.dart' - lib\screens\explore_screen.dart:4:8 - unused_import info - Unused import: '/ad_helper.dart' - lib\screens\explore_screen.dart:5:8 - unused_import info - Unused import: '../models/offer.dart' - lib\screens\explore_screen.dart:9:8 - unused_import info - Unused import: 'package:font_awesome_flutter/font_awesome_flutter.dart' - lib\screens\explore_screen.dart:11:8 - unused_import info - Unused import: '../widgets/trending_horizontal_slider.dart' - lib\screens\explore_screen.dart:14:8 - unused_import info - Unused import: '../widgets/banner_widget.dart' - lib\screens\explore_screen.dart:15:8 - unused_import info - The value of the local variable 'deviceSize' isn't used - lib\screens\explore_screen.dart:25:11 - unused_local_variable info - The parameter 'padding' is required - lib\screens\explore_screen.dart:752:41 - missing_required_param info - Unused import: 'package:http/http.dart' - lib\screens\giveaways_screen - Copy.dart:2:8 - unused_import info - Unused import: 'dart:convert' - lib\screens\giveaways_screen - Copy.dart:3:8 - unused_import info - Unused import: 'package:http/http.dart' - lib\screens\giveaways_screen.dart:2:8 - unused_import info - Unused import: 'dart:convert' - lib\screens\giveaways_screen.dart:3:8 - unused_import info - The declaration '_initGoogleMobileAds' isn't referenced - lib\screens\giveaways_screen.dart:24:32 - unused_element info - The declaration '_getDestinationItemIndex' isn't referenced - lib\screens\giveaways_screen.dart:57:7 - unused_element info - Unused import: 'test_screen.dart' - lib\screens\home_screen.dart:5:8 - unused_import info - Unused import: 'dart:math' - lib\screens\login_screen.dart:1:8 - unused_import info - The value of the field '_isLoading' isn't used - lib\screens\login_screen.dart:98:7 - unused_field info - The declaration '_switchAuthMode' isn't referenced - lib\screens\login_screen.dart:205:8 - unused_element info - This function has a return type of 'String', but doesn't end with a return statement - lib\screens\login_screen.dart:242:30 - missing_return info - This function has a return type of 'String', but doesn't end with a return statement - lib\screens\login_screen.dart:255:30 - missing_return info - This function has a return type of 'String', but doesn't end with a return statement - lib\screens\login_screen.dart:281:31 - missing_return info - Unused import: 'dart:math' - lib\screens\register_screen.dart:1:8 - unused_import info - The value of the field '_isLoading' isn't used - lib\screens\register_screen.dart:98:7 - unused_field info - The value of the field '_slideAnimation' isn't used - lib\screens\register_screen.dart:101:21 - unused_field info - The value of the field '_opacityAnimation' isn't used - lib\screens\register_screen.dart:102:21 - unused_field info - 'RaisedButton' is deprecated and shouldn't be used. Use ElevatedButton instead. See the migration guide in flutter.dev/go/material-button-migration-guide). This feature was deprecated after v1.26.0-18.0.pre. - lib\screens\register_screen.dart:144:11 - deprecated_member_use info - 'RaisedButton.RaisedButton' is deprecated and shouldn't be used. Use ElevatedButton instead. See the migration guide in flutter.dev/go/material-button-migration-guide). This feature was deprecated after v1.26.0-18.0.pre. - lib\screens\register_screen.dart:144:11 - deprecated_member_use info - The declaration '_switchAuthMode' isn't referenced - lib\screens\register_screen.dart:209:8 - unused_element info - 'accentColor' is deprecated and shouldn't be used. Use colorScheme.secondary instead. For more information, consult the migration guide at https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. This feature was deprecated after v2.3.0-0.1.pre. - lib\widgets\badge.dart:29:64 - deprecated_member_use info - The declaration '_initGoogleMobileAds' isn't referenced - lib\widgets\banner_widget.dart:15:32 - unused_element info - This method overrides a method annotated as '@mustCallSuper' in 'State', but doesn't invoke the overridden method - lib\widgets\banner_widget.dart:27:8 - must_call_super info - The value of the field '_getMoreData' isn't used - lib\widgets\trending_horizontal_slider.dart:17:8 - unused_field info - The parameter 'tag' is required - lib\widgets\trending_horizontal_slider.dart:88:20 - missing_required_param info - The parameter 'image' is required - lib\widgets\trending_horizontal_slider.dart:94:26 - missing_required_param 53 issues found. (ran in 2.5s) ``` ``` [√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.19044.1645], locale en-US) • Flutter version 2.10.5 at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 5464c5bac7 (4 weeks ago), 2022-04-18 09:55:37 -0700 • Engine revision 57d3bac3dd • Dart version 2.16.2 • DevTools version 2.9.2 [√] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at C:\Users\justpaulo\AppData\Local\Android\sdk • Platform android-31, build-tools 31.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe [X] Visual Studio - develop for Windows X Visual Studio not installed; this is necessary for Windows development. Download at https://visualstudio.microsoft.com/downloads/. Please install the "Desktop development with C++" workload, including all of its default components [√] Android Studio (version 2021.1) • Android Studio at C:\Program Files\Android\Android Studio • 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.11+9-b60-7590822) [√] VS Code (version 1.67.2) • VS Code at C:\Users\justpaulo\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.40.0 [√] Connected device (4 available) • sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.1645] • Chrome (web) • chrome • web-javascript • Google Chrome 101.0.4951.67 • Edge (web) • edge • web-javascript • Microsoft Edge 101.0.1210.47 [!] HTTP Host Availability X HTTP host https://maven.google.com/ is not reachable. Reason: An error occurred while checking the HTTP host: Failed host lookup: 'maven.google.com' X HTTP host https://pub.dev/ is not reachable. Reason: An error occurred while checking the HTTP host: Failed host lookup: 'pub.dev' X HTTP host https://cloud.google.com/ is not reachable. Reason: An error occurred while checking the HTTP host: Failed host lookup: 'cloud.google.com' ! Doctor found issues in 2 categories. ```
maheshj01 commented 2 years ago

Hi @ldobreira, Thanks for filing the issue. I directly ran the native ads example from the repo and it seems to work fine

~Could you please share the complete output of fluter run -v in a text file?~

[ +1 ms] C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:38: error: cannot find symbol
[ +1 ms] final NativeAdView adView = (NativeAdView) layoutInflater.inflate(R.layout.my_native_ad, null);
[ ] ^ [ ] symbol: variable my_native_ad [ ] location: class layout [ ] C:\flutter-apps\gamerpower_app\gamerpower - Copy (12-error)\android\app\src\main\java\com\app\gamerpower\adFactoryExample.java:41: error: cannot find symbol
[ ] adView.setMediaView((MediaView) adView.findViewById(R.id.ad_media));

Your logs seem to point errors in your code hence the build failure.

flutter doctor -v (mac) ``` [✓] Flutter (Channel stable, 3.0.0, on macOS 12.3 21E230 darwin-arm, locale en-IN) • Flutter version 3.0.0 at /Users/mahesh/Documents/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision ee4e09cce0 (6 days ago), 2022-05-09 16:45:18 -0700 • Engine revision d1b9a6938a • Dart version 2.17.0 • DevTools version 2.12.2 [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/mahesh/Library/Android/sdk • Platform android-32, build-tools 31.0.0 • ANDROID_HOME = /Users/mahesh/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763) • All Android licenses accepted. [!] Xcode - develop for iOS and macOS (Xcode 13.2.1) • Xcode at /Applications/Xcode.app/Contents/Developer ! CocoaPods 1.10.2 out of date (1.11.0 is recommended). CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.1) • 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.11+0-b60-7772763) [✓] IntelliJ IDEA Community Edition (version 2021.2.1) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 61.2.4 • Dart plugin version 212.5080.8 [✓] VS Code (version 1.66.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.40.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-arm64 • macOS 12.3 21E230 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 101.0.4951.64 [✓] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 1 category. ```
ldobreira commented 2 years ago

Hi @maheshmnj, unfortunately, the native ads example from the repo is giving me another error: "Build failed due to use of deprecated Android v1 embedding"...

And yes the "error: cannot find symbol" is the reason for the build failure, specifically the file adFactoryExample.java, however that file is a copy of the admob-inline-ads-in-flutter examples and Google Admob documentation, so I don't understand how I can fix the error...

ldobreira commented 2 years ago

@maheshmnj I was able to make the codelabs repo to work but I also found another interesting detail, that is maybe the real problem, the admob-inline-ads-in-flutter example from Codelabs is actually really different from the googleads-mobile-flutter examples and Google Admob documentation...

Just compare the ListTileNativeAdFactory.java (from Codelabs) with NativeAdFactoryExample.java (from googleads).

For some reason the Codelabs version seems to work better since I'm getting the "cannot find symbol" error because I'm trying to follow the official Google Admob documentation and examples...

ldobreira commented 2 years ago

Seems that this error is related with the NativeAdFactory file (eg: ListTileNativeAdFactory.java) and the layout at app/src/main/res/layout/list_title_native_ad.xml

This is how I fix it: I went to the Google Codelabs example at https://github.com/googlecodelabs/admob-inline-ads-in-flutter/tree/main/complete and just copied those 2 files exactly like the example. That solved the issue.

I believe using both Codelabs and the official Documentation was the cause for this issue since they are very different, anyone that tries to use and adapt both examples will probably replicate the issue.

maheshj01 commented 2 years ago

Thanks for the update @ldobreira, Glad you were able to fix the issue. Labeling this issue as a proposal to make the codelabs and the codelabs example in GitHub consistent.

huycozy commented 1 year ago

We’re closing this issue due to inactivity. If you’re still impacted, please create a new issue via the Developer Forum.