Search Unity

Explain Inapp purchase

Discussion in 'Getting Started' started by alexchandriyaa, Oct 25, 2017.

  1. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    i have no idea about inapp purchase i have just imported unity IAP plugin i dont know what to do can anyone give me some idea
     
  2. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
  3. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    i have gone through that and did the same but i got this error

    ERROR
    1. UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x00207] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:172
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    due to this i cant take build.. can u say how to solve this???
     
  4. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    I don't know sorry.
     
  5. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    @alexchandriyaa That's a pretty whacky error that's not related to any of your project code files. Are you sure you don't have problems with your installation or any other packages (specifically, DLLs) that may be included in your project?

    Can you build and run a completely empty, new project okay in your editor?
     
  6. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    A quick google and the results all seemed related to android. Are you making an android build? If so is your android SDK setup correctly?
     
    Schneider21 likes this.
  7. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    no i cant take empty build and i reinstalled all packages.
     
  8. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    ya android build only. SDK setup is correct
     
  9. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    That does seem to suggest something with the SDK isn't configured correctly, though. Can you build for other platforms, like native standalone for your system?
     
  10. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    yes i can take exe build but i cant take it for android and IOS
     
  11. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    I would definitely try reinstalling / configuring the Android SDK again, then.
     
  12. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    i tried several times if i import IAP plugin in unity i cant take build.. i have checked with the diferent unity versions too.
     
  13. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
  14. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    yes I did all these steps
     
  15. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Well, I guess I can't help you then. Perhaps you should file a bug report or open a support ticket then. Sorry!
     
  16. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    ok thank you soo much i reported a bug yesterday
     
  17. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    I can take normal android build but if i import IAP from unity i cant take build why i dont know
     
  18. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    CommandInvokationFailure: Failed to build apk.
    C:\Program Files\Java\jdk-9.0.1\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/Pictor/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

    stderr[
    Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at SDKMain.main(SDKMain.java:129)
    Caused by: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder
    at com.android.sdklib.internal.build.SignedJarBuilder.<init>(SignedJarBuilder.java:177)
    at com.android.sdklib.build.ApkBuilder.init(ApkBuilder.java:446)
    at com.android.sdklib.build.ApkBuilder.<init>(ApkBuilder.java:422)
    at com.android.sdklib.build.ApkBuilder.<init>(ApkBuilder.java:362)
    at UnityApkBuilder.<init>(UnityApkBuilder.java:214)
    at UnityApkBuilder.main(UnityApkBuilder.java:34)
    ... 5 more
    Caused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:563)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
    ... 11 more
    ]
    stdout[

    ]
    exit code: 1
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.HostView:OnGUI()
     
  19. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    now this is new error i have given correct path only but it always throws an error like this
     
  20. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Sorry, friend. My knowledge is limited to C# stuff, not build errors coming from the editor itself. Your best bet is to include all this information in the bug report you submitted.
     
  21. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    okie thank you anyways
     
  22. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    hey now its working have to downgrade sdk because unity lates version has this issue.. thank you
    now, i need to know about IAP i imported plugin and how can i check whether the accessories is purchased or not, while playing in editor i can see the popup with buy cancel option but while i take build it is not working i dont understand can u explain witrh example