Closed Flash0509 closed 1 year ago
Hi @Flash0509
Sorry to hear about your issue.
1) Do you use flutter_fgbg
in your project ?
2) Have you tried doing:
flutter pub get
flutter clean
flutter run
3) At what moment do you have this error ?
Hi Gautier, thanks for your anwer.
1) Actually, I didn't use flutter_fgbg in my project. But alarm 1.2.1. installed it as an dependency as version 0.2.2.
2) Thousand times
3) When I try flutter run
Thanks for the answer @Flash0509,
I'll try to publish a fix as soon as possible.
In the meantime, please make sure you:
README
AndroidManifest.xml
is consistent with the applicationId
in the app/build.gradle
file. They should be unique and consistent across your appflutter_fgbg
to version 0.3.0
in your pubspec.lock
alarm
right now, try downgrading the version in your project until you reach a version that worksLet me know if it helps. Otherwise, stay tuned and I'll release a fix next week.
- b thanks for your new respond.
1) Where can I find the README? 2) It is checked, but unfortunaltley the gradle project sync failed with the error:' Task 'wrapper' not found in project ':app'." 3) I tried this and started the command Flutter run, but The error message (duplicate class) is still the same.
I have some more issues when I activate the alarm related code parts in my app:
final` alarmSettings = AlarmSettings(
id:42,
dateTime: scheduledTime,
assetAudioPath: 'assets/audio/alarm.mp3',
loopAudio: true,
vibrate: true,
volumeMax: true,
fadeDuration: 3.0,
notificationTitle: 'Tabletten Erinnerung',
notificationBody: 'Einnahmezeit für Fach ' + nextCompartmentNumber.toString() +
' erreicht. Bitte einnehmen!',
enableNotificationOnKill: false,
stopOnNotificationOpen: false);
await Alarm.set(settings: alarmSettings);
Alarm.ringStream.stream.listen((_) => checkNextCompartmentTime());
the error message appears, when I started flutter run. The app didn't start.
lib/main.dart:716:23: Error: No named parameter with the name 'settings'.
await Alarm.set(settings: alarmSettings);
^^^^^^^^
/C:/Users/gordo/AppData/Local/Pub/Cache/hosted/pub.dev/alarm-1.2.1/lib/alarm.dart:69:23: Context: Found this candidate, but the arguments don't match.
static Future
FAILURE: Build failed with an exception.
I'm sorry I made a mistake in the README.
Alarm.set
parameter name is alarmSettings
instead of settings
.
Try like this:
await Alarm.set(alarmSettings: alarmSettings);
Okay, code errors are gone, perfect! But of course the duplicate classes issue still exists. I am patiently waiting for your solution next week.
Hello Gautier,
any news concerning my issue?
Thanks in advance.
Kind regards,
Gordon Klein
smarTaBox GmbH | Franz-Liszt-Str. 87 | 14624 Dallgow-Döberitz
Telefon: 0172/3128877
@. @.>
www.smartabox.de http://www.smartabox.de
Von: Gautier de Lataillade @.> Gesendet: Mittwoch, 16. August 2023 23:33 An: gdelataillade/alarm @.> Cc: Flash0509 @.>; Mention @.> Betreff: Re: [gdelataillade/alarm] duplicate class errors with the alarm plugin and Flutter_fgbg (Issue #79)
I'm sorry I made a mistake in the README.
Alarm.set parameter name is alarmSettings instead of settings.
Try like this:
await Alarm.set(alarmSettings: alarmSettings);
— Reply to this email directly, view it on GitHub https://github.com/gdelataillade/alarm/issues/79#issuecomment-1681298228 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BB5GOYHXC6SCGUOHCH5K5HTXVU37LANCNFSM6AAAAAA3RK2YCU . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BB5GOYANEZEZZH7XS64UVYTXVU37LA5CNFSM6AAAAAA3RK2YCWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTEG2JTI.gif Message ID: @. @.> >
Hi @Flash0509
I was never able to reproduce your error. It seems like you are the only one. That means the issue comes probably from your project.
I asked ChatGPT what to do in your case, here's his answer:
The error indicates that the BuildConfig class for your com.example.smartabox_app package is defined multiple times, typically resulting from conflicting dependencies or plugins in a Flutter project.
From your details, it's evident that both your main app and the alarm plugin use the flutter_fgbg plugin, leading to duplicate class definitions.
If using Gradle, you can exclude specific modules to avoid duplicate class definitions:
implementation ('com.example:alarm:1.0.0') {
exclude group: 'com.example', module: 'flutter_fgbg'
}
Define a resolution strategy in your app's android/build.gradle:
configurations.all {
resolutionStrategy {
force 'com.example:flutter_fgbg:1.0.0' // replace with actual group:module:version
}
}
This ensures only the specified version of flutter_fgbg is utilized.
Review your dependencies. Remove any that are no longer in use to reduce potential future conflicts.
Post changes, clean the build directory and rebuild:
flutter clean
flutter run
Please let me know if it works or if you still have an issue.
alarm 1.2.1
Describe the bug I have big problems with the plugin and get duplicate class errors. There seems to be a conflict between alarm 1.2.1 and Flutter_fgbg
To Reproduce Steps to reproduce the behavior:
Expected behavior Find a solution for this issue: ERROR: C:\scr\flutter\projects\smartabox_app\build\alarm.transforms\3f03b4caccdeb316d77f1a14c56b987c\transformed\classes\classes.dex: D8: Type com.example.smartabox_app.BuildConfig is defined multiple times: C:\scr\flutter\projects\smartabox_app\build\alarm.transforms\3f03b4caccdeb316d77f1a14c56b987c\transformed\classes\classes.dex, C:\scr\flutter\projects\smartabox_app\build\flutter_fgbg.transforms\259e6456fa506c18132e02beab7ce5be\transformed\classes\classes.dex
Screenshots **
Device info Provide device info (Manufacturer, OS version, ...) Ex: iPhone 13 Pro, iOS 16.2, ...
Provide device info (Manufacturer, OS version, ...) Provide device info (Manufacturer, OS version, ...) Ex: iPhone 13 Pro, iOS 16.2, ...
Additional context Add any other context about the problem here. Ex: iPhone 13 Pro, iOS 16.2, ...
Additional context Add any other context about the problem here. Additional context Add any other context about the problem here.