line / line/line-sdk-unity

Error on Android:Failed resolution of: Lcom/google/gson/Gson;

Open
#26 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
125
Forks
26
PR merge metrics
No merged PRs in 30d

Description

## Is it a security issue?
No
## What did you do?
Unity 2018.4.7f1
>1 Import line_sdk_unity_1.1.4.unitypackage to a empty unity project.
>2 Switch platform to Andorid.
>3 open "Main" scene and replace Channel ID on LineSDK object.
>4 Build apk with mini api level21.
>5 Run apk in sumsung SM-G9600

## What did you expect?

The build Run with no error

## What happened actually?

```
2020-09-07 11:29:50.762 5604-5624/? E/Unity: AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/gson/Gson;
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/gson/Gson;
at com.linecorp.linesdk.unitywrapper.LineSdkWrapper.(LineSdkWrapper.kt:21)
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
at android.os.MessageQueue.next(MessageQueue.java:395)
at android.os.Looper.loop(Looper.java:181)
at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.gson.Gson" on path: DexPathList[[zip file "/data/app/com.chm.linetest-letwctzDNm2HWtnsrXKO3A==/base.apk"],nativeLibraryDirectories=[/data/app/com.chm.linetest-letwctzDNm2HWtnsrXKO3A==/lib/arm, /data/app/com.chm.linetest-letwctzDNm2HWtnsrXKO3A==/base.apk!/lib/armeabi-v7a, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClas
```

## Your environment?

Build from 2018.4.7f1
LineSDK 1.1.4

## Sample project

https://drive.google.com/file/d/1wvDOGwkAolomlllUePsXElTznq4VCu3O/view?usp=sharing

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Android build from the Unity 2018.4.7f1 steps using line_sdk_unity_1.1.4 and the linked sample project. Start with the LineSdkWrapper constructor at LineSdkWrapper.kt:21 and inspect the generated APK; done means the app runs without the reported Gson NoClassDefFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp, unity
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.