Search Unity

Running APK on Android studio emulators

Discussion in 'Android' started by Risine, Nov 15, 2015.

  1. Risine

    Risine

    Joined:
    Dec 10, 2009
    Posts:
    154
    Ok,

    after a long and painful path to make the emulators work, I am able to install the apk on an android device emulator.
    My problem now is that when I click on the apk icon on the emulator, I have this error :

    FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.hop.game/com.unity3d.player.UnityPlayerActivity}: java.lang.ClassNotFoundException: Didn't find class "com.unity3d.player.UnityPlayerActivity" on path:
    ....

    Does someone has an idea of what I am doing wrong?
     
  2. Risine

    Risine

    Joined:
    Dec 10, 2009
    Posts:
    154
    Ok, finally found the solution.
    If you want to test on Android Studio, the good way is to build with "Google Android Project" checked.
    Then go to Android Studio and import the project X:/mypath/MyProject you created at path X:/mypath.
     
  3. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    Please don't use the Android emulator. It works fine for regular Android applications but for anything that is graphics heavy it's bound to fail miserably. Last time I checked the emulator supplied by Google barely supported Open GL ES 2.0
     
  4. Risine

    Risine

    Joined:
    Dec 10, 2009
    Posts:
    154
    thanks for the reply.
    My app is far from heavy, just using UI stuff and 3d quads.
    What's the best way to test on android then if you don't have the devices?
     
  5. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    Buy a device? I'm sorry but I don't have a better answer for you. If you are serious about Android development you will need a device - no emulator I know of will be able to give you the feel for how your application would behave on a real device.

    Reading other threads on the forums it seems that some people are using Bluestacks emulator. I have never used it myself so I can't speak for it's stability or performance.
     
  6. Risine

    Risine

    Joined:
    Dec 10, 2009
    Posts:
    154
    I have a device. But developing on mobile phones is working on hundreds of devices, not just one; there the need to have emulators - even poor ones - that can give you an idea of how it works on different phones 'families'.
    Anyway I'll give a look at Bluestacks emulator, thanks.
     
  7. thedarcsage

    thedarcsage

    Joined:
    Nov 2, 2016
    Posts:
    23
  8. tenh_un

    tenh_un

    Joined:
    Jun 24, 2019
    Posts:
    5
    I seem not understand what you mean, can you detail?