Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Android Export with SDK failed

Discussion in 'Android' started by Knerbelapps, Nov 6, 2017.

  1. Knerbelapps

    Knerbelapps

    Joined:
    Oct 11, 2017
    Posts:
    2
    Hey there...
    the following problem drives me crazy:
    I want to create a release version of my (working!) unity project for android.
    Exporting in debug mode works fine.
    But with a SDK in use, I always get error messages.:


    Internal:
    CommandInvokationFailure: Failed to sign APK package.
    C:\SDK\build-tools\26.0.2\apksigner.bat sign --ks "C:/MonAddict_U/Release_Test/user.keystore" --ks-pass pass:"keystore" --ks-key-alias "test" --key-pass pass:"keystore" "C:\MonAddict_U\Release_Test\Temp/StagingArea/Package.apk"

    stderr[
    Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.
    ]

    I even tried it with grandle:
    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Java/jdk1.8.0_151\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-2.14.jar" org.gradle.launcher.GradleMain "assembleRelease"

    stderr[

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':transformClassesWithDexForRelease'.
    > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/tappx/sdk/android/BuildConfig;


    Please help me, it seems hopeless...
    Thank you in advance
     
  2. reedny

    reedny

    Joined:
    Mar 4, 2017
    Posts:
    57
    This class is in multiple places in your app/config: com.tappx.sdk.android.BuildConfig
    In Android Studio you can look at the packages and classes in the project - just look for this class, you will find it in 2+ places.
     
  3. JadeTheFlame

    JadeTheFlame

    Joined:
    Jul 27, 2014
    Posts:
    7
    What class? Did he reference a class?
    I really need the internal build fix on this error. Building in Gradle gives issues relating to the AndroidManifest.xml "@Integer/google_play_services_version" conflicts, and commenting out the tag disables google play services from working.
     
  4. reedny

    reedny

    Joined:
    Mar 4, 2017
    Posts:
    57
    The class (com.tappx.sdk.android.BuildConfig) is part of the android classes, probably not from the developer. If you are building in the Unity Editor you can click on the error message in the console and paste into Notepad++ (or other text editor) and you will see the details of the error output that lists the class and its multiple locations.