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. Dismiss Notice

[Solved] Unity IAP does not work with Android IL2CPP - "Exception: No such proxy method:"

Discussion in 'Unity IAP' started by Prodigga, Jan 14, 2016.

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

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,119
    Sorry, this is a duplicate post because I wasn't aware of this forum category!

    The following error can be observed

    Code (CSharp):
    1. I/Unity(19625): Exception: No such proxy method: UnityEngine.Purchasing.JavaBridge.OnProductsRetrieved(System.String)
    2.  
    When you initialize the IAPs. Your IStoreListener never gets notified about the setup completing. (Both the success and failure methods are ignored).

    Works fine when scripting backend is set to mono.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,741
    @Prodigga

    This certainly sounds like something is getting stripped incorrectly with the IL2CPP build. Have you tried this with different stripping settings? Also, have you tried this with iOS/IL2CPP? I wonder if the same problem exists there.
     
  3. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,119
    Have not yet tried it with iOS, and we've got all the stripping options disabled.

    I will try it with iOS when I get back to the office tomorrow morning but I would think it'd work just fine since there is no other choice except IL2CPP on iOS. It seems like something is getting stripped, but appears to be something specific to Android (UnityEngine.Purchasing.JavaBridge).

    Happy to file a bug report tomorrow if needed.
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,741
    @Prodigga

    Good point. I think a bug report is the best option here. We've probably missed something specific to Android. Thanks!
     
  5. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,119
    No problem, hoping to strip out Google analytics and our custom IAP solution in favor of the built in Unity Analytic/IAP solutions ASAP :) both have been fantastic so far in my tests.
     
    nicholasr likes this.
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,741
    @Prodigga

    I'm glad to hear that the Unity solutions have been working well. Let's get them working in this case also!
     
    Prodigga likes this.
  7. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,119
    @JoshPeterson

    Bug report: https://fogbugz.unity3d.com/default.asp?761763_2t1r5fbr774bi9i1

    Not sure how I would have gone about including an example project, since most of the work is outside of Unity (Setting up a google play app, waiting hours for it to go 'live', setting up a keystore to sign your apk, that sort of jazz). I've just included a screenshot of my build settings and explained the problem as much as possible.

    Edit: Tagging @nicholasr here too, because he seems relevant :p;)
     
    Last edited: Jan 15, 2016
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,741
    @Prodigga

    Thanks, we will have a look and let you know if we need any other information.
     
    Prodigga likes this.
  9. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,119
    Hey Josh! Was wondering if there was an update on this? I know it was just the weekend so I understand if there hasn't been a chance for it to be looked at.

    I just wanted to prod you about this because I was wondering if this will get any attention at all due to Android's IL2CPP 'experimental' state? We are happy to wait for a fix if one is on the way, but I need to know so I can decide whether or not I should just stash my Unity Analytics + IAP implementation and roll back to Google Analytics + OpenIAB for now? Thanks
     
  10. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,741
    @Prodigga

    I don't see any internal updates on the bug report, other than that it has been assigned to our IAP team. I suspect that the "experimental" state of Android/IL2CPP will not have an impact on when we are able to work on this, as the IAP team (not the Android team) will likely be correcting it.

    Still, it might be best to stash the changes and jump back to a different solution. We certainly don't want to hold you up from moving forward with the project if you have a work around. Unfortunately, I can't offer more details about when this will be corrected.
     
  11. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,119
    OK thanks Josh! That's all I wanted to know. Will do. We will swap right back to Unity Analytics and IAP as soon as this is fixed.
     
  12. Cecilie

    Cecilie

    Unity Technologies

    Joined:
    Jul 6, 2012
    Posts:
    83
    Hi there!

    Just wanted to let you know that we're looking into it and have reproduced internally - you should receive a response on your bug report as well.

    Thank you for bringing this to our attention! I'll add this forum thread to the case so that we can update you when something new happens!
     
    Prodigga likes this.
  13. Cecilie

    Cecilie

    Unity Technologies

    Joined:
    Jul 6, 2012
    Posts:
    83
    Hi again!

    This bug has been fixed and will be ported to 5.4 early patch (sadly won't make it for the first release) and 5.3 patch.

    Let me know if you have any further questions!
     
    Prodigga likes this.
  14. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,119
    The next 5.3 patch?

    Will be jumping on it as soon as the patch hits, whenever it does. We have our entire system set up and ready to go, all bottled up in a feature branch in our repository haha. Can't wait to make use of the new Analytics and shed our S***ty IAP plugin.. :)
     
  15. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    426
    can i get this error if i'm still within 24 hours of publishing the iap ?
    or is it because
    i'm on 5.3.2f1
    i'm stuck there until 5.3.2p3 that fixes some other IL2CPP issues not present in f1

    Unity IAP is on [1.2.1] - 2016-1-26
     
  16. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,119
    You will keep seeing the error until Unity releases a patch to fix it. It is a problem with Unity it self, not the IAP plugin.:)
     
    AVOlight likes this.
  17. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    426
  18. Cecilie

    Cecilie

    Unity Technologies

    Joined:
    Jul 6, 2012
    Posts:
    83
    Hi there
    The fix should be in 5.3.2p4 which will be out next week! Hope that helps even if it's not the next release.
     
    Prodigga and AVOlight like this.
  19. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    426
    @Cecilie Thank you :), i very much prefer to be informed
     
    Cecilie and Prodigga like this.
  20. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,119
    @Cecilie Is there an ETA on the next patch release? Generally they come out on Wednesday's but we havn't had one this week! :)
     
  21. Cecilie

    Cecilie

    Unity Technologies

    Joined:
    Jul 6, 2012
    Posts:
    83
  22. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,119
    Oops forgot to post here, yep, I merged down my old Unity Analytics+IAP branch (Conflicts ahoy) and it all works fine now! There is some major performance issues in the latest version of IL2CPP for Android which is preventing us from getting a build out there again unless we swap to Mono. Josh said it was fixed in the next release though and that a patch will be out this week, so we will wait for that and see how we go.

    As far as Analytics + IAP's go though, it has been completely pain free to implement. Just activated it, made the correct API calls, and boom, everything works. :) Awesome job.
     
    erika_d likes this.
  23. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    i`m happy to see that someone has actually had made android il2cpp build in the first place!
    Could you share your experience about this matter?
    I use 5.3.4f1 version. SDK, JDK, NDK installed and hooked up in external tools fields and geting errors.
    Couldn`t find any solid guide about Android i2cpp arrangement.
    Any hints and tips are greatly appreciated.
    Cheers!
     
  24. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    So IL2CPP builds on Android are possible now?
    Is there any instructional web page i could checkout for steps necessary to have successful build?
    Thanks!
     
  25. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,119
    We've actually swapped back to Mono.

    IL2CPP is *mostly* working. But.. When there is a crash you just get a bunch of giberish in the crash logs, so your Google Play Console starts getting filled with bugs like this:

    Code (CSharp):
    1. at libil2cpp.GC_mark_from(GC_mark_from:1952)
    2.     at libil2cpp.GC_mark_some(GC_mark_some:980)
    3.     at libil2cpp.GC_stopped_mark(GC_stopped_mark:316)
    4.     at libil2cpp.GC_try_to_collect_inner(GC_try_to_collect_inner:444)
    5.     at libil2cpp.GC_try_to_collect_general(GC_try_to_collect_general:300)
    6.     at libil2cpp.GC_gcollect(GC_gcollect:12)
    7.     at libunity.0038cbdc(Native Method)
    8.     at libunity.003dd2d4(Native Method)
    9.     at libunity.003dd0c0(Native Method)
    10.     at libunity.003dacb4(Native Method)
    11.  
    So you keep hitting these walls with no way to proceed (What happened here? The garbage collector crashed? Ok.. I can't avoid garbage collection.). You get stuck waiting for fixes and stuff fairly often. Worth mentioning that @JoshPeterson has been great in getting a lot of our issues fixed (and quickly, too!), and I wish we could have stuck with IL2CPP to help the Unity IL2CPP find more issues.

    We've also had compatibillity issues with some plugins. (Plugins containing DLL's mostly) - even with Unity's own ones (which was the topic of this thread).

    The build times are *really* long.

    Just a really bumpy ride all round.

    We only made the swap to IL2CPP in a desperate attempt to fix some bugs that were occuring in Mono in an older version of Unity. Those bugs are fixed now so that's why we've made the switch back.

    It is important to point out that our project is fairly large and complex. It might be fine for a simple game (I havn't tried). IL2CPP is getting more and more stable with each release and it is important to remember it is still in the 'experimental' stages. It might be worth enabling IL2CPP while you develop so you can report any issues you find along the way - help make the platform more stable. You can just change back to Mono if you are ready to release and IL2CPP isn't as stable as you'd like it to be.
     
  26. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,741
    Thanks to @Prodigga for sticking with us and reporting these issues! This GC crash has been corrected in 5.3.3p3, mostly due to @Prodigga tracking down a reproducible test case we could debug.

    Also, note that the Android/IL2CPP build size should be smaller in 5.3.4p1, as we will ship that with stripped Android release builds. We've still got some work to do on Android, as the C++ builds are not compiled with optimizations on now, and the build times are too long (we have improvements int he works for both of those).

    But I'll second this statement. If you can try Android with IL2CPP now for your projects, please do so and give us feedback. That will help us tackle any more outstanding issues, and get the platform into a supported state faster.
     
    musolo and Prodigga like this.
Thread Status:
Not open for further replies.