导入后我开始遇到这个问题
implementation platform('com.google.cloud:libraries-bom:19.0.0')
implementation 'com.google.cloud:google-cloud-translate'
我在threeten 和threeten-no-tzdb 模块之间遇到了许多重复的类错误。
Duplicate class org.threeten.bp.Clock found in modules jetified-threetenbp-1.5-no-tzdb.0-no-tzdb (org.threeten:threetenbp:1.5.0) and jetified-threetenbp-1.5.0 (org.threeten:threetenbp:1.5.0)
Duplicate class org.threeten.bp.Clock$FixedClock found in modules jetified-threetenbp-1.5-no-tzdb.0-no-tzdb (org.threeten:threetenbp:1.5.0) and jetified-threetenbp-1.5.0 (org.threeten:threetenbp:1.5.0)
Duplicate class org.threeten.bp.Clock$OffsetClock found in modules jetified-threetenbp-1.5-no-tzdb.0-no-tzdb (org.threeten:threetenbp:1.5.0) and jetified-threetenbp-1.5.0 (org.threeten:threetenbp:1.5.0)
Duplicate class org.threeten.bp.Clock$SystemClock found in modules jetified-threetenbp-1.5-no-tzdb.0-no-tzdb (org.threeten:threetenbp:1.5.0) and jetified-threetenbp-1.5.0 (org.threeten:threetenbp:1.5.0)
Duplicate class org.threeten.bp.Clock$TickClock found in modules jetified-threetenbp-1.5-no-tzdb.0-no-tzdb (org.threeten:threetenbp:1.5.0) and jetified-threetenbp-1.5.0 (org.threeten:threetenbp:1.5.0)
Duplicate class org.threeten.bp.DateTimeException found in modules jetified-threetenbp-1.5-no-tzdb.0-no-tzdb (org.threeten:threetenbp:1.5.0) and jetified-threetenbp-1.5.0 (org.threeten:threetenbp:1.5.0)
Duplicate class org.threeten.bp.DateTimeUtils found in modules jetified-threetenbp-1.5-no-tzdb.0-no-tzdb (org.threeten:threetenbp:1.5.0) and jetified-threetenbp-1.5.0 (org.threeten:threetenbp:1.5.0)
Duplicate class org.threeten.bp.DayOfWeek found in modules jetified-threetenbp-1.5-no-tzdb.0-no-tzdb (org.threeten:threetenbp:1.5.0) and jetified-threetenbp-1.5.0 (org.threeten:threetenbp:1.5.0)
Duplicate class org.threeten.bp.DayOfWeek$1 found in modules jetified-threetenbp-1.5-no-tzdb.0-no-tzdb (org.threeten:threetenbp:1.5.0) and jetified-threetenbp-1.5.0 (org.threeten:threetenbp:1.5.0)
Duplicate class org.threeten.bp.Duration found in modules jetified-threetenbp-1.5-no-tzdb.0-no-tzdb (org.threeten:threetenbp:1.5.0) and jetified-threetenbp-1.5.0 (org.threeten:threetenbp:1.5.0)
我试过使用
configurations {
all{
exclude group :"org.threeten", module: "threetenbp"
}
}
在我的顶级 build.gradle 中,它解决了重复的类错误,但随后我的 materialcalendarview 给了我一个新错误
F:\CodingProjects\AndroidStudioProjects\CleanBook\app\src\main\java\com\where44444\cleanbook\W4_Funcs.java:335: error: cannot access LocalDate
((MaterialCalendarView) view).setSelectedDate(day);
^
class file for org.threeten.bp.LocalDate not found
那里的功能看起来像这样
public static void w4SetMaterialCalendarDate(View view, CalendarDay day) {
((MaterialCalendarView) view).setSelectedDate(day);
((MaterialCalendarView) view).setCurrentDate(day, true);
}
任何想法如何解决这一问题?有没有办法只排除 no-tzdb 版本?