Search Unity

[Solved] Can't use IAP on version 5.5

Discussion in 'Unity IAP' started by mushdevstudio, May 21, 2017.

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

    mushdevstudio

    Joined:
    May 9, 2014
    Posts:
    37
    The new version of IAP can not be used with version 5.5 of unity as the GooglePlay.aar has an android manifest file with targetSDK set to 24 but 5.5 only knows up to targetSDK 23 so won't build with a merge manifest error.

    I am stuck on version 5.5 because 5.6 breaks rigid body interpolation - so weird to break something so fundamental to 3D games programming. The fix is apparently 2017.1 but I have tried beta and it distorts and twists some of my animated models so looks like 5.5.3p3 is the last good build. This unfortunately means that I can not build Android as Vulkan and also that the new IAP won't work because they require API24 for targetSDK and 5.5.3p3 does not support API 24 - wow after 3 years of work I am so frustrated by this!



    "In order to call GetTransformInfoExpectUpToDate, RendererUpdateManager.UpdateAll must be called first."
     
  2. nicholasr

    nicholasr

    Joined:
    Aug 15, 2015
    Posts:
    183
    Hi @mushdevstudio - thank you for reaching out - about Daydream and the latest IAP, yes that is absolutely correct. I am sorry to hear this interfered.

    I don't know about rigid body interpolation.

    To help explain the IAP portion of your post, in order for the store to support (probably predictably) new Daydream VR purchasing modes such as an immersive heads-up Purchasing Activity omitting a titlebar, I updated the manifest for all GooglePlay builds.

    Here's a blurb on updating. And note, I don't necessarily recommend leaving this API24 target in place, but merely to install it, making its XML resources available at build-time.

    - GooglePlay - "Android SDK API Level 24 (7.0)" (or higher) must now be installed. To upgrade, either perform the one-time step of setting the project's "Android Player Settings > Other Settings > Minimum API Level" to 24, building an APK, then resetting to the project's previous value. Or, run the `android` Android SDK Manager tool manually and install "Android 7.0 (API 24)". Addresses build error messages: "Unable to merge android manifests." and "Main manifest has \<uses-sdk android:targetSdkVersion='23'> but library uses targetSdkVersion='24'". Note the Minimum API Level support is unchanged; merely the installation of API 24 SDK is now required for Daydream VR. (origin)​

    Since 5.5 didn't "know about" Android API 24, only 23, the more difficult update technique of running the Android SDK Manager can work. Alternatively if you have a copy of 5.6+ also installed (I install many, on MacOS renaming each Unity folder to disambiguate, to e.g. /Applications/Unity_5.5.1p4/), since 5.6+ know about API 24, they support the easier technique of going to the Player Settings Inspector, tweaking the setting, and then doing just a single rebuild to install the updated resources.

    iap-1.11-targetSdkVersion.png
    Unity 2017.1.0a5​

    In order to help people not to bump into this too painfully I added some notes to the IAP Changelog (in the unitypackage) and forum, and I am open to considering additional approaches. I want to balance "it just works" of having Daydream VR "just work", versus requiring installation steps. I made the error message less gnarly, also, to help point out the fact it was an API24 issue and not the naive error, which initially showed up as some deep Java issue.

    I hope this helps un-stuck the build.
     
    Last edited: May 24, 2017
    unityjingyao likes this.
  3. nicholasr

    nicholasr

    Joined:
    Aug 15, 2015
    Posts:
    183
  4. mushdevstudio

    mushdevstudio

    Joined:
    May 9, 2014
    Posts:
    37
    Thank you so much nicholasr. Your trick of compiling in 5.6 at targetSdkVersion 24 then switching back worked perfectly.
     
  5. mushdevstudio

    mushdevstudio

    Joined:
    May 9, 2014
    Posts:
    37
    I must say nicholasr the codeless IAP that you have made is truly awesome - well done.
     
    nicholasr and ap-unity like this.
  6. mushdevstudio

    mushdevstudio

    Joined:
    May 9, 2014
    Posts:
    37
    @ap-unity I have implemented the codeless IAP and it is working like a charm on both android and ios. The only thing I can't work out is how (when starting my app) to check for what non consumables have been purchased. I was hoping I could do a quick check and then unlock the purchased non consumables then and there each time. This would avoid me locally saving a setting which could be tampered with. Any ideas?
     
  7. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    Unity IAP does not have any inventory management features, so we don't keep track of what items a user has purchased. You could save this information locally or you can save a record of this on a server. We leave the implementation details to whatever best suits your app.
     
  8. GiyomuGames

    GiyomuGames

    Joined:
    Jan 12, 2015
    Posts:
    80
    @nicholasr Hi! I am developing on Unity 2017.1.0b9 and use Unity monetization system. I need to set the target SDK to 23 but I get the manifest conflict. If I build with SDK 24 as a target it works fine of course but it doesn't work when I switch back to 23. Is there anything I can do?
     
    Last edited: Jul 7, 2017
  9. nicholasr

    nicholasr

    Joined:
    Aug 15, 2015
    Posts:
    183
    @GiyomuGames Thanks for reaching out with this issue. What are your Min and Target API Level values?

    [ Mod - this post could go to a new thread since this isn't a 5.5 issue. ]

    When using Unity 2017.1.0f3 and setting the "Min API Level" to 16, leaving the "Target" to Automatic, with the most basic Unity project (only including the Unity IAP SDK), the manifest reliably generates for me.

    Thanks in advance for understanding my need for additional details - it looks like I am not doing the right steps to break manifest generation.
     
  10. GiyomuGames

    GiyomuGames

    Joined:
    Jan 12, 2015
    Posts:
    80
    Hi nicholasr!

    Thanks for answering. Min API is 16 and for the Target API well I wanted to put 23 but that generated the manifest issue.

    FYI I have corrected the problem which made me want to put 23 target API in the first place, so it's not a problem now. My problem was related to URI in intent for android which must be provided by FileProvider for android nougat IF the target API is 24 or more. Had I been able to put 23 it would have worked fine, but because I couldn't I have created (thank you internet people) a plugin to use the FileProvider. I guess it's better to comply to this new guideline anyway, it was just a bit of a headache to make it work.
     
    nicholasr likes this.
  11. elenzil

    elenzil

    Joined:
    Jan 23, 2014
    Posts:
    73
    for folks who may be coming along,
    in our case we have a somewhat complex gradle build,
    and the key to getting past this was to change the "compileSdkVersion" and "buildToolsVersion" in various gradle files to 24. our minVersion and targetVersions were able to remain 19 and 21, respectively.

    .. and naturally you need to have SDK version 24 installed on your build system.
     
Thread Status:
Not open for further replies.