Search Issue Tracker
Fixed in 2018.1.X
Votes
5
Found in
2017.1.2f1
Issue ID
958379
Regression
No
[Android][Gradle] Unity purchasing classes are not included in Android Gradle builds
Unity.Purchasing classes are not included in Android builds produced using Gradle build system.
Steps to reproduce:
1) Open the attached project (958379_repro.zip).
2) Set build system to Gradle.
3) Add a new keystore.
4) Enable 'Proguard' option for Minify.
5) Build a non-Development build.
6) Run on a device.
- Monitor app output via logcat.
An error message is printed:
UnityIAP StandardPurchasingModule Version: 1.14.0
NotSupportedException: Failed to bind to native store: UnityEngine.AndroidJavaException: java.lang.ClassNotFoundException: com.unity.purchasing.googleplay.GooglePlayPurchasing
java.lang.ClassNotFoundException: com.unity.purchasing.googleplay.GooglePlayPurchasing
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:400)
at java.lang.Class.forName(Class.java:326)
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.c(Unknown Source)
at com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:154)
at com.unity3d.player.UnityPlayer$c.run(Unknown Source)
This does not happen when using the Internal build system.
Workaround:
Prevent the purchasing classes from being stripped by adding the following to Proguard file:
-keep public class com.unity.purchasing.**{
public *;
}
Reproduced on:
2018.1.0a5, 2017.1.0a3
Test device:
Samsung Galaxy S7 Android 7.0
Comments (1)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Terrain Tree cast Realtime and Baked shadows simultaneously when "Mixed" Light mode and "Subtractive" Baked Illumination is used in Edit mode
- OnPostprocessAllAssets() is not called for a modified Prefab when another Asset is set Dirty in the same callback
- [Android] UIToolkit ClickEvent is fired when the device is rotated
- Compilation errors occur when "uintBitsToFloat(int)" gets used in OpenGLES
- User Reporting does not send reports when Managed Stripping Level is set to Low or higher
ilterbilguven
Feb 01, 2018 11:51
Reproduced on 2017.3.0p3