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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
ilterbilguven
Feb 01, 2018 11:51
Reproduced on 2017.3.0p3