Open vacating opened 5 days ago
Hi @vacating, I tried to follow your steps using the BannerExample in the repo but was able to run the project just fine. Are you able to? I'm using a Pixel 4 API 34.
Have you tried invalidating the cache and restarting?
hi @malandr2 pls Bear in mind that solely running ./gradlew build throws mentioned error. i just now came across similar issue and solution over here
using pixel 4 api 29
but still after flutter run i get this the following error:
Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\Users\Pc\AppData\Local\Pub\Cache\hosted\pub.dev\google_mobile_ads-5.2.0\android\src\main\java\io\flutter\plugins\googlemobileads\AdMessageCodec.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.
i did that too "invalidating the cache and restarting" but still the same issue after flutter run:
looking at my current set ups the only major issues are with transitive packages where i have no idea how the am going to solve that, would that cuz the issue?
Hi @vacating, glad to see you found a viable solution.
For the warning you've mentioned, it's just a deprecation warning. The google_mobile_ads plugin is referencing code that's now deprecated. There's nothing you need to do on your end. This will be resolved in a future release.
Hello @malandr2 Thank you for clarifying the deprecation.
However, I have a question regarding transitive packages. It might not be the right place to ask about other packages, but in your view, how should I approach fixing these transitive packages? I've been waiting for an update for two months. Should I take matters into my own hands and resolve them, or wait for an official update? I’d appreciate your input.
kind regard.
Hi @vacating, it depends on the package and the impact it has on your app. There might be a reason the package hasn't updated it's immediate dependency yet due to incompatibility reasons. But if you must manually update, proceed with caution when doing so. I would also recommend reaching out to the owner of that package
hello @malandr2
one of the issue that is being caused is from google_mobile_ads 5.2.0
dependencies:
flutter:
sdk: flutter
google_mobile_ads: ^5.2.0
webview_flutter_android: ^4.0.0
> `Because google_mobile_ads 5.2.0 depends on webview_flutter_android ^3.15.0 and no versions of google_mobile_ads match >5.2.0 <6.0.0, google_mobile_ads ^5.2.0 requires webview_flutter_android ^3.15.0. So, because EXAMPLEAPP depends on both google_mobile_ads ^5.2.0 and webview_flutter_android ^4.0.0, version solving failed.
Hi @vacating, got it. You can manually update but proceed with caution when doing so. We will take a look at updating that immediate dependency in a future release.
The issue arises when using the google_mobileads. During the build process, a layout file (gnt medium_template_view.xml) references the androidx.appcompat.widget.AppCompatButton class. However, this class is not found in the project or the libraries, resulting in the error: i didnt use any layout in native side what so ever. am using pure dart.
@malandr2
[REQUIRED] Step 1: Describe your environment
Flutter (Channel stable, 3.24.3, locale en-US) • Flutter version 3.24.3 on channel stable • Framework revision 2663184aa7 (5 weeks ago), 2024-09-11 • Engine revision 36335019a8 • Dart version 3.5.3 • DevTools version 2.37.3
Plugin Version
google_mobile_ads: ^5.2.0
[REQUIRED] Step 2: Describe the problem
after running build the ./gradlew build i get the error following error:
Error: Class referenced in the layout file, androidx.appcompat.widget.AppCompatButton, was not found in the project or the libraries [MissingClass]
C:\Users\Pc\AppData\Local\Pub\Cache\hosted\pub.dev\google_mobile_ads-5.2.0\android\src\main\res\layout\gnt_medium_template_view.xml:207: Error: Class referenced in the layout file, androidx.appcompat.widget.AppCompatButton, was not found in the project or the libraries [MissingClass] <androidx.appcompat.widget.AppCompatButton ^
note:
Analyzing the Dependency Tree:
probability:
Multiple versions of androidx.appcompat:appcompat are being referenced, specifically version 1.7.0 and 1.2.0.
`+--- androidx.appcompat:appcompat:1.2.0 -> 1.7.0
Some dependencies might be bringing in older or conflicting versions of appcompat.
The google_mobile_ads plugin is using a layout file (gnt_medium_template_view.xml) that references AppCompatButton.
second topper issue:
Task :google_mobile_ads:processDebugManifest package="io.flutter.plugins.googlemobileads" found in source AndroidManifest.xml: C:\Users\Pc\AppData\Local\Pub\Cache\hosted\pub.dev\google_mobile_ads-5.2.0\android\src\main\AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported, and the value is ignored. Recommendation: remove package="io.flutter.plugins.googlemobileads" from the source AndroidManifest.xml: C:\Pc\AppData\Local\Pub\Cache\hosted\pub.dev\google_mobile_ads-5.2.0\android\src\main\AndroidManifest.xml.
when i do flutter run i get this:
Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\Users\Pc\AppData\Local\Pub\Cache\hosted\pub.dev\google_mobile_ads-5.2.0\android\src\main\java\io\flutter\plugins\googlemobileads\AdMessageCodec.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.
`
Steps to Reproduce
Add google_mobile_ads package to your Flutter project:
Ensure that you have the google_mobile_ads version 5.2.0 in your pubspec.yaml file under dependencies.
Run flutter pub get to install the dependencies.
Set up Android dependencies:
Verify that your project includes the necessary Android dependencies like androidx.appcompat:appcompat.
Create or build your Flutter project:
Run flutter build to compile the project.
Encounter the Error:
The error should occur during the build process, where you will see the message related to the missing class:
Error: Class referenced in the layout file, androidx.appcompat.widget.AppCompatButton, was not found in the project or the libraries [MissingClass]
Check the gnt_medium_template_view.xml:
The error originates from a layout file within the google_mobile_ads package, referencing AppCompatButton, which is missing from the dependencies.
Run
./gradlew clean build
.Expected results: The project should build successfully without any missing class errors Actual results: Error: Class referenced in the layout file, androidx.appcompat.widget.AppCompatButton, was not found in the project or the libraries [MissingClass]
Logs
C:\Users\Pc\AppData\Local\Pub\Cache\hosted\pub.dev\google_mobile_ads-5.2.0\android\src\main\res\layout\gnt_medium_template_view.xml:207: Error: Class referenced in the layout file, androidx.appcompat.widget.AppCompatButton, was not found in the project or the libraries [MissingClass]