line / flutter_line_sdk

A Flutter plugin that lets developers access LINE's native SDKs in Flutter apps with Dart.
https://developers.line.biz/
Apache License 2.0
213 stars 42 forks source link

Duplicate class androidx.lifecycle.ViewModelLazy error when just adding the library to pubspec.yaml #77

Closed tranvansang closed 1 year ago

tranvansang commented 1 year ago

Is it a security issue?

No

What did you do?

add flutter_line_sdk: ^2.3.2 to pubspec.yaml

What did you expect?

The app should be at least compilable, like before adding flutter_line_sdk.

What happened actually?

The app can not be built even without any usage of the library.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.1.0-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1)

     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

Your environment?

Some information of the environment in which the issue happened. Package version, Xcode version, iOS version, etc.

flutter --version
Flutter 3.10.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 84a1e904f4 (13 days ago) • 2023-05-09 07:41:44 -0700
Engine • revision d44b5a94c9
Tools • Dart 3.0.0 • DevTools 2.23.1

Sample project

No sample project

pubspec.yaml:

name: my app
description: my app

publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
  sdk: ">=2.15.1 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.5
  webview_flutter: ^4.0.7
  google_auth: ^0.0.2
  facebook_auth: ^0.0.2
  package_info_plus: ^3.1.0
  uuid: ^3.0.7
  url_launcher: ^6.1.10
  path_provider: ^2.0.14
  image_picker: ^0.8.7+1
  image: ^4.0.15
  webview_flutter_android: ^3.4.5
  flutter_localizations:
    sdk: flutter
  intl: any
  shared_preferences: ^2.1.0
  provider: ^6.0.5
  flutter_launcher_icons: ^0.13.1
  flutter_line_sdk: ^2.3.2

dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_lints: ^2.0.1

flutter:
  uses-material-design: true
  generate: true
flutter_launcher_icons:
  android: true
  ios: true
  remove_alpha_ios: true
  image_path: "assets/icon/icon.png"
onevcat commented 1 year ago

@plateaukao Can you have a look at this?

tranvansang commented 1 year ago

I try removing pubspec.lock and re-build. Now It works.