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

Question In app with Unity 2019.2.21f1 (64-bit)

Discussion in 'Unity IAP' started by cgutierrez71, Jun 11, 2023.

  1. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69
    Hi everybody, please I need your help to update my App in google Play. I'm getting the following error:

    "We've detected that this app uses an unsupported version of Play Billing. Please upgrade to version 5 (or later) of the Billing Library to publish this app."

    I'm working with Unity 2019.2.21f1 editor (64 bit). The problem is that it only allows me to update the billing library to version 2.2.2. Is there any other way to avoid this error without updating the editor? If I update the editor I practically have to make the game from the beginning due to compatibility issues.

    Thank you very much for your comments and help.

    Carlos
    Screenshot_6.png
     
  2. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    Afaik, the editor restriction is only a preference and has nothing to do with v5 of billing client.
    We have our own implementation of Billing Client and based on that experience if you are ready for experimenting to make it work on lower unity versions, let's start diving in.

    1. Download recent version of Unity IAP from latest unity editor
    2. Go the package caches and copy purchasing folder
    3. In your current project, remove the IAP package from package manager.
    4. Place the copied folder in Assets folder (I suppose you can event place it directly in Packages folder too)
    5. Try making a build

    If you see any errors while building, do share the complete log under "CommandInvocationFailure".

    We understand how difficult it will be to upgrade/downgrade unity versions once everything is ready. So the above steps are worth trying to keep the same unity version. Let's see how it goes!

    Cheers,
    VB Team
     
    Nolex likes this.
  3. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69

    Hello team, thanks for your answer.

    I followed the steps:

    1.- I downloaded the Package: com.unity.purchasing@4.9.2 from the Unity 2020.3.0f1 (64-bit) editor. It is the highest.
    2.- I copied it to the package folder.
    3- In my Unity 2019.2.21f1 (64-bit) project, I uninstalled the InApp 2.2.2 package
    4.- I placed the copied folder in the Package folder of my project.

    I got the following errors: See image

    Screenshot_7.png
     
  4. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69

    Ok, I did something else after I got the above errors:
    1.- I downloaded the Package: com.unity.purchasing@3.0.1 from the Unity 2020.3.0f1 (64-bit) editor. Because I saw in the package manager that when you upgrade from InApp 2.x to 3.x you have to move some files to fix console errors.
    2.- I copied it to the package folder.
    3- In my Unity 2019.2.21f1 (64-bit) project, I uninstalled the InApp 2.2.2 package
    4.- I placed the copied folder in the Package folder of my project and moved the files as indicated in the snapshot attached.

    After that all the errors were gone and I was able to build the apk. But I don't know if the com.unity.purchasing@3.0.1 is enough to avoid the google play billing error. By the way, there is no version 5 in Unity billing... so?
     

    Attached Files:

  5. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    As per this post, they updated to v5 in 4.8.0.

    [LIST]
    [*]Google Play - Billing Library update from version 4.0.0 to 5.1.0 [URL='https://developer.android.com/google/play/billing/release-notes']Google Release Notes[/URL]. New Google Billing features are not supported yet, they will be included in a future major update.
    [/LIST]


    Proceed downloading that version and try to put it back in 2019.4. We will see what issues exist and try to fix. Most likely there won't be any android side issues. Even if issues exists, it's solvable!
     
    Nolex likes this.
  6. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69

    Ok but where is the package? I can't find it in the link above and not in Unity 2022.3.1f1
     
  7. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    You can see it from package manager.
    Screenshot 2023-06-13 at 11.06.15 PM.png Screenshot 2023-06-13 at 11.09.29 PM.png
     
  8. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69
  9. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69

    Ok, I did it with V4.9.2, I get 4 errors, but I have no idea how to fix them because in this case there is no information on how to move files between folders... Do you have any idea how to solve it?

    Thank you
     

    Attached Files:

  10. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    Thats fine. It's unity iap version which includes Billing client v5.

    However, I tried the suggested steps myself and found out the following
    1. While V5 billing client library has some breaking changes, it's not actually a requirement to have > 2019. Check point 3 why it's not supported by unity.
    2. To overcome those breaking changes, I need to edit the .cs native interface files which I don't think it's worth it.
    3. They used C# 8.0 features extensively in the .cs files which is not supported in 2019.4 (I fixed it though by porting back). And I see now why Unity IAP don't want to support 2019.x which is totally fair as these new C# 8 features make the code more robust with new operators.

    Finally give a try by doing the following
    1. Remove the purchasing entry from Package/manifest.json and also delete purchasing folder under Packages(if you have done as per my suggestion earlier)
    1. Extract the attached zip in to a new folder (make sure you commit this folder to your git/version control as other team members need it too)
    2. Open package manager and install the above package by pointing package.json (install via disk option)

    Give a try!
     

    Attached Files:

    Last edited: Jun 14, 2023
    Nolex likes this.
  11. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69
    Sorry my friend, but I didn't understand well :( Maybe if because my poor English This is what I understood:

    I recorded a short video:
    https://drive.google.com/file/d/1HXsmPw8ps04wP_WtvwPZRvTGrYHFMvSU/view?usp=sharing
     
  12. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    Ok. Do the following steps after you extracted the downloaded file shared above (Until 1.25 timestamp in video is correct).
    1. Copy the extract purchasing folder(4.9.0) to a folder named CustomPackages next to Assets folder.
    2. Now open Unity Package Manager from editor
    3. Click on left top + icon and Install the custom package from disk, point the CustomPackages/com.unity.purchasing@4.9.2/package.json file
    4. Done!

    You don't need to add any in manifest.json
     
    Nolex likes this.
  13. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69
    Ok, I did it. Now the console shows 30 erors
     

    Attached Files:

  14. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69
    I tryed to do it again and got only 7 errors :D This is crazy :confused:
     

    Attached Files:

  15. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    I don't see the error in my tests. Could you re-do this step again?
     
  16. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69
    Maybe the reason is that you are using Unity 2019.4 and I'm using Unity 2019.2.21 or maybe is because I use the Simple In App System (SIS) that I bought a long time ago....https://flobuk.com/
    I really don't know

    The problem with upgrading from 2019.2.21 to 2019.4 is that 2019.2.21 was the last one that supported GUIText and my game has many. I know I need to fix that, but I wanted to after uploading this version of my game.
     
  17. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69
    Hello again. To fix this, I'm trying to update the game from Unity 2019.2.21f1 (64-bit) to Unity 2019.4.0f1 (64-bit). The problem is that Unity 2019.4.0f1 (64 bit) doesn't support GUI anymore and my game has a lot of them and it would take a long time to migrate all interfaces from GUI to UI. So my question is: Is there a possibility to export the GUI package from Unity 2019.2.21f1 and import it into 2019.4.0f1 like we did with the InApp package? If I can still use GUITextures and GUIText in 2019.4.0f1, I think I might have a chance to upload the apk now.
     
  18. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    I think if you need to upgrade to 2019.4, you need to set yourself for replacing GUITexture with UI.Image as the earlier got obsolete. I don't see another alternative.
     
  19. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69
    Hello again Voxel, One question: What version of the Unity editor are you using?
    I tried your IAP 4.9.2 on an empty project and I get errors when I try to build the apk. I tested it on Unity 1019.4.40.f1 and Unity 1019.4.0f1

    Without the IAP 4.9.2 package, it compiles correctly
     

    Attached Files:

  20. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    Please click on commandInvocationFailure entry and pass the complete log.
     
  21. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69

    Ok, these are the errors:

    ----------------------------------------

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Purchasing.UnityPurchasingEditor+<>c.<.cctor>b__28_0 () (at CustomPackages/com.unity.purchasing@4.9.2/Editor/UnityPurchasingEditor.cs:185)
    UnityEditor.EditorApplication.Internal_CallDelayFunctions () (at <7105be432fb64891b07085914e6cd5c1>:0)

    ----------------------------------------

    Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

    > Configure project :launcher
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only

    > Task :launcher:preBuild UP-TO-DATE
    > Task :unityLibrary:preBuild UP-TO-DATE
    > Task :unityLibrary:preReleaseBuild UP-TO-DATE
    > Task :launcher:prepareLintJar
    > Task :unityLibrary:checkReleaseManifest
    > Task :unityLibrary:processReleaseManifest
    > Task :unityLibrary:compileReleaseAidl NO-SOURCE
    > Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
    > Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
    > Task :unityLibrary:generateReleaseBuildConfig
    > Task :unityLibrary:generateReleaseResValues
    > Task :unityLibrary:generateReleaseResources
    > Task :launcher:preReleaseBuild
    > Task :launcher:compileReleaseAidl NO-SOURCE
    > Task :launcher:compileReleaseRenderscript NO-SOURCE
    > Task :launcher:checkReleaseManifest
    > Task :launcher:generateReleaseBuildConfig
    > Task :launcher:generateReleaseSources
    > Task :launcher:mainApkListPersistenceRelease
    > Task :launcher:generateReleaseResValues
    > Task :launcher:generateReleaseResources
    > Task :launcher:createReleaseCompatibleScreenManifests
    > Task :unityLibrary:packageReleaseResources
    > Task :launcher:processReleaseManifest
    > Task :unityLibrary:generateReleaseRFile
    > Task :unityLibrary:prepareLintJar
    > Task :unityLibrary:generateReleaseSources
    > Task :unityLibrary:javaPreCompileRelease
    > Task :launcher:mergeReleaseResources
    > Task :launcher:processReleaseResources FAILED

    > Task :unityLibrary:compileReleaseJavaWithJavac

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
    Use '--warning-mode all' to show the individual deprecation warnings.
    See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
    19 actionable tasks: 19 executed

    UnityEngine.GUIUtility:processEvent (int,intptr)

    ----------------------------------------


    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':launcher:processReleaseResources'.
    > Android resource linking failed
    C:\Users\Carlos\My project (2)\Temp\gradleOut\launcher\build\intermediates\merged_manifests\release\AndroidManifest.xml:43: AAPT: error: unexpected element <queries> found in <manifest>.


    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    * Get more help at https://help.gradle.org

    BUILD FAILED in 10s
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

    UnityEngine.GUIUtility:processEvent (int,intptr)

    ----------------------------------------

    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Unity/Hub/Editor/2019.4.40f1/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

    stderr[
    Note: C:\Users\Carlos\My project (2)\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':launcher:processReleaseResources'.
    > Android resource linking failed
    C:\Users\Carlos\My project (2)\Temp\gradleOut\launcher\build\intermediates\merged_manifests\release\AndroidManifest.xml:43: AAPT: error: unexpected element <queries> found in <manifest>.


    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    * Get more help at https://help.gradle.org

    BUILD FAILED in 10s
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    ]
    stdout[
    Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

    > Configure project :launcher
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only

    > Task :launcher:preBuild UP-TO-DATE
    > Task :unityLibrary:preBuild UP-TO-DATE
    > Task :unityLibrary:preReleaseBuild UP-TO-DATE
    > Task :launcher:prepareLintJar
    > Task :unityLibrary:checkReleaseManifest
    > Task :unityLibrary:processReleaseManifest
    > Task :unityLibrary:compileReleaseAidl NO-SOURCE
    > Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
    > Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
    > Task :unityLibrary:generateReleaseBuildConfig
    > Task :unityLibrary:generateReleaseResValues
    > Task :unityLibrary:generateReleaseResources
    > Task :launcher:preReleaseBuild
    > Task :launcher:compileReleaseAidl NO-SOURCE
    > Task :launcher:compileReleaseRenderscript NO-SOURCE
    > Task :launcher:checkReleaseManifest
    > Task :launcher:generateReleaseBuildConfig
    > Task :launcher:generateReleaseSources
    > Task :launcher:mainApkListPersistenceRelease
    > Task :launcher:generateReleaseResValues
    > Task :launcher:generateReleaseResources
    > Task :launcher:createReleaseCompatibleScreenManifests
    > Task :unityLibrary:packageReleaseResources
    > Task :launcher:processReleaseManifest
    > Task :unityLibrary:generateReleaseRFile
    > Task :unityLibrary:prepareLintJar
    > Task :unityLibrary:generateReleaseSources
    > Task :unityLibrary:javaPreCompileRelease
    > Task :launcher:mergeReleaseResources
    > Task :launcher:processReleaseResources FAILED

    > Task :unityLibrary:compileReleaseJavaWithJavac

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
    Use '--warning-mode all' to show the individual deprecation warnings.
    See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
    19 actionable tasks: 19 executed
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <dd2e71f8d45046b88d6d3169a8084aec>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <dd2e71f8d45046b88d6d3169a8084aec>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <dd2e71f8d45046b88d6d3169a8084aec>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <dd2e71f8d45046b88d6d3169a8084aec>:0)
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <dd2e71f8d45046b88d6d3169a8084aec>:0)
    Rethrow as GradleInvokationException: Gradle build failed
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <dd2e71f8d45046b88d6d3169a8084aec>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <dd2e71f8d45046b88d6d3169a8084aec>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <dd2e71f8d45046b88d6d3169a8084aec>:0)
    Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <dd2e71f8d45046b88d6d3169a8084aec>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <dd2e71f8d45046b88d6d3169a8084aec>:0)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <dd2e71f8d45046b88d6d3169a8084aec>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <dd2e71f8d45046b88d6d3169a8084aec>:0)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <7105be432fb64891b07085914e6cd5c1>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    ----------------------------------------
    Build completed with a result of 'Failed' in 265 seconds (265168 ms)
    UnityEngine.GUIUtility:processEvent (int,intptr)

    ----------------------------------------
    UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002bf] in <7105be432fb64891b07085914e6cd5c1>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <7105be432fb64891b07085914e6cd5c1>:0
    UnityEngine.GUIUtility:processEvent (int,intptr)

    ----------------------------------------
     
  22. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    Try once setting TargetAPI to 33 in player settings and if it prompts to update sdk proceed with it and build.

    If it doesn't solve, try the below steps.

    1. Delete "C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2" folder
    2. Copy that folder from Android studio. Install that folder if it doesn't exist via android studio software manager.
     
  23. Nolex

    Nolex

    Joined:
    Dec 10, 2010
    Posts:
    115
    @Voxel-Busters, First of all, I want to thank you for your contribution to this topic! Respect!

    I tried using your modified package com.unity.purchasing@4.9.2.zip but it didn't work for me. The APK file builds successfully, but purchases did not work.

    But, I found a version that works - com.unity.purchasing@4.8.0. I rewrote the code of this package for Unity 2019 and everything works successfully, this package uses Google Play Billing Library 5.1.0 which is suitable for current requirements. Check attachments.

    I tested this solution on three games - in my case it works, but I make no guarantees. :)

    Unity Version:
    Unity 2019.4.40f1
    Target API 33 (Android 13)
    gradle-6.1.1
     

    Attached Files:

    blevok and Voxel-Busters like this.
  24. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    Great! I actually didn't test it throughly as we use our own implementation for billing.

    Upgrading Unity for an existing project will be a nightmare for everyone. So, wanted to help on it as much as I can :). I need to thank you for joining me in solving the problem.

    Anyways, thanks for sharing your implementation. It will definitely help someone!

    Cheers,
    VB Team