Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tranvansang opened this issue May 22, 2023 · 2 comments
Assignees

Comments

@tranvansang
Copy link

tranvansang commented May 22, 2023

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
Copy link
Member

onevcat commented May 23, 2023

@plateaukao Can you have a look at this?

@tranvansang
Copy link
Author

tranvansang commented May 23, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants