unity 2017.4.17中的build adroid和build app bundle中的此错误是什么?

时间:2019-06-20 13:43:10

标签: unity3d build.gradle

enter image description here enter image description here

在Unity 2017.4.17中构建android时出现一些错误

我对Unity 5.3.4p3没问题,但是Google Play不接受我的游戏,它希望使用x64,所以我更改为unity 2017.4.17,并在gradle中单击构建应用程序捆绑包(google play),但我遇到错误< / p>

**我在PC上安装了一些统一版本:统一5.3.4p3,统一5.4.0.3,统一2017.4.17,统一2018.2.18,统一2018.2.15,统一2017.4.28,统一2017.4.29,统一2019.1。 2,统一为2019.1.5,但它们不起作用...请帮助我...请帮助我

我附上错误
这个错误是

  

渐变构建失败,请参见控制台以获取详细信息

enter image description here

我在unity 2019.1.5中也遇到了这个错误

请帮助我

我在此错误中停留30天,无法越过 谢谢

我在下面写了错误:

  

CommandInvokationFailure:Gradle构建失败。   C:/ Program Files / Java / jdk1.8.0_192 \ bin \ java.exe -classpath“ F:\ files \ pc \ Video \ artoon \ program files \ UnitySetup64-2017.4.17f1 \ Unity \ Editor \ Data \ PlaybackEngines \ AndroidPlayer \ Tools \ gradle \ lib \ gradle-launcher-4.6.jar“ org.gradle.launcher.GradleMain” -Dorg.gradle.jvmargs = -Xmx4096m“” bundleRelease“

stderr [

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'gradleOut'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:2.3.0.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:2.3.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.0/gradle-2.3.0.pom'.
            > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.0/gradle-2.3.0.pom'.
               > jcenter.bintray.com

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 32s
]
stdout[
Starting a Gradle Daemon (subsequent builds will be faster)
]
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)


Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0020e] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:181 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:88 
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

enter image description here

这是UnitySetup64-2017.4.17f1> Unity> Editor> Data> PlaybackEngines> AndroidPlayer> Tools> GradleTemplates中的mainTemplate文件:

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
    }
}

allprojects {
   repositories {
      google()
      jcenter()
      flatDir {
        dirs 'libs'
      }
   }
}

apply plugin: 'com.android.application'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
**DEPS**}

android {
    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    defaultConfig {
        targetSdkVersion **TARGETSDKVERSION**
        applicationId '**APPLICATIONID**'
        ndk {
            abiFilters **ABIFILTERS**
        }
    }

    lintOptions {
        abortOnError false
    }

    aaptOptions {
        noCompress '.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**
    }

**SIGN**
    buildTypes {
        debug {
            minifyEnabled **MINIFY_DEBUG**
            useProguard **PROGUARD_DEBUG**
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD**
            jniDebuggable true
        }
        release {
            minifyEnabled **MINIFY_RELEASE**
            useProguard **PROGUARD_RELEASE**
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD**
            **SIGNCONFIG**
        }
    }
**PACKAGING_OPTIONS**
    bundle {
        language {
            enableSplit = false
        }
        density {
            enableSplit = false
        }
        abi {
            enableSplit = true
        }
    }
}


**SOURCE_BUILD_SETUP**```

2 个答案:

答案 0 :(得分:0)

实际上,我遇到了几乎相同的错误和一些其他错误

  

无法获取资源   'https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.0/gradle-2.3.0.pom'。

上述错误可能是由于您计算机中的互联网不可用引起的。

那么如何解决?

在构建APK时,请确保已连接到互联网。 Unity负责其他事情

答案 1 :(得分:0)

我解决了这个问题,只需在播放器设置中选择“缩小发行版Gradle

  1. 转到播放器设置
  2. 向下滚动
  3. 查看发布设置
  4. 请参阅缩小
  5. 选择版本(Gradle)和调试(Gradle
  6. 一切都会好起来的

    Screenshot