Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

[Released] Android Native Pro

Discussion in 'Assets and Asset Store' started by stanislav-osipov, Sep 5, 2018.

  1. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
  2. supersolid-jelte

    supersolid-jelte

    Joined:
    Dec 3, 2018
    Posts:
    22
    hey @lacost,

    we are experiencing a high number of ANR's with the latest version due to:
    Code (CSharp):
    1. Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{ad0f06d u0 com.xxxx.xxxxx/com.stansassets.android.app.notifications.AN_AlarmNotificationService}
    I understand that this will be fixed in the next update. Could you give any timeline on when that will be? so that we can take the appropriate action.

    Jelte
     
    Djadjouka likes this.
  3. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    And update will be released this weekends!
     
    Djadjouka likes this.
  4. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hey, I will send you an updated version, hope you can give it a try an confirm that issue is gone. Thanks.

    Update: I can't start a conversation with you on this forum. Please PM me.
     
  5. petediddy

    petediddy

    Joined:
    Mar 17, 2015
    Posts:
    19
    Hi @lacost

    We have been using AN plugin for a couple of years and are updating to the ANP plugin (v 2019.17 on unity 2019.2.0). We were able to get most stuff working great. However, the billing is giving us some trouble. We are trying to follow the AN_BillingExample script included in the plugin, but we are getting messages that AN_Billing is depracated and to use AN_BillingClient instead - but the methods inside AN_BillingClient are different - for instance, Connect method is not there...

    We have also looked at the plugin documentation on the website and it says to reference the google docs, but we don't know how to convert the java sample code to C#.

    Would it be possible to update the AN_BillingExample script in the plugin to use current code? We usually followed the samples included in the plugin in the past and it worked great.

    Thanks for your help!
     
  6. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Yea, I've completely changed the billing API since old ne was deprecated by android, will make new documentation and examples shortly. Thanks.
     
  7. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    Hi, is it possible to test the new billing system on the editor?, i'm not even getting simple logs going to know i'm on the right track and i'm using the sample scripts
     

    Attached Files:

  8. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    There is no Editor Testing. The focus is to make Android and iOS plugin as direct access to the native API
    When Ultimate Mobile will contain a cross-platfrom implementation + editor testing for all the featyre and simplified API.
     
  9. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    thanks for the response,my question now is how do i test my code? before i knew about ultimate mobile, i purchased both android and ios native, is there a way to return both purchases in exchange for the ultimate mobile plugin as i build for both platforms, would really appreciate your response.
     
  10. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    You can always test on the real device or Using an emulator. You would need to do this at some point anyways.

    You can go ahead and by an Ultimate Mobile plugin. then send me all the invoices and I will contact the Asset Store support team, and ask them for refund, to make sure you not overpaying.
     
  11. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    Thanks, i will be doing just that
     
  12. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    i will like to report a few issues i'm facing with the plugin at the moment, the first one is the fact that the google billing system keeps failing, my billingClient connects to google without problems but any attempts at making a purchase immediately returns the billing result of failed, i've tried using googles static responses and it still returns failed, here is my simple script

    i use an ienumerator to wait unitl billing is ready and then perform my purchase, when the call back is called the billing result returns failed
     

    Attached Files:

  13. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    my second issue involves the android native sharing functionality, i'm trying to share a screen shot but the screenshot is never posted in my social media post. the only output i get is the ("Hello world") created by the SetText method, i'm using the example script from the documentation page here.
     

    Attached Files:

  14. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Okay, so this is my API design issue. You can't make AN_SkuDetails model your own, so you can't do something like:

    Code (CSharp):
    1. var product = new AN_SkuDetails("your.product.sku", AN_BillingClient.SkuType.inapp);
    I will mark this constructor as internal. It can only be used inside an editor and only for emulation.
    That's what you having a failed result because the native part has no idea about the product you referring to. Here is what you need to do:

    1. QuerySkuDetailsAsync once you connected.

    Code (CSharp):
    1.  
    2. //In case you also have subs products you can also Query for it as well.
    3. //In this example we only have inapp products types.
    4. var paramsBuilder = AN_SkuDetailsParams.NewBuilder();
    5. paramsBuilder.SetType(AN_BillingClient.SkuType.inapp);
    6. var skusList = new List<string>();
    7. skusList.Add("android.test.purchased");
    8. skusList.Add("android.test.canceled");
    9. skusList.Add("android.test.item_unavailable");
    10. skusList.Add("androidnative.test.product.1");
    11. skusList.Add("androidnative.product.test.2");
    12. paramsBuilder.SetSkusList(skusList);
    13.    
    14. m_BillingClientSample.Client.QuerySkuDetailsAsync(paramsBuilder.Build(), this);
    15.  
    2. Get your AN_SkuDetails products with
    Code (CSharp):
    1. OnSkuDetailsResponse(SA_Result billingResult, List<AN_SkuDetails> skuDetailsList)
    You can only the use products AN_SkuDetails that you got via OnSkuDetailsResponse callback.

    Check the AN_VendingSample for more details
     
  15. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Can you share to Gmail app for example? Some apps do not support image sharing. If you do not able to see your shared screenshot attached into Gmail, please send me to log cat logs.
     
  16. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    hi, thank you, i got it working, my issue was exactly what you pointed out, i was using the wrong sku details.
     
    stanislav-osipov likes this.
  17. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    please what cat logs do you need, gmail still produces the same issues, only the composer.setText("Hello world") displays it's data, everything else is ignored and this is the exact line of code i'm calling from my button
     

    Attached Files:

  18. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    You can use and Android Studio for that
    https://developer.android.com/studio/debug/am-logcat

    If you have troubles getting the log you can also just send me an APK I will install it on my device and will check a log myself.
     
  19. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    Hi i can send you the apk, would you want me to check any settings in the android native plugin window before i email it to you?
     
  20. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    Hi, i'd also like to add that i'm facing issues with the google play sign in system, i once again used the exact script in the documentation but the sign in result returns failed and the error message outputs "SIGN_IN_REQUIRED"
     

    Attached Files:

  21. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
  22. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    Hi, i'll make sure to send you the apk but i moved on to a different project and would like to ask if android native and ios native individually dont have ads features, like admob implementation?
     
  23. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    No, but Ultimate Mobile does have this, you may consider an upgrade :)
     
  24. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    New version released 2019.19
    • Vending: Acknowledge Purchase API added
    • Local Notification badges API.
    • Camera API permissions request fixed.
    • Jar resolver UI additional options added.
    • Added Sing in status codes.
    • Google Play Billing Library updated to 2.0.3.
    • Play Services Games updated to 18.0.1.
     
  25. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    oh okay, is there any upgrade plan available? if i knew about the ultimate mobile i wouldn't have gotten ios and android native seperately
     
  26. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    There is a better deal available if you own iOS and Android already. Just check the prise asset store offers it should be discounted
     
    Last edited: Oct 12, 2019
  27. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hm, that's interesting, I will talk to the Asset Store support. I am sure there is a way to give you a very good discount since you already own both iOS and Android plugins.
     
  28. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    thank you very much, i really appreciate the support
     
  29. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    No problem @Carrmichaelll . I've sent the request to the Asset Store support. Will keep you posted.
     
    Carrmichaelll likes this.
  30. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Okay, so I got a replay from the Asset Store team, there is a way to set a discount for you, I will share the details in DM with you.
     
  31. Carrmichaelll

    Carrmichaelll

    Joined:
    Nov 30, 2016
    Posts:
    68
    Hi, i don't know if i'm the first to report this but, loading banner ad crashes my app, i'm testing out the ad system on an empty project before, using it and it keeps crashing, i'm using ultimate mobile

    i would also like to add that unity ad works perfectly, except the banner ad is placed wrongly which is a unity fault because i tried it without the plugin and it gave the same result, but your plugin seems to crash with admob
     

    Attached Files:

    Last edited: Oct 17, 2019
  32. James-Jo

    James-Jo

    Joined:
    Feb 11, 2019
    Posts:
    10
    Hi.

    Google announced this

    Real-time and turn-based multiplayer services are deprecated
    https://developers.google.com/games/services/common/concepts/turnbasedMultiplayer

    The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.
    https://developers.google.com/android/reference/com/google/android/gms/drive/Drive

    I'm using both of the above features.
    Multiplayer, Save Game
    What is the alternative since this is part of the plugin?
     
  33. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    That's a known AdMob issue, please grab the latest AdMob google plugin
     
  34. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
  35. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    New version released 2019.20
    • Vending and Notification services will not throw an error on usage attempts when service is disabled.
    • Vending Licensing UI updated.
    • AndroidX library updated to 1.1.0.
    • BillingClient QueryPurchaseHistoryAsync method added.
     
  36. UniDro

    UniDro

    Joined:
    Nov 21, 2014
    Posts:
    25
    Hello.
    Does anyone of you have those crash clusters in your games?

    upload_2019-12-5_13-47-34.png

    Both happens when Unity opens any native Android window going to background or just when user minimize the app, sending Notifications. But GenerateLayout is Android 5 and 6 bug.
    and AN_NotificationBuilder happens on all Androids.
    Rare. But still it may be thousands of them if we make a full roll-out.

    some details:
    Caused by: java.lang.NullPointerException:
    at android.content.res.ResourcesImpl.getIdentifier (ResourcesImpl.java:252)
    at android.content.res.Resources.getIdentifier (Resources.java:1942)
    at com.stansassets.android.app.notifications.AN_NotificationBuilder.build (AN_NotificationBuilder.java:58)
    at com.stansassets.android.app.notifications.AN_AlarmNotificationTriggerReceiver.onReceive (AN_AlarmNotificationTriggerReceiver.java:83)
    at android.app.ActivityThread.handleReceiver (ActivityThread.java:3581)

    The line might be different. For example AN_NotificationBuilder.java:53;
    This bug is new in UM 2019.20


    Android 5-6 crash looks like this:
    Caused by
    at com.android.internal.policy.PhoneWindow.generateLayout (PhoneWindow.java:4058)
    at com.android.internal.policy.PhoneWindow.installDecor (PhoneWindow.java:4135)
    at com.android.internal.policy.PhoneWindow.getDecorView (PhoneWindow.java:2009)
    at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:3196)
    at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2516)
    at android.app.ActivityThread.access$900 (ActivityThread.java:165)
    at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1375)
    at android.os.Handler.dispatchMessage (Handler.java:102)
    at android.os.Looper.loop (Looper.java:150)
    at android.app.ActivityThread.main (ActivityThread.java:5621)
    at java.lang.reflect.Method.invoke (Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:794)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:684)

    This second bug is older. Marked in all previous UM versions. So it not related to AndroidX or new UM code.
     
    Last edited: Dec 16, 2019
  37. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,457
    Hi,

    Is it possible to access the flashlight or overlay functionality on android?
     
  38. UniDro

    UniDro

    Joined:
    Nov 21, 2014
    Posts:
    25
    com.stansassets.android.app.notifications.AN_NotificationManager.notify crash persists for like 2 months already.

    Does anybody also experience that?
     
  39. UniDro

    UniDro

    Joined:
    Nov 21, 2014
    Posts:
    25
    looks like fixed in the latest an_core.aar

    at com.android.internal.policy.PhoneWindow.generateLayout still persists though
     
  40. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    What kind of feature would you like to have?
     
  41. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Yes, this is fixed with 2020 version, please update.

    Yea, Still trying to figure it out with no luck. It not related to only my plugin though, more like general issue that caused by som while combination if android libraries in the project,
    You can also follow this thread:
    https://forum.unity.com/threads/ran...d-content-container-view.620545/#post-5333373
     
    UniDro likes this.
  42. EvilMermaid

    EvilMermaid

    Joined:
    Oct 17, 2017
    Posts:
    2
    Hi!

    I'am sorry to bother, but this asset enables integration with Google Fit ? I am quite green with integrations of this kind and it is not clear to me if is possible. I am looking for a way to use the pedometer while my app is closed, and I was pointed to use Google Fit API. Thanks for the attention!
     
  43. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    I had Google Fit integration a few years ago, but it was removed due to very low demand from the game developers. You are the first one who asked since it was removed.
     
  44. EvilMermaid

    EvilMermaid

    Joined:
    Oct 17, 2017
    Posts:
    2
    Ahhh ok ! Thanks a lot for the response! It's an amazing asset anyways!
     
    stanislav-osipov likes this.
  45. viking81

    viking81

    Joined:
    Jul 13, 2019
    Posts:
    17
    Thanks for a quick reply! :)
    Moved here from old forum.

    "You mean that application resolution is set to 1440px ? How you tested it? Screen.width ?
    I am asking because I want to try to reproduce this on my device, just want to make sure I am completely understand the issue and how to repo it.
    Thanks."

    Yes, I check for device resolution via 'Screen.width' for atlas swaping, but as I said this works fine in UnityEditor and in every build without AN integrated - made a copy of my Porject - removed AN -> exported to android tablet - all GOOD! Atlas swaps, native UHD rendering of my game, etc The thing is that 'atlas-swap script' fires when first Scene is loaded, also nothing to do with execution order - have tested it. It feels like some settings in the project makes Android device to use lower resolution than it's native..

    I see that something is wrong with resolution when game just starts showing splash screen (using Plus version, but even in Free). That makes me guess that something is wrong with Android build/export settings; however I'm using same Unity settings as before for good builds, the only thing new is AN + AndroidManifest.
    I'm going to try to integrate AN again in the copy project and see what happens. I also used 'jar resolver', but besides that didn't change Manifest, had to add 3 permissions like Read/Write external + Wake, that's it..

    Any ideas what is wrong here? I was surprised myself when I discovered this weird bug, the game is already published - have to fix this asap. I really like how AN works, and how many features it has, just need to fix my problem.

    EDITED: just made another test - imported AN into copied project from scratch, made build.. atlas swap works fine, game renders at native resolution on physical android device, all looks good so far. I didn't change anything via plugin settings (manifest, etc), neither did run jar resolver yet. Simply made an export with AN imported, 'default settings'.
    This is good news :) , continue testing, but this sounds promising.
     
    Last edited: Jan 31, 2020
  46. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    Hey @viking81 I wasn't able to reproduce it on my device so far. Do you have any updates on this matter? Thanks!
     
  47. stanislav-osipov

    stanislav-osipov

    Joined:
    May 30, 2012
    Posts:
    1,790
    The 2020.2 update

    Version Notes
    • Android 9 notifications bad state fix.
    • Added ability to disable Billing in the vending service and only use licensing.
    • Minor Bug Fixes
    • Added ability to Import / Export settings from the JSON.
     
    viking81 likes this.
  48. viking81

    viking81

    Joined:
    Jul 13, 2019
    Posts:
    17
    Thanks for updating me!

    So far, it's only one game which is already published at store, that have this weird problem.
    I assume you saw EDITED section in my last post - I was able to build a copy of my project with AN enabled + same settings, and have a stable game version which runs at Native resolution.
    So.. I think the problem is not Android Native asset, but something else. My apologies, it's just first tests were pointing towards AN, but after more digging I believe AN is not the one responsible for all my troubles with Native game resolution.. it's something else, something I still cannot figure out or don't know about.

    I got some advice via other Unity threads, but so far - no luck solving this issue :( The crazy thing is that I have a copy of my project that runs as intended (different package name), but it's Dev, uploaded to Google Play store, but not published in production. I also found out that some other developers have similar none-native game resolution for Android devices - game resolution is switching to 1440x900 px at start for some reason instead of rendering as native..
    I just have to keep testing more, unfortunately.
     
  49. viking81

    viking81

    Joined:
    Jul 13, 2019
    Posts:
    17
    Hi,
    what is the best method to use Games Sign-In in the game, e.g where would you recommend to place it?
    I'm following this:
    https://unionassets.com/android-native-pro/android-games-sing-in-679

    I'm using one of the Demo scripts in AN for sign-in, created and placed "GoogleManager" script in a very first scene of my game. Questions:
    • shall I use compulsory SignInFlow ? there is 'Connect' button as in example for signing in, but if player DID NOT signed-in, shall I check for that and adapt some of the functions reporting to Leaderboards, Achievements, etc ?
    • once player signed in, there is a call to SignInNoSilent(), so next time game starts it signs automatically, but I have few scenes in my game.. every time I get back to Start scene screen goes slightly dark-dimmed - seems that GoogleManager checks for Sign-in again and again. How to avoid that?
    Thanks!
     
  50. erre-rox

    erre-rox

    Joined:
    Dec 3, 2012
    Posts:
    23
    Hi @lacost ,

    We're trying to update our existing project from Android Native Plugin to Android Native Pro.
    After some issues, we've built successfully. Login, achievements and local notifications are working fine.
    In-App purchase give us this error: The item you requested is not available for purchase.
    Have you some suggestion to handle this type of error?
    I've checked the configuration but I've not found any relevant problem.

    Thanks for your help.

    Best regards,
    Andrea