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

APK compilation failed due to conflict with inappwebview #66

Closed cipchk closed 1 year ago

cipchk commented 1 year ago

Is it a security issue?

If you believe you have discovered a vulnerability or have an issue related to security, please DO NOT open a public issue. Instead, send us a mail to dl_oss_dev@linecorp.com.

What did you do?

Please describe what you did before you encounter the issue.

What did you expect?

Please describe what you did expect to happen.

What happened actually?

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkReleaseDuplicateClasses'.
> 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>.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Your environment?

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

Flutter 3.3.6 • channel stable • https://github.com/flutter/flutter.git Framework • revision 6928314d50 (2 days ago) • 2022-10-25 16:34:41 -0400 Engine • revision 3ad69d7be3 Tools • Dart 2.18.2 • DevTools 2.15.0

build.gradle

compileSdkVersion 33 minSdkVersion 21 targetSdkVersion 33

Sample project

Steps to reproduce:

flutter_line_sdk: ^2.3.0
flutter_inappwebview: ^5.4.3+7
onevcat commented 1 year ago

@plateaukao Can you check this?

tsairene commented 1 year ago

Hi @cipchk

The error seems to be that the libraries you used that depend on both kotlin and java version for the viewmodel library. Please try to fix it by adding below config in project level build.gradle:

    configurations {
        all {
            exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
        }
    }

Since this is more like App itself dependency issue which is not under LINE sdk scope, it might be quicker and easier to find solutions on Internet (for example, stackoverflow). Suggest you to search for solutions first if you meet similar questions too. Thanks.

If you think it’s more of LINE SDK’s issue, please provide sample projects that can reproduce the issue, so that we could feedback to you more quickly.

napierya commented 1 year ago

I have the same problem, but I don't know how to solve it

napierya commented 1 year ago

@cipchk How did you solve this problem

cipchk commented 1 year ago

@tsairene answer has solved my problem.

napierya commented 1 year ago

@cipchk Although I can't solve this problem in this way, thank you all the same