I am trying to build my Android project in Unity 2019 and get this error at the end of the build process:
Build failure
com.android.build.api.transform.TransformException:
com.android.builder.dexing.DexArchiveBuilderException:
com.android.builder.dexing.DexArchiveBuilderException: Failed to
process /Users/spin/.gradle/caches/transforms-1/files-
.1/com.android.support.support-fragment-2
6.1.0.aar/ccd5e1b70db7ab174f18c2e28670dc6a/jars/classes.jar See the
Console for details.
In older versions on Unity, I used the Internal option as the build system, but 2019 version does not have that. So it looks like it uses the Gradle which I don't know much about.
Any ideas how to fix?
you need to download and install JDK, SDK then accurate the path then -> go to preferences -> go to external tool and then accurate the JDK, SDK file folder in unity android build setting
then make sure your android connected with your PC and build your unity android app in your mobile
in addition, you can download unity current version android build to support your problem will be solved easily
GD-Developer Sohaib Kh thanks
Related
at the first experience with android, I don't install android studio!
Just cloned a project and search according to see gradlew.bat file. but when I run it:
PS D:\projects\android> .\gradlew.bat assembleDebug g
FAILURE: Build failed with an exception.
* Where:
Settings file 'D:\projects\android\settings.gradle'
* What went wrong:
Could not compile settings file 'D:\projects\android\settings.gradle'.
> startup failed:
General error during semantic analysis: Unsupported class file major version 61
java.lang.IllegalArgumentException: Unsupported class file major version 61
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:196)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:177)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:163)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:284)
at org.codehaus.groovy.ast.decompiled.AsmDecompiler.parseClass(AsmDecompiler.java:81)
...
my settings.gradle:
include ':vlc-android-sdk-3.0.0'
include ':app'
rootProject.name = "DSM"
is SDK needed? what's emulator has used in this link: https://developer.android.com/studio/build/building-cmdline
how can I build apk finally?
Yes, you need the Android SDK to build, run and debug apps! if you don't want to install Android Studio, you can download the basic Android command-line tools from this link: https://developer.android.com/studio#downloads. You can use the included SDK manager to download other SDK packages.
The above-mentioned error is also thrown when an incorrect JDK version is installed in your system. [Also] make sure you also set up environment variables like ANDROID_HOME, JAVA_HOME, and platform-tools with their respective locations on your pc. most of this setup is taken care of by default on installing Android Studio!
I never use this method to compile my android project into an .apk
I use an alternative method which I find easier than compiling .apk in the android project.
What I do is -
Build the Android Project by clicking on the build icon.
After the build is successful, Open File Explorer of on your PC.
Then going to the file location - D:\User\Android Studio 4.0.1\Applications\SampleApp\app\build\outputs\apk\debug
Now drag the .apk file to upload it anywhere!
For testing it in mobile without connecting USB, you can Gmail yourself by uploading the file through Google Drive. And then downloading the .apk through Gmail in the Mobile Device.
NOTE : the file location I have mentioned in Point 3 is different than yours, because I always keep my projects in D: drive. It would be similar after you go to your application folder (after SampleApp folder).
I've been trying to integrate Android Emulator in my Jenkins workflow on my Windows PC using this plugin. I've been facing this error.
Started by user admin
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building in workspace C:\Users\user\.jenkins\workspace\Testing if android emulator works
[android] Outdated SDK Tools found. Upgrading from '26.1.1' to 'build 6609375'
[android] Android SDK installation failed
[android] hudson.plugins.android_emulator.SdkInstallationException: Failed to download Android SDK
at hudson.plugins.android_emulator.SdkInstaller.doInstall(SdkInstaller.java:91)
at hudson.plugins.android_emulator.SdkInstaller.install(SdkInstaller.java:72)
at hudson.plugins.android_emulator.AndroidEmulator.setUp(AndroidEmulator.java:278)
at hudson.model.Build$BuildExecution.doRun(Build.java:157)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:514)
at hudson.model.Run.execute(Run.java:1907)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by: java.io.IOException: Failed to donwload SDK archive
at hudson.plugins.android_emulator.SdkInstaller.installBasicSdk(SdkInstaller.java:189)
at hudson.plugins.android_emulator.SdkInstaller.doInstall(SdkInstaller.java:89)
... 8 more
Finished: NOT_BUILT
I have taken the following steps after seeing people's discussions on SO and other websites (but haven't been able to resolve the issue):
Updated to latest android skd, and sdk command line tools. Also, updated possibly everything else that I could from Android Studio.
Added windows/system32 in path in env variables
Ran cmd as admin to run jenkins (realised later that it's a bad idea as scripts can do anything)
Went to http://localhost:8080/configure > set Android SDK root variable.
Went to http://localhost:8080/configure > tick Environment variables > set ANDROID_HOME & JAVA_HOME variables.
Went to http://localhost:8080/configureTools/ > set jdk installation.
Note: I've verified that all environment variables are correct.
Here's some of my thought process:
The error message says that it's trying to update tools from v 26.1.1 to a newer version. But I don't even have sdk tools of this version in my Android SDK!
This may hint to a dual installation of Android sdk but there only one. And after that, I don't know what's wrong...
I'm stuck on this for several days now & any help or suggestion will be greatly appreciated :)
In the ENV, you specified paths to internal Android SDK tools? For example, you add to PATH /emulator and /platform-tools folders? This folders contains in the Android SDK root.
I have created freestyle Jenkins project which supposed to run gradle script to build android artifacts and publishe it to some repostitories. It fails though. When I check logs error message says:
Failed to install the following SDK components:
emulator Android Emulator
Install the missing components using the SDK manager in Android Studio.
Obviously I can not install Android Studio on Jenkins server. Have anyone encountered such a problem before and how can one fix this?
I just started learning building andoriod apps using Microsoft's open source software called taco, and I followed the steps they have on taco.tools and the problem comes when I use the Command taco build android I get the error No install build tools found , Error:cmd: commmad failed with exit code 1. I have however installed the build tools and checked if they were installed via the sdk manager.
Please see images
and also
It looks like you have two installs of the Android SDK. To fix: set your environment variable ANDROID_HOME=C:\Users\Insight\AppData\Local\Android\android-sdk
This issue is caused by Visual Studio installing the SDK into AppData, and Taco installing the SDK into Program Files.
I'm trying to build Terminal Emulator for Android. I'm running Android Studio 1.4 in Kubuntu 15.04. I also tried building it in Ubuntu 14.04 LTS with the same results. The project requires the latest Android NDK, SDK 22, and SDK 11 which I've downloaded and configured in Android Studio. My system gradle version is 2.8, and Android Studio has downloaded some other versions internally. I'm using jdk1.8.0_65, which is set to JAVA_HOME and configured in Android Studio. I've built several other projects with my configured Android Studio and only seem to have a problem with this project. I need to use this project as a base for an app I'm developing.
I end up with same error, posted below, no matter what route I take to fix it in Android Studio. This is generally what I've done to try and get the project to work. I open up the project unmodified in Android Studio. I click Build >> Rebuild Project. I get an error telling me ndk implementation is deprecated. I add a file gradle.properties to the root directory of the project with the line android.useDeprecatedNdk=true and rebuild. It gives me an error: Task 'generateDebugTestSources' not found in project. I execute Sync Project With Gradle Files to resolve it. Then I end up with the following error and can't get past it.
Gradle 'Android-Terminal-Emulator-master' project refresh failed
Error:exception during working with external system:
or
Gradle sync failed: exception during working with external system:
Consult IDE log for more details (Help | Show Log)
idea.log
Things I've done to try and get the project to build:
Modify all of the project's build.gradle files to use the experimental plugin
Use different versions of Android Studio
Switch from openjdk to Oracle's jdk
Upgrade gradle to the latest version
Set gradle to default wrapper (default) and also set gradle to different versions
invalidate cache, remove ~/.gradle, and rebuild project
Make sure PATH includes the gradle and jdk bin directories and is in ~/.bashrc, ~/.profile, and ~/.zshrc
remove proguard from libtermexec library
reboot computer
I should note that the project builds without issue on the command line. I'd really like to get the project to build in Android Studio for development.
Install Arch and run Android Studio there.
I decided to try building Terminal Emulator on my Arch server, so I installed a xfce (Desktop Environment) and Android-Studio through pacman. I followed the same general path to get things setup, and the app built without issue.
The idea log Android Studio generated for the failed build on Windows and Ubuntu didn't point to any clear problem, even with --stacktrace enabled with gradle. I'm not going to waste my time figuring out why gradle doesn't want to build apps in Ubuntu or Windows.