【问题标题】:Duplicate class com.mapbox.mapboxsdk.plugins.annotation.Annotation found in modules classes.jar在模块 classes.jar 中找到重复的类 com.mapbox.mapboxsdk.plugins.annotation.Annotation
【发布时间】:2020-09-07 19:28:13
【问题描述】:

我的 Flutter 应用在​​ Mapbox 上做得很好,但是突然发生了这种情况,我没有改变任何东西。每当我现在尝试运行该应用程序时,它都会给我这个错误:

Duplicate class com.mapbox.mapboxsdk.plugins.annotation.Annotation found in modules classes.jar (com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v8:0.7.0) and classes.jar (com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.8.0)

这是我pubspec.yaml 中的依赖项:

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  flag: ^1.0.3
  shared_preferences: ^0.5.6+3
  provider: ^4.0.4
  intro_views_flutter: ^2.8.1
  lottie: ^0.6.0
  mapbox_gl: ^0.8.0
  location: ^3.0.2
  loading: ^1.0.2
  autocomplete_textfield: ^1.7.3
  flip_card: ^0.4.4
  animate_do: ^1.6.3
  highlighter_coachmark: ^0.0.3
  firebase_database: ^3.1.3
  sqflite: ^1.3.0
  loading_overlay: ^0.2.1
  flutter_spinkit: ^4.1.2+1
  google_fonts: ^0.4.0
  intl: ^0.16.0
  firebase_auth: ^0.16.0
  google_sign_in: ^4.4.1
  flutter_facebook_login: ^3.0.0
  flutter_auth_buttons: ^0.8.0
  steps: ^0.0.1
  background_location: ^0.0.9+3
  flutter_mapbox_navigation: ^0.0.11
  flutter_local_notifications:
  sliding_sheet:
  launch_review:
  webview_flutter:
  firebase_admob: ^0.9.3+2
  device_id: ^0.2.0
  flutter_native_admob: ^2.1.0
  flutter_typeahead: ^1.8.8dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  flag: ^1.0.3
  shared_preferences: ^0.5.6+3
  provider: ^4.0.4
  intro_views_flutter: ^2.8.1
  lottie: ^0.6.0
  mapbox_gl: ^0.8.0
  location: ^3.0.2
  loading: ^1.0.2
  autocomplete_textfield: ^1.7.3
  flip_card: ^0.4.4
  animate_do: ^1.6.3
  highlighter_coachmark: ^0.0.3
  firebase_database: ^3.1.3
  sqflite: ^1.3.0
  loading_overlay: ^0.2.1
  flutter_spinkit: ^4.1.2+1
  google_fonts: ^0.4.0
  intl: ^0.16.0
  firebase_auth: ^0.16.0
  google_sign_in: ^4.4.1
  flutter_facebook_login: ^3.0.0
  flutter_auth_buttons: ^0.8.0
  steps: ^0.0.1
  background_location: ^0.0.9+3
  flutter_mapbox_navigation: ^0.0.11
  flutter_local_notifications:
  sliding_sheet:
  launch_review:
  webview_flutter:
  firebase_admob: ^0.9.3+2
  device_id: ^0.2.0
  flutter_native_admob: ^2.1.0
  flutter_typeahead: ^1.8.8

这是我build.gradle 中的依赖项:

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.android.support:multidex:1.0.3'
}

【问题讨论】:

    标签: java android flutter


    【解决方案1】:

    解决了,经过多次尝试,问题是用这个打包在一起:

      mapbox_gl: ^0.8.0
      flutter_mapbox_navigation: ^0.0.11
    
    

    删除flutter_mapbox_navigation: ^0.0.11 修复它

    【讨论】:

      猜你喜欢
      • 2020-01-22
      • 1970-01-01
      • 2019-11-03
      • 1970-01-01
      • 2019-11-15
      • 2019-09-22
      • 1970-01-01
      • 1970-01-01
      • 2020-03-15
      相关资源
      最近更新 更多