Hi! After updating the IAP plugin we found an error, when we opened our shop scene.
Here the error log from the console: <i>AndroidPlayer(Xiaomi_Redmi_Note_3@192.168.1.2)</i> NotSupportedException: Fai - Pastebin.com
What are we doing wrong?
Please try reimporting IAP from the Services Window, save the project (File/Save) and restart the Unity Editor and see if the issue persists?
Yes, itās still persists.
Can you provide specific steps to reproduce? Does it run in the Editor? How are you installing the game onto the device, are you using Build and Run from the Unity Editor? What version of Unity are you using, and what store are you targeting and what version of Android?
So, that error comes from Android device(Android v. 6.0.1) when I run development build and trying to initialize purchasing manager. The script crushes on this line:
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
By the way, in Editor everything works correctly, I see in the console a message about the purchase is successfully made.
Iāam built my project using gradle, then I just copy .apk on my device and install it from the device.
We are using Unity 2017.2.0f3. Target store is Google Play.
Can you use Unity Build and Run, without using Gradle, as a test? Can you provide the device logs? Also, you might try Reimporting IAP from the Services window, then Save the project and reopen Unity.
I already tried to reimport plugin, as you said before And there is no result.
I need to use āInternalā instead gradle?
Yes, just use Build and Run from the File menu, and choose the defaults (Internal). It should work with Gradle too, this is just for troubleshooting. One question, is com.unity.purchasing.googleplay.GooglePlayPurchasing defined in your Gradle build file? I will test with Gradle here also.
I canāt use Internal because of the limit on the number of methods. Thatās why we unsig gradle
What do you mean when you say ācom.unity.purchasing.googleplay.GooglePlayPurchasing defined in your Gradle build fileā? I can send you proguard settings file(proguard-user.txt).
That library (and its version) should be referenced in your Gradle Build file, I will confirm here.
When I target Amazon, I see only the following reference in my Gradle build file:
compile(name: āAmazonAppStoreā, ext:āaarā)
I am updating Android Studio now, and will provide my results shortly.
My app worked on my device as expected when targeting Amazon with the latest IAP release. I installed directly from Android Studio. I did update Android Studio as prompted, and also followed all the update recommendations, such as updating Gradle, sdk_tools and libraries. Please try with a new project with IAP added only, as a test.
Alright, I will try with a new project and let you know what happen. But I still have a few questions:
- Why are you trying to check funtionality of Amazon store? In our case target shop is Google Play. Or it is doesnāt matter?
- You said, that you āinstalled directly from Android Studioā. Does that means that you exporting project from Unity to Android Studio and then build apk project in it? I am asking, because we build apk directly in Unity, without export.
- Do I need to change Proguard settings or not? And if I need, what exectly do I need to write in my Proguard settings file?
I tried importing the plugin into an empty project and run a test scene. This is what I get from the device.
That is the expected response when the products have not been configured properly, or you are using the wrong test user. And you mentioned you were using Gradle when you stated āIāam built my project using gradleā. There should be no need to set the Proguard settings. I targeted Amazon as a test when changing targets. The behavior should be the same with Google Play. You change targets from the menu WIndow/Unity IAP/Android/Target Google Play. If you continue to have issue, after making a project backup, delete the Assets/Plugins/UnityPurchasing folder, and reimport IAP.
I deleted IAP folder, then reload Unity, then reimported IAP plugin, then changed target shop to GooglePlay. Still get this error from the device.
You didnāt get that error with the new project with IAP only, what are you doing differently now? If you can attach that simple project here, I will test on my Android device. Alternately, you can go the Support tab in your Analytics Dashboard and submit a ticket and provide the project. https://analytics.cloud.unity3d.com/
Oh, I am sorry. I thought you told about not-test project. Give me a 5 minutes, I will try it on my test project.
I did all steps as before. Deleted and reimported plugin, target shop is Amazon.
This is what I see on my device
This is what I see in console
Yes, it looks like itās working, and you didnāt get the error! So you just need to determine what is different between this project and your other one. Build out this test project by adding the same assets and scripts one at a time if you are not able to quickly spot any differences.