Search Unity

[Closed] [Android] IAP restart app on some devices

Discussion in 'Unity IAP' started by TSC, Jul 16, 2017.

Thread Status:
Not open for further replies.
  1. TSC

    TSC

    Joined:
    Oct 15, 2012
    Posts:
    271
    Hello everyone I have a issue when selecting a IAP product on a SAMSUNG SGH-T399N Android version 4.4.2, when I select the item the purchasing process appear but the app restart.

    When I do the same on a Coolpad 3622A Android version 5.1.1 it works fine.

    Is it Because the difference in android versions? and if so does that mean any android versions less than 5 will restart the app?

    Has anyone experienced this issue or know a solution to this issue?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Are you using Codeless IAP? Are you able to provide the device logs when this happens? Perhaps using adb logcat
     
  3. TSC

    TSC

    Joined:
    Oct 15, 2012
    Posts:
    271
    I'm using unity IAP system. I'm not able to see the device logs atm but you said I can use adb logcat to help pin point what's exactly going on. I'll give that a try.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We offer both Codeless and also scriptable with Unity IAP. Codeless allows you to drop in a Purchase button in your scene for example, without scripting.
     
  5. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @TSC

    It is unlikely that this is related to Android version.

    * Which version of the IAP plugin are you using?
    * Which version of Unity are you using?

    The device you listed (SAMSUNG SGH-T399N) has about 1GB of memory. Is it possible that the application is simply running out of memory? The device logs will give you much more information about this.
     
  6. TSC

    TSC

    Joined:
    Oct 15, 2012
    Posts:
    271
    I'm using Unity 2017 now but it was doing the same on unity 5.6, and I'm using the version just before the latest release.

    -"has about 1GB of memory", yes it has 1GB of ram and less than that available (275 MB) when factoring in other activities that are running as well.

    I add IAP Button via <add component > on the GO itself.


    IAP_Button.PNG





    Memory is definitely a issue not only for the app I guess, here is the memory pull from the editor with just opening up the editor; However when I press play that number jumps to 1.3 m more than double.

    Memory_BeforePressingPlay.PNG



    All I have atm is this 2GB ram Acer to work on. The project itself is only 90MB, FPS hovering around 80. what is it that's causing double the pull for the same project?. This wasn't a issue before.

    I understand that unity is becoming more powerful and I also understand that I need more powerful equipment to develop with; However I assumed that would be more of a concern for a huge ++ project.

    --Well that's strange I just installed aLogcat to see if I can get a log check and this is the first time in several weeks now that the app didn't close. But then when I uninstalled aLogcat it went back to closing the app when I select the IAP.... Not sure what's going on...

    So I re-installed aLogcat to see if it would go away and now its working as it should.

    It's definitely a memory issue because aLogcat is freeing up memory something like (30% +/- 20) which takes the ram from 275MB to around (300-390MB) avg. 300MB

    With that understood, is their something I can do about this as all potential users may not be able to get a device with more ram, hek I'm the developer and I'm not able to get more powerful equipment atm. Also how would that look for me to say "hey you should check out my app but you have to download aLogcat as well" .

    Do I have to create a device ram manager script for the app and if so and it work can I do the same for the editor until I'm able to acquire more computing power???

    Thanks again for the help!

    -Grand Rio
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The RAM memory used by the Editor would have no effect on the RAM used on the device. Unfortunately there is not much that can be done on a device with low memory capabilities, other than removing any unnecessary libraries that might be included in your application that are not being used. Are you specifically targeting users that have the SAMSUNG SGH-T399N? Or rather was this a device that you happened to be testing with? 2GB is generally the minimum RAM memory that new mobiles are sold with.
     
  8. TSC

    TSC

    Joined:
    Oct 15, 2012
    Posts:
    271
    Yup, I understand the device memory and editor draw are different, I was just saying that the memory thing is a issue on both the computer and testing device.

    The computer I use for development Has 2GB ram which isn't enough and also the SAMSUNG SGH-T399N is just one of the devices I'm testing with the COOLPAD works fine, I was just considering that every potential user might not have the latest mobile devices on the market.

    Is their some type of way to make a ram allocation manager for both the device and the editor,

    For the device, when I installed the aLogcat app It managed the ram and everything worked, could I possibly develop something similar and deploy it with my app for it to take effect if needed depending the device, until it's no longer required. If so could you point me in the proper direction to achieve this solution.

    One for those users that might not have the latest mobile,

    And two for me as a developer within the editor. I'm now currently only able to run the editor for about 45 to 1 1/2 hrs before the Physical memory reaches 98%, until I'm able to obtain a stronger computer.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I'm not sure if would be worth the effort to address a small percentage of users, but that would be up to you. We would not be able to recommend nor familiar with a 3rd party memory manager. I just checked out aLogCat myself, although it is not a memory manager per se. Also, you can install a previous version of Unity if you find it works better on your system, just install it into a different directory if you need both versions.
     
  10. TSC

    TSC

    Joined:
    Oct 15, 2012
    Posts:
    271
    Thank you. Got it!
     
Thread Status:
Not open for further replies.