Giter VIP home page Giter VIP logo

Comments (14)

haoliu-amp avatar haoliu-amp commented on August 20, 2024

Hello, it's not a bug. Please make sure you follow the step 2 from our doc.
https://developers.amplitude.com/docs/unity

from unity-plugin.

phamhuong8794 avatar phamhuong8794 commented on August 20, 2024

thanks for answer. i'd build success but have a error when i'm trying log an event. this is error in picture
Capture

from unity-plugin.

phamhuong8794 avatar phamhuong8794 commented on August 20, 2024

if you have video setup, please send me

from unity-plugin.

phamhuong8794 avatar phamhuong8794 commented on August 20, 2024

image
image
image
image
image

from unity-plugin.

haoliu-amp avatar haoliu-amp commented on August 20, 2024

@phamhuong8794 Can you try add

-keep class com.amplitude.unity.plugins.AmplitudePlugin { *; }

to your Proguard exceptions file?

from unity-plugin.

phamhuong8794 avatar phamhuong8794 commented on August 20, 2024

An error if i change this proguard: -keep class com.amplitude.unity.plugins.AmplitudePlugin { *; }

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) 

from unity-plugin.

haoliu-amp avatar haoliu-amp commented on August 20, 2024

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.

from unity-plugin.

phamhuong8794 avatar phamhuong8794 commented on August 20, 2024

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

from unity-plugin.

haoliu-amp avatar haoliu-amp commented on August 20, 2024

2017? That's too old. We're on 2019.3.11f.

Also that class is inside our android sdk.

from unity-plugin.

phamhuong8794 avatar phamhuong8794 commented on August 20, 2024

Do I need to import that sdk into the project?

from unity-plugin.

phamhuong8794 avatar phamhuong8794 commented on August 20, 2024

i trying up to unity 2018.4.23f1, it same (@@)

from unity-plugin.

phamhuong8794 avatar phamhuong8794 commented on August 20, 2024

If possible, please give me a video of how to add the library

from unity-plugin.

phamhuong8794 avatar phamhuong8794 commented on August 20, 2024

Thanks haoliu,
I have finished adding amplitude to my project. There are some issues that hopefully help someone in need:

  1. i'm update version unity to 2018
  2. user lastest resolve jar
  3. replace -keep class com.amplitude.unity.plugins.AmplitudePlugin { *; } instead -keep class com.amplitude.unity.plugins.AmplitudePlugin
  4. This is how to add proguard file into unity: https://stackoverflow.com/questions/43774062/crashlytics-unity-plugin-export-to-android-studio/46840109#46840109
    Goodluck!!

from unity-plugin.

haoliu-amp avatar haoliu-amp commented on August 20, 2024

@phamhuong8794 Glad you figured it out! Thanks for sharing the steps too!

from unity-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.