Git Product home page Git Product logo

play-unity-plugins's Introduction

Google Play Plugins for Unity

Overview

The Google Play Plugins for Unity provide C# APIs for accessing various Play services at runtime from within the Unity Engine. These plugins also provide various Unity Editor features for building an app that can be published on Google Play Console.

Version support

These plugins support Unity 2018.4 or later, as well as Unity 2017.4.40.

Note: some features depending on async tasks are only available on Unity 2018.4 or later.

Support for older versions of Unity (including 5.6) was removed after version 1.4.0 because Google Play requires that apps published with 32 bit native libraries also provide 64 bit native libaries.

Downloading the plugins

There are 3 different options for obtaining the plugins:

  • Download individual plugins as .unitypackage files or Unity Package Manager (.tgz) files from Google APIs for Unity

  • Download the latest release from this project's releases page

  • git clone this repository into the Assets folder of your Unity project

Installing the plugins

For all cases except git clone follow the instructions to Install Google packages for Unity.

Developers using git clone must also install the External Dependency Manager for Unity (EDM4U) using either the .tgz or .unitypackage available on the Google APIs for Unity archive page.

If EDM4U is not installed, the project won't be able to fetch necessary Java dependencies such as the Play Core library, resulting in runtime errors.

Feature plugins

These plugins add features, such as Google Play Instant support, to a Unity project.

Android App Bundle

com.google.android.appbundle

The Google Android App Bundle package provides access to the latest Android App Bundles features, such as Play Asset Delivery.

Refer to the documentation and Editor API reference for more information.

Play Asset Delivery

com.google.play.assetdelivery

Play Asset Delivery enables AssetBundles and other assets to be packaged into an Android App Bundle and delivered through Google Play.

Refer to the documentation and Runtime API reference for more information.

Play In-App Review

com.google.play.review

Play In-App Review lets you prompt users to submit Play Store ratings and reviews without the inconvenience of leaving your game.

Refer to the documentation and Runtime API reference for more information.

Play In-App Update

com.google.play.appupdate

Play In-App Update lets you keep your app up-to-date on your users’ devices and enables them to try new features, as well as benefit from performance improvements and bug fixes.

Refer to the documentation and Runtime API reference for more information.

Play Instant

com.google.play.instant

The Google Play Instant package simplifies the conversion of an Android app into an instant app that can be deployed through Google Play.

Refer to the documentation, Runtime API reference, and Editor API reference for more information.

Play Integrity API

com.google.play.integrity

The Play Integrity API helps protect your apps and games from potentially risky and fraudulent interactions, allowing you to respond with appropriate actions to reduce attacks and abuse such as fraud, cheating, and unauthorized access.

Refer to the documentation and Runtime API reference for more information.

Support plugins

These plugins provide shared functionality to some of the above plugins, but they don't provide any features when installed separately.

Play Common

com.google.play.common

The Google Play Common package provides common files required by some Google Play packages, such as Play Instant.

Play Core

com.google.play.core

The Google Play Core package provides the Play Core Library required by some Google Play packages, such as Play Asset Delivery.

[Deprecated] Play Billing

com.google.play.billing

The Google Play Billing Plugin for Unity will not be receiving updates going forward. This means that it will stay on Play Billing Library 3 and app updates past Nov 1, 2022 will no longer be able to use the plugin.

Package contains Google Play Billing Library, which is required to sell digital content and subscriptions in games distributed via Google Play. This new version of the Google Play Billing Library provides all of the features available in the current Java and Kotlin versions.

To use this package, you must agree to the licenses for this Google Play Plugin and the Google Play Billing Library. If you do not agree with the licenses, you may not use this package.

Refer to the documentation and Runtime API reference for more information.

Known Issues

Play Asset Delivery support built into Unity

Recent versions of Unity, such as 2019.4.29, 2020.3.15, and 2021.1.15 (or later), include built-in support for Play Asset Delivery (PAD). These Unity versions allow developers to specify asset packs by placing assets in .androidpack folders within their project. These versions also change the "Split Application Binary" option to use asset packs instead of OBBs.

The build method used by the Google Play Plugins for Unity is incompatible with these features and will ignore assets placed in the .androidpack folders.

Play Core library conflicts

When building an Android App Bundle with Unity's build system (e.g. "File > Build and Run"), Unity may include the monolithic Play Core library in a way that causes conflicts with the new Play libraries included by Google Play Plugins for Unity.

To resolve these conflicts, follow the steps below:

  1. Enable "Custom Main Gradle Template" in "Android Player > Publishing Settings"
  2. Enable "Patch mainTemplate.gradle" in "Assets > External Dependency Manager > Android Resolver > Settings"
  3. Include this empty monolithic Play Core library as a local maven repository

These steps will allow EDM4U to update the mainTemplate.gradle to include the empty monolithic Play Core library as a gradle dependency. This will override the version of the Play Core library included by Unity and resolve the duplicate class errors and manifest merger failures.

Data Collection

The Google Play Plugins for Unity may collect version related data to allow Google to improve the product, including:

  • App’s package name
  • App’s package version
  • Google Play Plugins for Unity's version

This data will be collected when you upload your app package to the Play Console. To opt-out of this data collection process, remove the packagename.metadata.jar file found under each plugin's Runtime/Plugins folder.

Note, this data collection related to your use of the Google Play Plugins for Unity and Google’s use of the collected data is separate and independent of Google’s collection of library dependencies declared in Gradle when you upload your app package to the Play Console.

Related plugins

Google Play Games plugin for Unity

The Google Play Games plugin for Unity enables access to the Google Play Games APIs from Unity.

External Dependency Manager for Unity (EDM4U)

The External Dependency Manager for Unity provides tools for handling dependencies such as Android libraries (AARs) and iOS CocoaPods. The Google Play Plugins for Unity depend on EDM4U to resolve AAR dependencies such as the Play Core library.

play-unity-plugins's People

Contributors

ab-rdarts avatar jamcohen avatar paulohgodinho avatar ququ9 avatar salvobunetto avatar thanwah avatar trapezoid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

play-unity-plugins's Issues

why can't assetbundle named "abc.bytes"?

i name my assetbundles "xxx.bytes", It shows me an error "A Play-delivered AssetBundle's name must start with an English letter and can only contain letters, numbers, and underscores. Please regenerate the AssetBundle with a new name.". I am not quite understand.. so many resources named with postfix ".bytes". why can't use postfix ".bytes"?

Asset Delivery - Unity - Lag/Crash with some devices

Hello Devs,

We started using asset delivery on Unity. For our knowledge some devices (especially most of Huawei's) lagging/crashing if you do not define/read asset bundle without coroutine. For example;

this method cause stability problems;
AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "commonassets"));

but this method inside of the coroutine works charmingly;

using (www = WWW.LoadFromCacheOrDownload(Path.Combine(Application.streamingAssetsPath, "commonassets"), 0))
        {
            yield return www;
            if (www.error != null)
                throw new Exception("WWW download had an error:" + www.error);
            AssetBundle bundle = www.assetBundle;

        }

When we switched to the AssetDelivery suggested install-time usage did not help us.

AssetBundle assetBundle = bundleRequest.AssetBundle;

// You may choose to load scenes from the AssetBundle. For example:
string[] scenePaths = assetBundle.GetAllScenePaths();
SceneManager.LoadScene(scenePaths[path-index]);

Since this throws "Null reff." we used this and it worked -at least game opens-;

PlayAssetBundleRequest bundleRequest2 = PlayAssetDelivery.RetrieveAssetBundleAsync("tutorialscene");
        yield return bundleRequest2;
        if (!bundleRequest2.IsDone)
        {
            Debug.Log(bundleRequest2.Error.ToString());
            yield break;
        }
        AssetBundle assetBundle2 = bundleRequest2.AssetBundle;

Then we realized this method causing the same problem with the first method
AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "commonassets"))

After facing the same problem with the directly reading asset bundle method we tried other suggested method from the integration page which is;


    private IEnumerator LoadAssetBundleCoroutine(string assetBundleName)
    {
        
        PlayAssetBundleRequest bundleRequest =
            PlayAssetDelivery.RetrieveAssetBundleAsync(assetBundleName);

        

        while (!bundleRequest.IsDone)
        {
            if (bundleRequest.Status == AssetDeliveryStatus.WaitingForWifi)
            {
                var userConfirmationOperation = PlayAssetDelivery.ShowCellularDataConfirmation();

                // Wait for confirmation dialog action.
                yield return userConfirmationOperation;

                if ((userConfirmationOperation.Error != AssetDeliveryErrorCode.NoError) ||
                   (userConfirmationOperation.GetResult() != ConfirmationDialogResult.Accepted))
                {
                    // The user did not accept the confirmation - handle as needed.
                }

                // Wait for Wi-Fi connection OR confirmation dialog acceptance before moving on.
                yield return new WaitUntil(() => bundleRequest.Status != AssetDeliveryStatus.WaitingForWifi);
            }

            // Use bundleRequest.DownloadProgress to track download progress.
            // Use bundleRequest.Status to track the status of request.

            yield return null;
        }

        if (bundleRequest.Error != AssetDeliveryErrorCode.NoError)
        {
            // There was an error retrieving the bundle. For error codes NetworkError
            // and InsufficientStorage, you may prompt the user to check their
            // connection settings or check their storage space, respectively, then
            // try again.
            yield return null;
        }

        // Request was successful. Retrieve AssetBundle from request.AssetBundle.
        AssetBundle assetBundle = bundleRequest.AssetBundle;

    }

But unfortunately, nothing changed. Right now the game has stability problems, we use to (2 weeks before) have daily 15k-20k downloads, but yesterday it was 500. And the game's rating felt to the ground.

Is there any suggestion?

We tried to dig inside of the asset-delivery scripts to find out how the system gets bundles exact location address to use it inside of the WWW function of unity but it also throws null when we tried.

Thanks in advance

Asset bundles in subfolders cause errors in play delivery

When creating asset bundles the main method of organisation is to split bundles into folders based on the asset bundle names.
For example: "subfolder/bundle1".
When trying to add this bundle to the asset delivery configuration it gives the error "An Asset bundle file with this name is missing from the folder"
As far as i can see it looks like only asset bundles in the root asset bundle directory is supported which seems wrong.
image

Unless I'm missing something it seems like its just not supported.
Asset bundles in subfolders should be supported to be included in asset delivery packages.

Play Billing - Declined Deferred purchases never return as failed.

Hi,

I implemented your extended version of Unity IAP to handle deferred purchases/slow credit card transactions in our game. The plugin seems to be working fine otherwise but I encountered a problem while testing deferred purchases that decline after a few minutes. After the client receives a deferred purchase the plugin never seems to inform when the purchase actually fails. This is a problem as we want the user to be able to start and handle only one purchase at a time. Because the failure callback never returns the client waits infinitely for a message to clear the purchase from the queue. The flow goes like this:

  1. Start IAP with slow test card
  2. Show info for player that the purchase is still being handled, they can continue playing
  3. Client has a deferred purchase stored and prevents any further purchases before the first one is handled properly.
  4. The purchase is left hanging so I can never "finish" the transaction and allow the player to initiate other purchases.

Also if I restart the game, the plugin doesn't inform about any pending transactions in this case. And if I try to purchase the same item again it immediately returns with a "duplicate transaction"-failure. I noticed that the purchase does clear automatically after a while so I can initiate the purchase later without duplicate errors.
Is this intended behaviour? From my point of view the deferred purchases should always invoke the failure callback whenever the transaction is declined and I should be able to clear that transaction from any sort of queue so the user can try to initiate that purchase again if they so choose.

Asset Bundle Variant naming issue

Hello there,
Our goal is to give different built in bundles according to the devices using the unity asset variant system.
But we got stuck in the naming restriction of the Asset Delivery system. Because Asset Variant system uses bundle.ld and bundle.hd as naming.
Is there any way we can overcome this situation?

Asset delivery - no master slice avalible

Hi, I have working implementation of play asset delivery - but Iam getting error "no master slice avalible for bundle 'xxx'" for some of my bundles. What can cause this issue? This error occures only in "on demand" mode - install time mode works fine

Feature Request - Unity Cloud Build integration

This request requires at least some work on the Unity Cloud Build team and I'll reach out to them as well, but wanted to check in with this team as well.

Unity Cloud Build is a CI service provided by Unity that can build Unity projects easily, including support for building .aabs.

I noticed that in order to have asset packs build into the .aab (confirmed by inspecting the final .aab), you have to use the Google > Build Android App Bundle tool. If you build an .aab 'normally' using Build Settings > Build with the 'Build App Bundle' option checked, that .aab doesn't have the asset packs. That implies there must be something different about the Google specific approach vs the normal Unity approach for building .aab.

I saw in the docs for Asset Delivery that there is an API for building the .aab (https://developer.android.com/guide/app-bundle/asset-delivery/build-unity), although Unity Cloud Build just builds the .aab the 'normal' way. If there were a way to configure Unity to include the asset packs as part of the normal .aab build process somehow, that would be ideal.

Not sure if this is possible or if this is even the right place to integrate, but figured I'd ask about the difference between the 'normal' vs 'Google' option for building .aab in Unity.

How to Read Raw Asset using Play Asset Delivery at Runtime?

In my project, I have files that are not assets recognized by Unity (and thus cannot be packed into a Unity AssetBundle). Currently, I put them in StreamingAssets, which is then packed into OBB, and I read them back from OBB at runtime.

I found from the API that I can create a Play Asset Pack with raw assets (i.e. any arbitrary file, assuming I understood it correctly).
https://developer.android.com/reference/unity/class/Google/Android/AppBundle/Editor/AssetPack#assetpackdirectorypath

/// <summary>
/// Location on disk of a folder containing raw asset files.
/// </summary>
/// <exception cref="ArgumentException">
/// Thrown on set if either <see cref="AssetBundleFilePath"/> or
/// <see cref="CompressionFormatToAssetBundleFilePath"/> are non-null.
/// </exception>
public string AssetPackDirectoryPath

But then I found that the Runtime API does not have a way to read those raw assets back. I can only find PlayAssetBundleRequest class which only has an AssetBundle property.
https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest

I looked everywhere and did not find any relevant API. Maybe I am not looking very closely? Thanks in advance!

Keep game version when switch from Instant to Installed

Hi,
I'd like to suggest a little improvement.
When I switch from Instant to Installed and vice-versa the game version remain the same.
It would be nice if the plugin keep the version for each one.
This is very useful because Instant version must always have a version number smaller than the current Installed one, so what I normally do is to keep them in a separate range.
For instance:
Instant Version 2.9.1.209 (Bundle Version Code 232)
Installed 2.9.2.5 (Bundle Version Code 1005)

This way I can update the Instant version without have to update the Installed one.

Missing Java classes with proguard

When creating a ReviewManager in Unity 2018.4.24f1, I get the following exception:

AndroidJavaException: java.lang.ClassNotFoundException: com.google.android.play.core.review.ReviewManagerFactory

This application is built with gradle and proguard enabled. When I manually copy the proguard rules from the packages "Proguard" folder to my proguard-user.txt file, the exception goes away. The proguard rules in the "Google Play In-App Reviews" UPM package and other Google Play UPM package dependencies are not referenced in the generated build.gradle script. The documentation doesn't say anything about having to manually adding these to our proguard user rules file. Unity's package layout documentation says nothing about "Proguard" folders being a standard way to include proguard rules for Android builds, nor does the EDM4U system seem to allow for this either.

Implement ITransactionHistoryExtensions

ITransactionHistoryExtensions is useful for determining more information about why a purchase failed.
Currently trying to access results in an exception:

ArgumentException: No binding for type UnityEngine.Purchasing.ITransactionHistoryExtensions
      at UnityEngine.Purchasing.PurchasingFactory.GetExtension[T]

Ideally it would have the error code and debug message that gets logged on failure.

ANR exception

I am getting the ANR exception in PlayStore Console .

Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{20915a2 u0 com.packages.name/com.google.android.play.core.assetpacks.AssetPackExtractionService}.

How to slove this?

Few user also complained that asset bundle didn't download. It was stuck at some point. Didn't progress further.
If I get any error during the asset bundle download, I will start downloading once again until the download is successful.

I will put 5 to 6 asset bundle at a time for download.
Below I have written the code to download 5 to 6 asset bundle.

//---------------------------------------------------------------------------------
for(int i=0;i<assetbundleNames.Count;i++)
{
StartCoroutine( DownloadAssetBundle(assetbundleNames[i]));
}

IEnumerator DownloadAssetBundle(string assetBundleName)
{
PlayAssetBundleRequest bundleRequest = PlayAssetDelivery.RetrieveAssetBundleAsync (assetBundleName);
while (!bundleRequest.IsDone)
{
yield return null;
}
if (bundleRequest.Error != AssetDeliveryErrorCode.NoError)
{
// Will start Download Once again
DownloadAssetBundleOnceAgain(assetBundleName);
}
else
{
// No error . So Will Cache Asset Bundle
AssetBundle assetBundle = bundleRequest.AssetBundle;
}
}
//---------------------------------------------------------------------------------

How can I solve this?

I am using
- Unity 2018.4.20
- Play Asset Plugin Version 1.1

Play Asset Delivery - can't use profiler

Using the "Build and Run" option from the "Google" menu bar item while having the "development" and "autoconnect profiler" checkboxes marked, the built player is unable to connect to the unity profiler. Unity version 2019.4.5f1

Issue with PlayAssetDelivery.RetrieveAssetBundleAsync()

We have multiple assetpacks that we retrieve during startup depening on how many acts a player has unlocked.

Most times everything works as it should. But we have during testing multiple times recieved an exception when calling:
PlayAssetDelivery.RetrieveAssetBundleAsync()

The exception says: "There is already an active request for AssetBundle: "

The problem with this issue is that we are not sure of how to handle this. Because the RetrieveAssetBundleAsync() does not return any PlayAssetBundleRequest. Which means we have no way of canceling any request. This issue persist even if we restart our game, which seems to indicate this is outside of our game. Then suddenly later it can disapear, and the bundle downloads correctly again.

Please advice on how we should handle this issue. We currently try to call the removeassetbundle, after we've waited a certain time. But it doesn't help either.

AAB limit size?

hello, we used to use APK+OBBs to publish our game, the apk size is 90MB, and the OBBs is about 2GB. And now we are going to use AAB to publish our game, but we found some problems while using AAB.

The download size limit for all asset packs in an Android App Bundle is 2 GB. like I just mentioned, the OBBs is 2GB, if we use ABB, we need to build 3 types of asset(Play Asset Delivery), TextureCompressionFormat.Etc2, TextureCompressionFormat.Astc, TextureCompressionFormat.Default, and the delivery mode is install-time, so the total size will up to 6GB, so what's best practice for this issue? Thanks.

If we use the delivery mode "DoNotPackage", just need to download/load those AssetBundles as usual? Such as upload the AssetBundles to the server, and download/load.....

Concept doubts about Asset Delivery

I'm ashamed to admit that I've been stuck in this for a whole week and I'm never felt more stupid.

So I'm gonna ask plain straight:

Situation

  • I have a scene with only one image in the center.
  • I have two sprites in, for example, Assets/Images/en/Test.png & Assets/Images/es/Test.png.
  • I want this image to get automatically the correct sprite depending of user's location when that user download the app from Google Play, and never download the other unused sprite.

Can anyone please explain me how can I archive that?

I'm so appreciated for your time, really!


Additional Information

I'm using Unity 2019.3.15f1.
I'm using .NET 4.x and Mono Scripting Backed.
I'm using Google App Bundle, Google Play Delivery/Common/Core 1.1.0 all.
I'm using Asset Bundle Browser.

I tried with Addressables but found that it's not compatible yet.
I tried to convert the folders "Assets/Images/en" and ".../es" with two separate bundles and then set them in Asset Delivery (Install Time Mode) to finally Build them in my android phone with Google -> Build & Run.

I had a look in the samples but I found nothing that clears my problems.


Key Doutbs

  • How unity/.aab knows which asset need to get for each language?
  • How the gameobject of the Image knows the reference of the correct sprite? Do I need to create some sort of key for it?
  • Has the resources / bundles to be in one reserved/specific folder or to be named in an specific nomenclature?
  • Does exists some similarity with android "@drawable/image.png" -- "res\drawable-en\image.png" system?

Testing

  • How can I test it? If my phone's language system is in spanish and I set the default Image's sprite with the "Assets/Images/en/Test.png" will it get automatically the ".../es/Test.png" instead when installed?
  • Does the "Google -> Build & Run" works with all of that o do I need to use "bundletool" option for testing?

Thanks again for everything and sorry to bother you all.

Allow for re-run if connection to device fail

I think most developers are using IL2CPP to build their projects (because of the 15MB limit) and it normally take a lot of time.
If the build finish without issue but for some reason the connection to the device fail, we have to re-run the entire build.
I'm talking about the menu Google -> Build and Run.
Would it be possible to allow for a retry directly on the popup screen we see after the build?
Also I think we should have the possibility to select the device if we have multiple devices connected.
At the moment it fail with an adb error (multiple devices etc)
It would also be nice to have a specific menu/button to simply install/run the last build.
This can be useful if we want to start a new test from scratch (no current state in the device) but we don't want to wait for a new entire build.

NullReferenceException in ParsePurchaseResult

We have a null reference thrown by Google Play Billing, with the following stacktrace:

Google.Play.Billing.GooglePlayStoreImpl.ParsePurchaseResult (UnityEngine.AndroidJavaObject billingResult, UnityEngine.AndroidJavaObject javaPurchasesList) (at <00000000000000000000000000000000>:0)
System.Action`2[T1,T2].Invoke (T1 arg1, T2 arg2) (at <00000000000000000000000000000000>:0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJavaProxy.Invoke (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0)
UnityEngine._AndroidJNIHelper.InvokeJavaProxyMethod (UnityEngine.AndroidJavaProxy proxy, System.IntPtr jmethodName, System.IntPtr jargs) (at <00000000000000000000000000000000>:0)
Rethrow as TargetInvocationException: Google.Play.Billing.Internal.PurchasesUpdatedListener.onPurchasesUpdated(UnityEngine.AndroidJavaObject,UnityEngine.AndroidJavaObject)
UnityEngine.AndroidJavaProxy.Invoke (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0)
UnityEngine._AndroidJNIHelper.InvokeJavaProxyMethod (UnityEngine.AndroidJavaProxy proxy, System.IntPtr jmethodName, System.IntPtr jargs) (at <00000000000000000000000000000000>:0)

From our own investigation, it appears that the java purchase list is null and the store is commonly trying to reconnect.

Most reports also have the following log associated:
Google Play Store: Purchase failed with error code 'Error' and debug message: ''
And a null debug message isn't too useful to help track this sort of thing, but that might be best as a separate issue?

Proper way to load an AB contained in an asset pack which has multiple ABs.

We have a sample project to illustrate the usage of Dynamic Asset Delivery, however we cannot find a proper way to load AB bundled as follow:

  1. We have two ABs in a same directory: cube.ab and box.ab which contains a single prefab separately.
  2. An AssetPackConfig is created and the two ABs are added via calling AddAssetsFolder method provided their containg directory. We name the asset pack Sample_AAB_AssetPack.
  3. Build an AAB with the configuration and installed to a device.
  4. Load a AB via calling RetrieveAssetBundleAsync method provided name of the AB (e.g. cube). An error occurred.

From logcat we get this error message:

Unity : Failed to retrieve AssetBundle No APKs available for pack 'cube'.:
Unity : Google.Play.AssetDelivery.Internal.<>c__DisplayClass8_1:b__1(String, Int32)
Unity : System.Action`2:Invoke(T1, T2)
Unity : System.Action:Invoke()
Unity : Google.Play.Core.Internal.PlayCoreEventHandler:Update()
Unity :
Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)
Unity :
Unity : Couldn't load AssetBundles: InternalError
Unity : Google.Play.AssetDelivery.Samples.AssetDeliveryDemo.d__35:MoveNext()
Unity : UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
Unity :
Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)

Thanks in advance.

[FeatureRequest] Simulate plugins' behaviour on Unity Editor

Please, make the plugins work on Unity Editor as close as possible to when deployed to a device.

We have to implement a lot of conditional checks on our app to run properly on Editor and it doesn't validate the actual plugin behaviour on a device.

We get exceptions even on constructors and stuff like that.

Right now we are (trying to) use Google Play Billing Library and Google Play In-app Review plugins

[Feature Request]: Assets by screen density

Hi,
As I understand in the Android App Bundle documentation a split is done on the res/drawable-{density} folders.
It would be great to add an option to be able to choose assets to be packaged by screen density.

For exemple, I'm making 2D games and I use Sprite Atlases, it would be so nice to be able to choose Sprite Atlases variant by screen densities to deliver smallest APK on small phones.

Build app bundle in android studio with asset packs of Unity project

Is it possible to export unity project and build Android App Bundle from studio? Unity project contains asset bundle.
I am using play asset delivery to download asset bundles. I want to build app bundle from android studio. How can I build app bundle from studio which supports downloading on demand assets bundle ?

[Play Billing] How to validate Subscriptions

What is the proper way to validate subscriptions on a Unity client?

I ask this because according to Google Play Billing Library documentation: "The Google Play Billing plugin does not support using the SubscriptionManager.UpdateSubscription() and SubscriptionManager.UpdateSubscriptionInGooglePlayStore() methods to upgrade and downgrade your subscriptions. If your game calls these methods, a GooglePlayStoreUnsupportedException is thrown.".

I couldn't find any subscription validation methods on IGooglePlayStoreExtensions that replace Unity's SubscriptionManager.

Should I validate it remotely using this API endpoint?
As flawed as it can be, is there an offline method to do that?

In-App Review not showing

I'm having some trouble getting the In-App Review to work.
I followed the instructions and used the sample code. It all executes, but nothing appears on screen. There is no error on log.
Any ideas what I could be missing?

IN APP REVIEW Exception: Field currentActivity or type signature not found

Hi, I am having trouble implementing in app reviews.
At compile time and runtime (playing the project in the editor), it shows this error:

Exception: Field currentActivity or type signature not found UnityEngine._AndroidJNIHelper.GetFieldID (System.IntPtr jclass, System.String fieldName, System.String signature, System.Boolean isStatic) (at <e2fcf4f110424f58ac607d4fd98ed223>:0) UnityEngine.AndroidJNIHelper.GetFieldID (System.IntPtr javaClass, System.String fieldName, System.String signature, System.Boolean isStatic) (at <e2fcf4f110424f58ac607d4fd98ed223>:0) UnityEngine._AndroidJNIHelper.GetFieldID[ReturnType] (System.IntPtr jclass, System.String fieldName, System.Boolean isStatic) (at <e2fcf4f110424f58ac607d4fd98ed223>:0) UnityEngine.AndroidJNIHelper.GetFieldID[FieldType] (System.IntPtr jclass, System.String fieldName, System.Boolean isStatic) (at <e2fcf4f110424f58ac607d4fd98ed223>:0) UnityEngine.AndroidJavaObject._GetStatic[FieldType] (System.String fieldName) (at <e2fcf4f110424f58ac607d4fd98ed223>:0) UnityEngine.AndroidJavaObject.GetStatic[FieldType] (System.String fieldName) (at <e2fcf4f110424f58ac607d4fd98ed223>:0) Google.Play.Common.UnityPlayerHelper.GetCurrentActivity () (at Library/PackageCache/[email protected]/Runtime/Scripts/UnityPlayerHelper.cs:32) Google.Play.Review.Internal.ReviewPlayCoreTaskManager..ctor () (at Library/PackageCache/[email protected]/Runtime/Scripts/Internal/ReviewPlayCoreTaskManager.cs:35) Google.Play.Review.ReviewManager..ctor () (at Library/PackageCache/[email protected]/Runtime/Scripts/ReviewManager.cs:29) AdvertisementManager.PlayStoreReview () (at Assets/Scripts/AdvertisementManager.cs:185) AdvertisementManager.StoreReview () (at Assets/Scripts/AdvertisementManager.cs:175) GameManager.Start () (at Assets/Scripts/GameManager.cs:77)

It seems to be happening in the constructor of ReviewManger, and in particular when trying to get the currentActivity with this line:
return unityPlayer.GetStatic("currentActivity");

I tried to compile a development build for android but I can't even do that because of this error.

EDIT: now it makes me compile, in the editor crashesh on ReviewManger constructor while in the apk build nothing happens. Does it need to be published on PlayStore in order to work properly?

In-app Review not showing

I implemented the feature and try to request and launch in-app review by clicking debug button. I deploy the build locally and my Google Play account is in the list of internal testers. Documentation says that "The quota limits are not enforced if the app is downloaded from the internal test track", so, I guess, triggering this by clicking debug button is fine.

It worked just fine only the first time. Review activity showed up and I was able to leave my review. I deleted the review. But after that I wasn't able to reproduce this. I tried different Google Play accounts and different devices.

It looks like activity tries to show up and then immediately closes, and the game pauses for a moment.

Both RequestReviewFlow and LaunchReviewFlow finish successfully every time without errors.

I tried to look into Logcat logs, but only errors I can see is stuff like this, which is not specific to this problem:
E: Error inserting period=6580000 preferred_charging_state=1 preferred_network_type=1 target_class=com.google.android.gms.measurement.PackageMeasurementTaskService required_network_type=0 runtime=1598593194053 required_idleness_state=0 source=16 service_kind=0 target_package=com.google.android.gms persistence_level=1 source_version=203019000 last_runtime=0 user_id=0 job_id=-1 requires_charging=0 tag=Measurement.PackageMeasurementTaskService.UPLOAD_TASK_TAG flex_time=3289000 task_type=0 retry_strategy={"maximum_backoff_seconds":{"3600":0},"initial_backoff_seconds":{"30":0},"retry_policy":{"0":0}} android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: pending_ops.tag, pending_ops.target_class, pending_ops.target_package, pending_ops.user_id (code 2067 SQLITE_CONSTRAINT_UNIQUE) at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method) at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:796) at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788) at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86) at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1564) at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1433) at arll.a(:com.google.android.gms@[email protected] (100400-326531024):122) at arki.a(:com.google.android.gms@[email protected] (100400-326531024):183) at arki.a(:com.google.android.gms@[email protected] (100400-326531024):22) at arki.a(:com.google.android.gms@[email protected] (100400-326531024):178) at argl.run(:com.google.android.gms@[email protected] (100400-326531024):9) at ssz.b(:com.google.android.gms@[email protected] (100400-326531024):12) at ssz.run(:com.google.android.gms@[email protected] (100400-326531024):7) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at sza.run(:com.google.android.gms@[email protected] (100400-326531024):0) at java.lang.Thread.run(Thread.java:764)

What might be the problem? My implementation is identical to the documentation and it worked for the first time (maybe it was random luck). I checked all trobleshooting tips.

App Bundle package errors if Unity Android not installed

Our game supports both Android and iOS. We build the two platforms using separate servers with each having their respective unity platform components.
I'm in the process of switching the Android side from just Unity IAP to Unity IAP + Google Play Billing. In doing so, the Android app bundle package is installed as a dependency.
Now when building for iOS, the app bundle package fails to compile with the following errors:

Library/PackageCache/[email protected]/Editor/Scripts/Internal/BuildTools/JavaUtils.cs(107,32): error CS0234: The type or namespace name 'AndroidExternalToolsSettings' does not exist in the namespace 'UnityEditor.Android' (are you missing an assembly reference?)
Library/PackageCache/[email protected]/Editor/Scripts/Internal/BuildTools/AndroidSdk.cs(41,27): error CS0234: The type or namespace name 'AndroidExternalToolsSettings' does not exist in the namespace 'UnityEditor.Android' (are you missing an assembly reference?)
Library/PackageCache/[email protected]/Editor/Scripts/Internal/BuildTools/AndroidSdk.cs(85,23): error CS0234: The type or namespace name 'AndroidExternalToolsSettings' does not exist in the namespace 'UnityEditor.Android' (are you missing an assembly reference?)
Library/PackageCache/[email protected]/Editor/Scripts/Internal/BuildTools/AndroidSdk.cs(86,24): error CS0234: The type or namespace name 'AndroidExternalToolsSettings' does not exist in the namespace 'UnityEditor.Android' (are you missing an assembly reference?)
Library/PackageCache/[email protected]/Editor/Scripts/Internal/BuildTools/AndroidSdk.cs(88,23): error CS0234: The type or namespace name 'AndroidExternalToolsSettings' does not exist in the namespace 'UnityEditor.Android' (are you missing an assembly reference?)
Library/PackageCache/[email protected]/Editor/Scripts/Internal/BuildTools/AndroidSdk.cs(89,24): error CS0234: The type or namespace name 'AndroidExternalToolsSettings' does not exist in the namespace 'UnityEditor.Android' (are you missing an assembly reference?)

I'm not aware of anyway to make package references only apply with certain targets and adding the Android components would cause build slowdowns.

I could put together a quick PR adding some #if UNITY_ANDROID blocks, but perhaps there is a better way.

AssetBundle Download Based on Texture Format

I have 6 asset bundles each of size 2MB and all are install time delivery.
Each asset bundle has same name and different texture format.

When I download my App from Play Store will all 6 asset bundles will be downloaded or asset bundle of device specific texture format is downloaded?

If asset bundle of device specific texture format is downloaded then will the App Size will include all 6 asset bundles size or only one asset bundle size?

I am using Unity 2018.4.
Play Asset Delivery Version 1.2

Unable to load asset packs in universal.apk

We are building an AAB with many of Unity's addressables asset bundles put into asset packs. The AAB works fine deployed to the Play Store and installed from an .apks built with --mode default

However, when we attempt to run the game from an .apks built with --mode universal we get a java exception when we call PlayAssetDelivery.RetrieveAssetBundleAsync()

Here are the java exception details:
image

In this case our game hangs because our PlayAssetBundleRequest.Completed event never fires.

Failed to retrieve AssetBundle Asset Pack Download Error(-5): The Asset Delivery API is not available. (https://developer.android.com/reference/com/google/android/play/core/assetpacks/model/AssetPackErrorCode.html#API_NOT_AVAILABLE)ssetPackErrorCode.html#API_NOT_AVAILABLE

Is there any guidance on what this error means? I used the version of this library that was distributed via the Google Package Manager in Unity, but I think the question is a general one. I'm not sure how to debug this error.

Adding some additional context here - I was following the Unity integration <> developer guide (https://developer.android.com/guide/playcore/asset-delivery/integrate-unity) and was attempting to test the functionality locally (as described in the docs). adb logcat showed that the bundle failed due to the below error.

Any suggestions on how to debug the Delivery API not being available?

Failed to retrieve AssetBundle Asset Pack Download Error(-5): The Asset Delivery API is not available. (https://developer.android.com/reference/com/google/android/play/core/assetpacks/model/AssetPackErrorCode.html#API_NOT_AVAILABLE)ssetPackErrorCode.html#API_NOT_AVAILABLE

Play Billing causes a lot of ANR reports, sometimes fails Initialization

Hello,

We updated to use this IAP extension plugin to provide better experience for players who encounter pending/deferred transactions in different countries. After we started using the plugin we have noticed a dramatic increase on our ANR reports in Google Play Console. Judging by this log, it seems that the play billing is responsible for this:
"main" prio=5 tid=1 Native | group="main" sCount=1 dsCount=0 flags=1 obj=0x75d2d4b8 self=0x7225c14c00 | sysTid=12272 nice=0 cgrp=default sched=0/0 handle=0x72ac6c8560 | state=S schedstat=( 46514845398 38837452674 39787 ) utm=1525 stm=3126 core=4 HZ=100 | stack=0x7ff43a6000-0x7ff43a8000 stackSize=8MB | held mutexes= #00 pc 000000000001eeec /system/lib64/libc.so (syscall+28) #01 pc 00000000000d7e24 /system/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) #02 pc 0000000000374500 /system/lib64/libart.so (art::JNI::GetStringUTFChars(_JNIEnv*, _jstring*, unsigned char*)+472) #03 pc 00000000003058f8 /data/app/<APPLICATION_ID>-Jg8O9BrmDmclaRW4y7n8qA==/lib/arm64/libunity.so (???) #04 pc 000000000030b310 /data/app/<APPLICATION_ID>-Jg8O9BrmDmclaRW4y7n8qA==/lib/arm64/libunity.so (???) #05 pc 0000000003fe3c14 /data/app/<APPLICATION_ID>-Jg8O9BrmDmclaRW4y7n8qA==/lib/arm64/libil2cpp.so (_AndroidJNIHelper_InvokeJavaProxyMethod_mF92923091814A5E820890D2CCE76C7A589F03192+368) #06 pc 0000000002d7eb54 /data/app/<APPLICATION_ID>-Jg8O9BrmDmclaRW4y7n8qA==/lib/arm64/libil2cpp.so (RuntimeInvoker_FalseIntPtr_t_RuntimeObject_IntPtr_t_IntPtr_t(void (*)(), MethodInfo const*, void*, void**)+44) #07 pc 0000000002e5fba8 /data/app/<APPLICATION_ID>-Jg8O9BrmDmclaRW4y7n8qA==/lib/arm64/libil2cpp.so (il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)+104) #08 pc 00000000003851f4 /data/app/<APPLICATION_ID>-Jg8O9BrmDmclaRW4y7n8qA==/lib/arm64/libunity.so (???) #09 pc 0000000000376f28 /data/app/<APPLICATION_ID>-Jg8O9BrmDmclaRW4y7n8qA==/lib/arm64/libunity.so (???) #10 pc 00000000003046a4 /data/app/<APPLICATION_ID>-Jg8O9BrmDmclaRW4y7n8qA==/lib/arm64/libunity.so (???) at com.unity3d.player.ReflectionHelper.nativeProxyInvoke (Native method) at com.unity3d.player.ReflectionHelper.a (unavailable) at com.unity3d.player.ReflectionHelper$1.invoke (unavailable) at java.lang.reflect.Proxy.invoke (Proxy.java:1006) at com.android.billingclient.api.BillingClientStateListener.onBillingServiceDisconnected at com.android.billingclient.api.BillingClientImpl$zza.onServiceDisconnected at android.app.LoadedApk$ServiceDispatcher.doDeath (LoadedApk.java:1858) at android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk.java:1873) at android.os.Handler.handleCallback (Handler.java:873) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loop (Looper.java:214) at android.app.ActivityThread.main (ActivityThread.java:7050) at java.lang.reflect.Method.invoke (Native method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:965)
This is quite unfortunate as this seems to be a problem mostly on newer Android OS versions (Android 8.0 -->) thus providing a bad experience for the more probable paying customers.
As these ANRs never happened before when we used the standard Unity IAP, it seems obvious the problem is within this plugin or the base play billing library itself. From my understanding these are usually the cause of blocking the UI thread? I see the GooglePlayBillingInventory.cs and GooglePlayBillingUtil.cs quite heavily lock variables before calling native Java side of things. Could it be that the plugin doesn't survive this properly in certain situations? This is a huge problem for us, as the ANR reports drop the app below the good behaviour line and therefore affects the store presence.
And I don't know if it is related to this, but sometimes the Initialization of the plugin fails quite badly. We have experienced issues where if initialization fails or the store is disconnected and reconnected, the plugin doesn't keep reference to the deferred purchase callback like it should or even call the initialization success callback again. Instead, the plugin throws an exception and users are forced to restart the app to get around this, hoping the initialization works the next time. I tried to make some workarounds for this issue so that the deferred callback would not get nulled, but we still encounter this from time to time. I'm quite sure that I have everything set up the correct way, but the documentation of the plugin is a bit vague and doesn't have any information regarding how to handle these.
If you could shed some light on these issues it would be most appreciated.

App Bundles - post-build callback

Hi,

When calling BundleTool.BuildBundle to build, it returns when the bundle starts building (when the background thread is started) rather than when it has finished building. This means we have no way of knowing when the build is actually finished, and can't automate any post-build steps (e.g. generating APKs).

I noticed there is already a synchronous build path that is used for batch mode builds. Is it possible to expose this for non-batch mode usage? If not, is it possible to add a callback for when the build finishes that we can use to run post-build steps.

Thanks

In-App Review Quota?

Hi, here is my setup for the In-App Review:

I have a button which triggers the In-App Review process. I know it is not the recommended way but for me it's the way that makes sense for my app.

The current behavior that happens is that the Review dialog shows the first time the user taps the Review button, but it does nothing if the user cancels the review dialog and taps the Review button again. I believe this scenario happens?

"To provide a great user experience, Google Play enforces a quota on how often a user can be shown the review dialog. Because of this, calling a launchReviewFlow method might not always display a dialog. For example, you should not have a call-to-action option (such as a button) to trigger a review as a user might have already hit their quota and the flow won’t be shown, presenting a broken experience to the user." (from here: https://developer.android.com/guide/playcore/in-app-review#quotas)

  1. What is the quota? is it once every 12 hours, once every 3 hours, once per day, etc. ? When does it reset?
  2. If there is no dialogue displayed, the code still executes successfully and there is no error. Is there a way for me as a developer to know if the In-App Dialog has not been displayed due to quota limits? What I want to achieve is that if the quota is reached, then I want to open the classical link to the Play Store and let the user review the old fashioned way.
private ReviewManager _reviewManager;
 private PlayReviewInfo _playReviewInfo;
 private string errorMessage;

IEnumerator OpenRateGameAPI()
	{
		_reviewManager = new ReviewManager();
		errorMessage = string.Empty;

		Debug.Log("Request ReviewFlow");
		var requestFlowOperation = _reviewManager.RequestReviewFlow();
		yield return requestFlowOperation;
		Debug.Log("RequestFlow result: " +requestFlowOperation.ToString());

		if (requestFlowOperation.Error != ReviewErrorCode.NoError)
		{
			errorMessage = requestFlowOperation.Error.ToString();

			Debug.Log(errorMessage);

			yield break;
		}

		_playReviewInfo = requestFlowOperation.GetResult();


		Debug.Log("Launch Review Flow");
		var launchFlowOperation = _reviewManager.LaunchReviewFlow(_playReviewInfo);		
		yield return launchFlowOperation;
		Debug.Log("LaunchFlow operation: " + launchFlowOperation.ToString());

		_playReviewInfo = null; // Reset the object

		if (launchFlowOperation.Error != ReviewErrorCode.NoError)
		{
			errorMessage = launchFlowOperation.Error.ToString();

			Debug.Log(errorMessage);
			yield break;
		}

		Debug.Log("RateApi Complete");
	}

This is the Logcat of the above code, maybe it helps.

image

Redirect after Instant Play download

Hi,
I'm trying to update my Instant Play game using the latest version of the library.
I deployed it as alpha here:
Word Jungle Alpha

When I click on the button "Try Now" it download the game but when it should open it, it redirect to my website.
Here's a screen recording of that:
Video Recording

Could you please help me?

Please fully automate .aab and bundle creation

For those of us that still rely on APKs and OBBs and would like to get rid of the nightmare that is OBB files:

Please make a way to generate .aab files that produce a small APK and pack the rest of the data in an asset bundle in an automatic way. Maybe you can't do that with just your plugin, but I bet you could pressure Unity to do it / help with it.

We don't use dynamic loading, or download any other data, we simply want people to download our game and then be ready to play, no need to download anything else, and that has been surprisingly hard to do with Google Play over the years. I'm sad to see that even with the new solution, it is still surprisingly hard.

Asset Bundles are a huge ugly mess to work with in Unity and require we completely rework the way a game is structured. And for multi platform games, since we don't want to use Asset Bundles on other platforms, this requirement is a show-stopper.

I bet with a little bit of Unity pressure you could devise a way to just take the data.unity3d and turn them into an Asset Bundle automatically, without code changes required from our side, and then just apply AssetPackDeliveryMode.InstallTime and then tons of people would happily migrate from APK to OBB to the new AAB.

Otherwise, we're sorry but as much as we hate obb files, working with Asset Bundles is worse.

Thanks.

Difficulties adding Billing plugin

Hey there! This is actually an issue centric to the Google Play billing plugin, however I cannot seem to find an appropriate place to get in touch about any issues we may be having, and this appears to be the best possible option. Please let me know if there's a better place for this and I'll be sure to enquire there!

Currently my team is trying to add the Google Play billing plugin to our project. The main reason for this is that we want to utilize the ability to specify proration mode when upgrading and downgrading subscriptions, which is not currently offered in UnityIAP. We are running into issues adding the plugin to our existing project.

I am following the instructions at this page.

Issue 1:
When getting to step 3 of "For Unity 2018.4 and above" instructions, the prompt for "Add Selected Registries" does not actually appear.

Issue 2:
The note in regards to the External Dependency Manager (which I'm assuming is the Game Package Registry for Unity - it's a little confusing that the terminology differs here) is slightly ambiguous. We actually do have the Package Manager version of the EDM, and following those steps shows two packages (google-signin-plugin and play-services-resolver) but the tutorial doesn't really elaborate on what you should be doing when reaching this popup.

The fact that we already have the External Dependency Manager may explain Issue 1 above?

Issue 3:
This is the primary issue, I believe. Once installing the Google Play Billing package from the Package Manager, a number of errors appear in the Unity console.
image
There are 34 of these in total at the bottom of the console, as well as the following that appears at the very top of the console:
Error: Could not load signature of UnityEditor.Purchasing.GooglePlayProductCatalogExporter:ProductTypeString due to: Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:(null) signature:<none>
I can actually get past all these error messages (except the pasted error) by restarting Unity, but when I attempt to call anything from the Google.Play.Billing namespace, the only options are:

  • Editor (and deeper options)
  • GooglePlayStoreProrationMode
  • GooglePlayStoreUnsupportedException
  • Internal (and deeper options)

What I've attempted 1:
The given installation steps here as closely as possible, with the above issues.

What I've attempted 2:
Removing the Package Manager version of External Dependency Manager, along with the dependent Firebase packages, and then attempting the given installation steps as closely as possible again.

What I've attempted 3:
The "For Unity 5.6 to 2018.3" installation steps here. Each way I've attempted to add the plugin has resulted in the same issues.

Also might be worth noting that we've been using UnityIAP successfully in our live app for about 10 months now, so those UnityIAP steps at the beginning of the installation steps were not completed, but after reviewing them I believe they were all done prior anyway.


I do get the feeling that this is a result of user error rather than something within the plugin/installation process, especially since this sort of thing isn't my forte, so any guidance to fixing this would be much appreciated! Hope to hear from one of you folks soon!

Unity - 2019.2.17f (MacOS)
External Dependency Manager - 1.2.156 (Package Manager) / 1.2.157 (in Assets)
Google Play Billing Library - 3.0.2
In App Purchasing - 2.1.0
UnityPurchasing - 1.23.5

OnPurchaseFailed never called in unity client

It seems wrong product id used on during purchase failure. According to unity documentation it should be store specific id but right now library uses internal unity id. This cause why OnPurchaseFailed(Product product, PurchaseFailureReason failureReason) never called in IStoreListener

It must be

var productId = _productInPurchaseFlow.storeSpecificId;

Error with script used on "Use the Google Play Billing Library with Unity" guide

The script in the guide

var storeModule = StandardPurchasingModule.Instance(); if (Application.platform == RuntimePlatform.Android) { storeModule = Google.Play.Billing.GooglePlayStoreModule.Instance(); } var configurationBuilder = ConfigurationBuilder.Instance(storeModule);

Result in this error

Assets\_Scripts\StoreManager.cs(201,22): error CS0266: Cannot implicitly convert type 'UnityEngine.Purchasing.Extension.AbstractPurchasingModule' to 'UnityEngine.Purchasing.StandardPurchasingModule'. An explicit conversion exists (are you missing a cast?)

if I use this script

// Create a builder using the GooglePlayStoreModule. var configurationBuilder = ConfigurationBuilder.Instance(Google.Play.Billing.GooglePlayStoreModule.Instance());

app crash and logcat result is cannot find IIapbilling class

I'll give more details when I have the project in front

Unity Editor - 2019.1.14
Unity IAP - 1.20
Google Play Core / Common / Billing - Latest versions

Edit: logcat error after reimport all Unity IAP and Play Billing

Logcat

Edit 2: The problem persists even if the proguard files are up to date

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.