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
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
- Fixing Message Loss in UMPE During Domain Reload
- The Editor freezes when ScheduleReadOnly of IJobParallelForTransform with dependency is used
- Text is truncated in the Inspector when the display scale is set to 150%
- CancellationTokenSource(<timeout>) has incorrect cancellation status when used in WebGL Player
- VFX property value names are cut off when properties with 'Arc' are viewed in the VFX Blackboard
ilterbilguven
Feb 01, 2018 11:51
Reproduced on 2017.3.0p3