Closed phamhuong8794 closed 4 years ago
Hello, it's not a bug. Please make sure you follow the step 2 from our doc. https://developers.amplitude.com/docs/unity
thanks for answer. i'd build success but have a error when i'm trying log an event. this is error in picture
if you have video setup, please send me
@phamhuong8794 Can you try add
-keep class com.amplitude.unity.plugins.AmplitudePlugin { *; }
to your Proguard exceptions file?
2020-06-25 09:41:37.651 27740-27740/? E/Zygote: isWhitelistProcess - Process is Whitelisted 2020-06-25 09:41:37.652 27740-27740/? E/libpersona: scanKnoxPersonas 2020-06-25 09:41:37.652 27740-27740/? E/libpersona: Couldn't open the File - /data/system/users/0/personalist.xml - No such file or directory 2020-06-25 09:41:38.246 27740-27740/com.android.application E/AndroidRuntime: FATAL EXCEPTION: main Process: com.android.application, PID: 27740 java.lang.NoClassDefFoundError: Failed resolution of: Lcom/unity3d/player/UnityPlayer; at com.unity3d.player.UnityPlayerActivity.onCreate(Unknown Source:7) at android.app.Activity.performCreate(Activity.java:7183) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.unity3d.player.UnityPlayer" on path: DexPathList[[zip file "/data/app/com.android.application-QqsCvCzcpl4HUeWyktLyiw==/base.apk"],nativeLibraryDirectories=[/data/app/com.android.application-QqsCvCzcpl4HUeWyktLyiw==/lib/arm, /data/app/com.android.application-QqsCvCzcpl4HUeWyktLyiw==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at com.unity3d.player.UnityPlayerActivity.onCreate(Unknown Source:7) at android.app.Activity.performCreate(Activity.java:7183) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
This error seems strange. I'm not sure why your proguard is behaving this way.
The idea is not to obfuscate com.amplitude.unity.plugins.AmplitudePlugin
class and its methods.
Which is this -
-keep class com.amplitude.unity.plugins.AmplitudePlugin
I don't think that's the issue in our tutorial. Maybe you can create a clean project to test it out.
i'm create 4 times new project, and result is same. have issue of unity version??? i'm working in unity 2017.4.31f1. I'm don't find every package name is com.amplitude.unity.plugins.AmplitudePlugin in package
2017? That's too old. We're on 2019.3.11f.
Also that class is inside our android sdk.
Do I need to import that sdk into the project?
i trying up to unity 2018.4.23f1, it same (@@)
If possible, please give me a video of how to add the library
Thanks haoliu, I have finished adding amplitude to my project. There are some issues that hopefully help someone in need:
@phamhuong8794 Glad you figured it out! Thanks for sharing the steps too!
I am trying build a new project with amplitude same tutorial. but app is crash immediately when i open app. this is error: