Search Unity

Erorr in build when import IAP

Discussion in 'Unity IAP' started by electr1on, Sep 19, 2018.

  1. electr1on

    electr1on

    Joined:
    Mar 21, 2018
    Posts:
    28
    when I import IAP I cant build.
    Please Help me.


    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Java/jdk1.8.0_91\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please provide exact steps to reproduce and sufficient information to troubleshoot. Does it work with Internal build? What version of Unity and IAP are you using? Did it build prior to adding IAP? Can you provide a minimum project that demonstrates the issue? Did you try with the sample project? https://forum.unity.com/threads/sample-iap-project.529555/
     
  3. electr1on

    electr1on

    Joined:
    Mar 21, 2018
    Posts:
    28
    Hey thanks for replaying me.
    My unity verison is 2017.3.1f1.
    It doesn't work with Internal build.
    Yes, It works great without the Plugin of IAP.
    I really don't what to do... I hope you help me, thanks!
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please test with a brand new empty project and test the import of IAP. I suspect you may have a compiler issue prior to import which makes the install fail.
     
  5. electr1on

    electr1on

    Joined:
    Mar 21, 2018
    Posts:
    28
    I already did it. When I remove the plugin( IAP) the build works, but when I have this plugin the build failed.

    The erorr:

    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Java/jdk1.8.0_91\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"
    stderr[
    \\?\C:\Users\USER\Desktop\Unity Projects\InAppPurchase\Temp\gradleOut\build\intermediates\manifests\full\release\AndroidManifest.xml:83: AAPT: No resource identifier found for attribute 'enableVrMode' in package 'android'

    \\?\C:\Users\USER\Desktop\Unity Projects\InAppPurchase\Temp\gradleOut\build\intermediates\manifests\full\release\AndroidManifest.xml:83: error: No resource identifier found for attribute 'enableVrMode' in package 'android'
    FAILURE: Build failed with an exception.
    * What went wrong:
    Execution failed for task ':processReleaseResources'.
    > com.android.ide.common.process.ProcessException: Failed to execute aapt
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    BUILD FAILED in 16s
    ]
    stdout[
    Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
    NDK is missing a "platforms" directory.
    If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Program Files\Android\sdk-tools-windows-3859397\ndk-bundle.
    If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
    The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead.
    The getTestClassesDir() method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the getTestClassesDirs() method instead.
    The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File) instead.
    :preBuild UP-TO-DATE
    :preReleaseBuild UP-TO-DATE
    :checkReleaseManifest
    :preDebugBuild UP-TO-DATE
    :prepareCommonLibrary
    :prepareGoogleAIDLLibrary
    :prepareGooglePlayLibrary
    :prepareReleaseDependencies
    :compileReleaseAidl
    :compileReleaseRenderscript
    :generateReleaseBuildConfig
    :generateReleaseResValues
    :generateReleaseResources
    :mergeReleaseResources
    :processReleaseManifest
    :processReleaseResources FAILED
    12 actionable tasks: 12 executed
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1 progress, System.String error)
    UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
    Rethrow as GradleInvokationException: Gradle build failed
    UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You look to be receiving a known VR error. When you import IAP, you are prompted to "Update API, have you made a backup?" You must answer Yes to this question. If this happens on a brand new project, and you get the popup but still get the error, then this machine is misconfigured (note the error NDK is missing a "platforms" directory). Please try building to iOS as a test, as well as updating Android Studio (if you have it installed). You can also try this Sample project which is known to work https://forum.unity.com/threads/sample-iap-project.529555/
     
  7. electr1on

    electr1on

    Joined:
    Mar 21, 2018
    Posts:
    28
    Hey
    I updated Android Studio and then I updated the API and it works!! I can build.
    I really appreciate you helping me so much.
    Thanks a lot man!