line / line-sdk-unity

Provides a modern way of implementing LINE APIs in Unity games, for iOS and Android.
https://developers.line.biz/
Apache License 2.0
117 stars 24 forks source link

fix: fix unity gradle setting and update line-sdk-unity-wrapper-release.aar to 5.8.1 #53

Closed tsairene closed 1 year ago

tsairene commented 1 year ago

Summary

Address issue #51

Due to deprecation of jcenter, update Android library repo from jcenter to mavenCentral.

Since there's no line-sdk-android v5.1.1, it's also updated to use latest one v5.8.1 instead.

Verification

  1. Run ./gradlew assembleRelease in line-sdk-unity/linesdk-android-unity-wrapper folder

  2. Copy line-sdk-unity/linesdk-android-unity-wrapper/build/outputs/aar/line-sdk-unity-wrapper-release.aar to LINE_SDK_Unity/Assets/Plugins/Android/line-sdk-unity-wrapper-release.aar

  3. Menu > File > Build And Run (Export to folder)

    Build And Run
  4. Build And Run on Pixel 6 Pro

Reference

onevcat commented 1 year ago

Nice. Thank you!

onevcat commented 1 year ago

@tsairene

I am now trying to verify the changes. As in the public doc, we need to support from Unity 2020.3, but changes in this PR upgrades the Unity to 2022.3.4.

Since we have to export the package from 2020.3.0, I tried to downgrade to that version and build the sample project. However, it gives me an error below:

1 exception was raised by workers: java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class kotlinx.coroutines.AbstractCoroutine found in modules jetified-kotlinx-coroutines-core-1.3.0.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0) and jetified-kotlinx-coroutines-core-jvm-1.5.0.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0)

Duplicate class kotlinx.coroutines.Active found in modules jetified-kotlinx-coroutines-core-1.3.0.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0) and jetified-kotlinx-coroutines-core-jvm-1.5.0.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0)

... Much more similar

I am not sure but I guess the reason can be the android.useAndroidX=true line in the wrapper? (or maybe the Kotlin was added by multiple time?)

Can you help and check to see is it possible to build the project on Unity 2020.3.0?

coly-yabuhana-365 commented 1 year ago

In Unity2020.3, isn't the 'android.enableR8 =MINIFY_WITH_R_EIGHT' statement required in gradleTemplate.properties?

Because in Unity2022.2 or later Gradle has been updated from 6.1.1 to 7.2 and Android Gradle Plugin from 4.0.1 to 7.1.2 and android.enableR8 is now a bool property.

In Unity2022.2 or later, 'android.enableR8 =true' is the default value, so it does not need to be listed.

I think I need to implement a separate for each version somehow within gradleTemplate.properties.

onevcat commented 1 year ago

Hi,

Thanks for the feedback.

We noticed this and are still working on another update. The master branch is not a released branch so please avoid use things there yet.