Tag Archives: Unity Package Error

[Solved] Unity package Error: CommandInvokationFailure: Gradle build failed.

CommandInvokationFailure: Gradle build failed.
F:/Program Files/Unity/2017.4.31f/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath “F:\Program Files\Unity\2017.4.31f\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.0.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx4096m” “assembleRelease”

 

Solution:

if there is where in the error message: followed by garbled characters, it means that the path is wrong, and neither the project nor the signature can be in English.

[Solved] Unity Package Error: Failed running D:\Program Files\Unity2018.4.1\Editor\Data\il2cpp/build/il2cpp.exe

Today, I tried to access the company’s overseas SDK. The total package error is as follows:

Failed running D:\Program Files\Unity2018.4.1\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARMv7" --configuration="Release" --outputpath="E:\TombNote_tChinese_test\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so" --cachedirectory="E:\TombNote_tChinese_test\Assets\..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="D:\Program Files\Unity2018.4.1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="D:\Program Files\Unity2018.4.1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="E:/AndroidSDK/NDK" --map-file-parser="D:\Program Files\Unity2018.4.1\Editor\Data\Tools\MapFileParser\MapFileParser.exe" --directory="E:\TombNote_tChinese_test\Temp\StagingArea\assets\bin\Data\Managed" --generatedcppdir="E:\TombNote_tChinese_test\Temp\StagingArea\Il2Cpp\il2cppOutput"

stdout:
Building libil2cpp.so with AndroidToolChain
    Output directory: E:\TombNote_tChinese_test\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a
    Cache directory: E:\TombNote_tChinese_test\Library\il2cpp_android_armeabi-v7a\il2cpp_cache
ObjectFiles: 603 of which compiled: 0
Total compilation time: 242 milliseconds.
il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: E:\AndroidSDK\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\RFL\AppData\Local\Temp\tmp80DF.tmp" -o "E:\TombNote_tChinese_test\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_EC005744B79151E709C4C1D5591AE889\libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "E:\AndroidSDK\NDK\platforms\android-16\arch-arm" -gcc-toolchain "E:\AndroidSDK\NDK\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" -target armv7-none-linux-androideabi -Wl,--wrap,sigaction -L "E:\AndroidSDK\NDK\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a" -lgnustl_static -llog -rdynamic -fuse-ld=gold.exe

E:\TombNote_tChinese_test\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_Assembly-CSharp_2.cpp:43762: error: undefined reference to 'CallSDKFunc'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

Results the data was checked because [dllimport (“_internal”)]
of OS cannot exist when Android is typed.

Solution:
find [dllimport (“_internal”)]
Add judgment platform in the code

#if UNITY_ IOS
[DllImport(“__Internal”)]
#endif

[Solved] Unity Package Error: FAILURE: Build failed with an exception.

Main error reports:

> Using multiple versions of the Android gradle plugin in the sample build is not allowed.
meaning: using multiple versions of the Android gradle plugin in the same version is not allowed.

positioning:
gradle version problem in
unit

Solution:
there is a gradle version file in the project
launchertemplate
maintemplate
find a code similar to the following

buildscript {
    repositories {
        mavenCentral()
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.3'
**BUILD_SCRIPT_DEPS**}

If not, add
as shown in the figure

to ensure that the version numbers (3.4.3) in the two files are consistent