As the title says the log returns me an unknown error.
PS: Already using 2.2.5 and 2.2.1
Here the logcat
2021-01-08 15:30:19.258 4525-4525/? I/ViewRootImpl@54d8191[UnityPlayerActivity]: ViewPostIme pointer 0
2021-01-08 15:30:19.340 4525-4525/? I/ViewRootImpl@54d8191[UnityPlayerActivity]: ViewPostIme pointer 1
2021-01-08 15:30:19.345 4525-5621/? I/Unity: Purchasing product asychronously: monthly
IAPHandler:BuyProductID(String)
UnityEngine.Events.UnityAction:Invoke()
UnityEngine.Events.UnityEvent:Invoke()
UnityEngine.EventSystems.EventFunction`1:Invoke(T1, BaseEventData)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
UnityEngine.EventSystems.StandaloneInputModule:Process()
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
2021-01-08 15:30:19.349 4525-5621/? I/Unity: purchase({0}): monthly
UnityEngine.Events.UnityAction:Invoke()
UnityEngine.Events.UnityEvent:Invoke()
UnityEngine.EventSystems.EventFunction`1:Invoke(T1, BaseEventData)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
UnityEngine.EventSystems.StandaloneInputModule:Process()
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
2021-01-08 15:30:19.383 4525-4525/? I/Unity: onPause
2021-01-08 15:30:19.405 4525-5621/? D/AudioTrack: stop(9717): called with 783936 frames delivered
2021-01-08 15:30:19.412 4525-5621/? D/Unity: Sensor : Accelerometer ( 1) ; 0.002394 / 0.00s ; LSM6DSO Acceleration Sensor / STM
2021-01-08 15:30:19.418 4525-4525/? W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@36d79ca
2021-01-08 15:30:19.434 4525-4525/? D/PhoneWindow: forceLight changed to true [ ] from com.android.internal.policy.PhoneWindow.updateForceLightNavigationBar:4274 com.android.internal.policy.DecorView.updateColorViews:1547 com.android.internal.policy.PhoneWindow.dispatchWindowAttributesChanged:3252 android.view.Window.setFlags:1153 com.android.internal.policy.PhoneWindow.generateLayout:2474
2021-01-08 15:30:19.434 4525-4525/? I/MultiWindowDecorSupport: [INFO] isPopOver = false
2021-01-08 15:30:19.434 4525-4525/? I/MultiWindowDecorSupport: updateCaptionType >> DecorView@6d16896[ ], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true
2021-01-08 15:30:19.434 4525-4525/? D/MultiWindowDecorSupport: setCaptionType = 0, DecorView = DecorView@6d16896[ ]
2021-01-08 15:30:19.443 4525-4525/? I/ViewRootImpl@4b37822[ProxyBillingActivity]: setView = com.android.internal.policy.DecorView@6d16896 TM=true MM=false
2021-01-08 15:30:19.444 4525-4525/? I/ViewRootImpl@54d8191[UnityPlayerActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1
2021-01-08 15:30:19.444 4525-4525/? D/InputMethodManager: prepareNavigationBarInfo() DecorView@f61e4ff[UnityPlayerActivity]
2021-01-08 15:30:19.444 4525-4525/? D/InputMethodManager: getNavigationBarColor() -855310
2021-01-08 15:30:19.444 4525-4525/? I/Unity: windowFocusChanged: false
2021-01-08 15:30:19.471 4525-4525/? I/ViewRootImpl@4b37822[ProxyBillingActivity]: Relayout returned: old=(0,0,1080,2280) new=(0,0,1080,2280) req=(1080,2280)0 dur=18 res=0x7 s={true 530095955968} ch=true
2021-01-08 15:30:19.472 4525-6013/? D/OpenGLRenderer: createReliableSurface : 0x7b8b3590c0(0x7b6c2e6000)
2021-01-08 15:30:19.472 4525-6013/? D/OpenGLRenderer: makeCurrent EglSurface : 0x0 -> 0x0
2021-01-08 15:30:19.476 4525-6013/? I/mali_winsys: new_window_surface() [1080x2280] return: 0x3000
2021-01-08 15:30:19.476 4525-6013/? D/OpenGLRenderer: eglCreateWindowSurface : 0x7b8b38ae00
2021-01-08 15:30:19.480 4525-6013/? D/OpenGLRenderer: makeCurrent EglSurface : 0x0 -> 0x7b8b38ae00
2021-01-08 15:30:19.488 4525-4525/? I/ViewRootImpl@4b37822[ProxyBillingActivity]: MSG_RESIZED: frame=(0,0,1080,2280) ci=(0,110,0,0) vi=(0,110,0,0) or=1
2021-01-08 15:30:19.568 4525-4525/? D/InputTransport: Input channel destroyed: 'ClientS', fd=64
2021-01-08 15:30:22.307 4525-4525/? W/ProxyBillingActivity: Activity finished with resultCode 0 and billing's responseCode: 4
2021-01-08 15:30:22.323 4525-4525/? W/BillingHelper: Couldn't find purchase lists, trying to find single data.
2021-01-08 15:30:22.323 4525-4525/? W/BillingHelper: Received a bad purchase data.
2021-01-08 15:30:22.323 4525-4525/? W/BillingHelper: Couldn't find single purchase data as well.
2021-01-08 15:30:22.338 4525-4525/? I/ViewRootImpl@4b37822[ProxyBillingActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
2021-01-08 15:30:22.338 4525-4525/? D/InputMethodManager: prepareNavigationBarInfo() DecorView@6d16896[ProxyBillingActivity]
2021-01-08 15:30:22.338 4525-4525/? D/InputMethodManager: getNavigationBarColor() -855310
2021-01-08 15:30:22.339 4525-4525/? D/InputMethodManager: prepareNavigationBarInfo() DecorView@6d16896[ProxyBillingActivity]
2021-01-08 15:30:22.339 4525-4525/? D/InputMethodManager: getNavigationBarColor() -855310
2021-01-08 15:30:22.339 4525-4525/? V/InputMethodManager: Starting input: tba=com.marslit.marslytics ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
2021-01-08 15:30:22.339 4525-4525/? D/InputMethodManager: startInputInner - Id : 0
2021-01-08 15:30:22.339 4525-4525/? I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
2021-01-08 15:30:22.342 4525-4525/? I/ViewRootImpl@54d8191[UnityPlayerActivity]: stopped(false) old=false
2021-01-08 15:30:22.342 4525-4525/? I/Unity: onResume
2021-01-08 15:30:22.345 4525-4525/? I/ViewRootImpl@54d8191[UnityPlayerActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
2021-01-08 15:30:22.346 4525-4525/? D/InputMethodManager: prepareNavigationBarInfo() DecorView@f61e4ff[UnityPlayerActivity]
2021-01-08 15:30:22.346 4525-4525/? D/InputMethodManager: getNavigationBarColor() -855310
2021-01-08 15:30:22.346 4525-4525/? I/Unity: windowFocusChanged: true
2021-01-08 15:30:22.347 4525-4525/? D/InputMethodManager: prepareNavigationBarInfo() DecorView@f61e4ff[UnityPlayerActivity]
2021-01-08 15:30:22.347 4525-4525/? D/InputMethodManager: getNavigationBarColor() -855310
2021-01-08 15:30:22.347 4525-4525/? V/InputMethodManager: Starting input: tba=com.marslit.marslytics ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
2021-01-08 15:30:22.347 4525-4525/? D/InputMethodManager: startInputInner - Id : 0
2021-01-08 15:30:22.347 4525-4525/? I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
2021-01-08 15:30:22.348 4525-4525/? D/InputTransport: Input channel destroyed: 'ClientS', fd=219
2021-01-08 15:30:22.349 4525-4525/? I/ViewRootImpl@4b37822[ProxyBillingActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1
2021-01-08 15:30:22.349 4525-4525/? D/InputMethodManager: prepareNavigationBarInfo() DecorView@6d16896[ProxyBillingActivity]
2021-01-08 15:30:22.349 4525-4525/? D/InputMethodManager: getNavigationBarColor() -855310
2021-01-08 15:30:22.350 4525-4525/? I/ViewRootImpl@4b37822[ProxyBillingActivity]: stopped(true) old=false
2021-01-08 15:30:22.350 4525-6013/? D/OpenGLRenderer: makeCurrent EglSurface : 0x7b8b38ae00 -> 0x0
2021-01-08 15:30:22.351 4525-6013/? D/OpenGLRenderer: destroyEglSurface : 0x7b8b38ae00
2021-01-08 15:30:22.352 4525-6013/? I/mali_egl: eglDestroySurface() in
2021-01-08 15:30:22.352 4525-6013/? I/mali_winsys: delete_surface() [1080x2280] return
2021-01-08 15:30:22.352 4525-6013/? I/mali_egl: eglDestroySurface() out
2021-01-08 15:30:22.352 4525-6013/? E/OpenGLRenderer: ReliableSurface: perform returned an error
2021-01-08 15:30:22.352 4525-6013/? W/libEGL: EGLNativeWindowType 0x7b8b3590d0 disconnect failed
2021-01-08 15:30:22.352 4525-6013/? D/OpenGLRenderer: ~ReliableSurface : 0x7b8b3590c0
2021-01-08 15:30:22.353 4525-4525/? I/ViewRootImpl@4b37822[ProxyBillingActivity]: dispatchDetachedFromWindow
2021-01-08 15:30:22.355 4525-4525/? D/InputTransport: Input channel destroyed: '843033 ', fd=217
2021-01-08 15:30:22.356 4525-5621/? D/Unity: Sensor : Accelerometer ( 1) ; 0.002394 / 0.00s ; LSM6DSO Acceleration Sensor / STM
2021-01-08 15:30:22.364 4525-4525/? V/MediaRouter: Selecting route: RouteInfo{ name=GocAndroid, description=Audio Bluetooth, status=null, category=RouteCategory{ name=Sistema types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO , presentationDisplay=null }
2021-01-08 15:30:22.367 4525-5621/? D/Unity: Choreographer available: Enabling VSYNC timing
2021-01-08 15:30:22.372 4525-5621/? I/Unity: onPurchaseFailedEvent({0}): productId:monthly message: {M: GPUL.HEC}
UnityEngine.Purchasing.PurchasingManager:OnPurchaseFailed(PurchaseFailureDescription)
System.Action:Invoke()
UnityEngine.Purchasing.Extension.UnityUtil:Update()
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
2021-01-08 15:30:22.373 4525-5621/? I/Unity: OnPurchaseFailed: FAIL. Product: 'monthly', PurchaseFailureReason: Unknown
IAPHandler:OnPurchaseFailed(Product, PurchaseFailureReason)
System.Action:Invoke()
UnityEngine.Purchasing.Extension.UnityUtil:Update()
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
2021-01-08 15:30:42.484 4525-4525/? D/InputMethodManager: prepareNavigationBarInfo() DecorView@f61e4ff[UnityPlayerActivity]
2021-01-08 15:30:42.484 4525-4525/? D/InputMethodManager: getNavigationBarColor() -855310
2021-01-08 15:30:42.484 4525-4525/? V/InputMethodManager: Starting input: tba=com.marslit.marslytics ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
2021-01-08 15:30:42.484 4525-4525/? D/InputMethodManager: startInputInner - Id : 0
2021-01-08 15:30:42.484 4525-4525/? I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
2021-01-08 15:30:42.486 4525-4525/? D/InputTransport: Input channel destroyed: 'ClientS', fd=220
2021-01-08 15:30:42.857 4525-4525/? I/Unity: onPause
2021-01-08 15:30:43.080 4525-5621/? D/AudioTrack: stop(9717): called with 995904 frames delivered
2021-01-08 15:30:43.095 4525-5621/? D/Unity: Sensor : Accelerometer ( 1) ; 0.002394 / 0.00s ; LSM6DSO Acceleration Sensor / STM
2021-01-08 15:30:43.120 4525-4525/? I/ViewRootImpl@54d8191[UnityPlayerActivity]: stopped(true) old=false
2021-01-08 15:30:43.120 4525-4525/? I/SurfaceView: windowStopped(true) false android.view.SurfaceView{6a088f6 VFE...... .F....I. 0,0-1080,2280 #7f010000 app:id/unitySurfaceView} of ViewRootImpl@54d8191[UnityPlayerActivity]
2021-01-08 15:30:43.123 4525-4525/? I/SurfaceView: surfaceDestroyed callback.size 1 #1 android.view.SurfaceView{6a088f6 VFE...... .F....I. 0,0-1080,2280 #7f010000 app:id/unitySurfaceView}
2021-01-08 15:30:43.123 4525-5621/? D/Unity: SetWindow 0 0x0
2021-01-08 15:30:43.125 4525-4525/? I/SurfaceView: remove() android.view.SurfaceView{6a088f6 VFE...... .F....I. 0,0-1080,2280 #7f010000 app:id/unitySurfaceView} Surface(name=SurfaceView - com.marslit.marslytics/com.unity3d.player.UnityPlayerActivity@6a088f6@0)/@0x44a9c3d
2021-01-08 15:30:43.309 4525-4525/? I/ViewRootImpl@54d8191[UnityPlayerActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1
2021-01-08 15:30:43.309 4525-4525/? D/InputMethodManager: prepareNavigationBarInfo() DecorView@f61e4ff[UnityPlayerActivity]
2021-01-08 15:30:43.309 4525-4525/? D/InputMethodManager: getNavigationBarColor() -855310
2021-01-08 15:30:43.310 4525-4525/? I/Unity: windowFocusChanged: false
2021-01-08 15:30:47.998 4525-5601/? W/System: A resource failed to call end.
2021-01-08 15:30:47.999 4525-5601/? I/chatty: uid=10656(com.marslit.marslytics) FinalizerDaemon identical 1 line
2021-01-08 15:30:48.000 4525-5601/? W/System: A resource failed to call end.
2021-01-08 15:30:48.000 4525-5601/? V/MediaMetadataRetriever: destructor
2021-01-08 15:30:48.000 4525-5601/? V/MediaMetadataRetriever: disconnect
Here my code
using System;
using UnityEngine;
using UnityEngine.Purchasing;
public class IAPHandler : MonoBehaviour, IStoreListener
{
private static IStoreController m_StoreController; // The Unity Purchasing system.
private static IExtensionProvider m_StoreExtensionProvider; // The store-specific Purchasing subsystems.
public static string lifetimeSubscriptionProductID = "ID1";
public static string monthlySubscriptionProductID = "ID2";
public static string yearlySubscriptionProductID = "ID3";
void Start()
{
if (m_StoreController == null)
InitializePurchasing();
}
public void InitializePurchasing()
{
if (IsInitialized())
return;
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
// Add product
builder.AddProduct(lifetimeSubscriptionProductID, ProductType.NonConsumable);
// Add subscription products
builder.AddProduct(monthlySubscriptionProductID, ProductType.Subscription);
builder.AddProduct(yearlySubscriptionProductID, ProductType.Subscription);
UnityPurchasing.Initialize(this, builder);
}
private bool IsInitialized()
{
return m_StoreController != null && m_StoreExtensionProvider != null;
}
public void BuyNonConsumable()
{
BuyProductID(lifetimeSubscriptionProductID);
}
public void BuyMonthlySubscription()
{
BuyProductID(monthlySubscriptionProductID);
}
public void BuyYearlySubscription()
{
BuyProductID(yearlySubscriptionProductID);
}
void BuyProductID(string productId)
{
if (IsInitialized())
{
// Look up the Product reference with the general product identifier
Product product = m_StoreController.products.WithID(productId);
// If the look up found a product for this device's store and that product is ready to be sold
if (product != null && product.availableToPurchase)
{
Debug.Log("Purchasing product asychronously: " + product.definition.id);
// Buy the product. Response from ProcessPurchase or OnPurchaseFailed (async)
m_StoreController.InitiatePurchase(product);
}
else
{
Debug.Log("BuyProductID: FAIL. Not purchasing product, either is not found or is not available for purchase");
}
}
else // If not initialized
{
Debug.Log("BuyProductID FAIL. Not initialized.");
}
}
public void RestorePurchases()
{
if (!IsInitialized())
{
Debug.Log("RestorePurchases FAIL. Not initialized.");
return;
}
// If we are running on an Apple device ...
if (Application.platform == RuntimePlatform.IPhonePlayer ||
Application.platform == RuntimePlatform.OSXPlayer)
{
Debug.Log("RestorePurchases started ...");
IAppleExtensions apple = m_StoreExtensionProvider.GetExtension<IAppleExtensions>();
// Begin the asynchronous process of restoring purchases
apple.RestoreTransactions((result) => {
if (result)
{
Debug.Log("Everything has been restored.");
}
else
{
Debug.Log("Nothing to restore.");
}
});
}
else
{
// We are not running on an Apple device. No work is necessary to restore purchases.
}
}
public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
{
Debug.Log("Init: DONE");
// Overall Purchasing system, configured with products for this application.
m_StoreController = controller;
// Store specific subsystem, for accessing device-specific store features.
m_StoreExtensionProvider = extensions;
}
public void OnInitializeFailed(InitializationFailureReason error)
{
// Purchasing set-up has not succeeded. Check error for reason. Consider sharing this reason with the user.
Debug.Log("Init: FAIL - " + error);
}
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
{
// A non-consumable product has been purchased.
if (String.Equals(args.purchasedProduct.definition.id, lifetimeSubscriptionProductID, StringComparison.Ordinal))
{
Debug.Log("ProcessPurchase NON CONSUMABLE: PASS. Product: " + args.purchasedProduct.definition.id);
}
// Monthly subscription purchased.
else if (String.Equals(args.purchasedProduct.definition.id, monthlySubscriptionProductID, StringComparison.Ordinal))
{
Debug.Log("ProcessPurchase MONTHLY: PASS. Product: " + args.purchasedProduct.definition.id);
}
// Yearly subscription purchased.
else if (String.Equals(args.purchasedProduct.definition.id, yearlySubscriptionProductID, StringComparison.Ordinal))
{
Debug.Log("ProcessPurchase YEARLY: PASS. Product: " + args.purchasedProduct.definition.id);
}
else
{
Debug.Log("ProcessPurchase: FAIL. Unrecognized product.");
}
return PurchaseProcessingResult.Complete;
}
public void OnPurchaseFailed(Product product, PurchaseFailureReason failureReason)
{
// A product purchase attempt did not succeed. Check failureReason for more detail.
// Share the reason with the user.
Debug.Log(string.Format("OnPurchaseFailed: FAIL. Product: '{0}', PurchaseFailureReason: {1}", product.definition.storeSpecificId, failureReason));
}
}