I am currently working on a android application which has CI/CD implementation. Everything was working as expected for gradle version 2.0.1. I was able to run ./gradlew clean build command but recently I have upgraded Application to gradle version 3.4.1.
I am able to run the application on Android Device and Android Emulator.
However When I am running the same command in terminal build process is getting haulted while doing lint analysis.
I was using android studio version 3.0.1 with gradle version 2.0.1. Application has CI implementation using Jenkins. project was building fine with the configurations when built using ./gradlew clean build.
Recently I have upgraded Android studio to version 3.4.1 and also gradle to 3.4.1 and migrated project from support library to AndroidX.
I am able to upgrade project with some minor warnings. Also able to ran project on Mobile device and on emulator.
However when I try to build project using gradle command then progress is getting stuck while performing lint and goes in infinite loop.
I kept it running for 18 hrs and it kept running.
./gradlew clean build
Project should build fine but somehow lint is not getting completed. Is there any way I can resolve this issue or I can skip lint checks while building the code.
Related
Surprisingly, my project is completely written and developed in Java only, it's also not containing any dependencies declared for Kotlin. Yet I'm receiving this weird error:
A problem occurred configuring project ':app'.
Configuration:
When I use the below configuration, it works perfectly fine, builds the project and the app gets installed on my device/emulator:
Android Studio Version: 3.1 Stable release
Gradle Plugin Version: 3.0.1
Gradle Distribution URL:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
BUT When I use the latest configuration declared below, the error occurs while running the app as shown in the images:
Android Studio Version: 3.1 Stable release
Gradle Plugin Version: 3.1.0
Gradle Distribution URL:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Steps I've followed/things I've tried:
Clean Project
Rebuild Project
Sync Project
Deleting build folder from project tree
Checked that project doesn't contain any names, references or declarations missing
Invalidate Caches/Restart
Check the whole dependency tree to make sure any Kotlin dependency is not imported or used as my project doesn't make use of Kotlin language
None of the above have worked!
I think instant run might be creating issue .
Do one thing disable instant run in android studio and try again .I think it might will resolve issue .
Try to update Android Studio. Turn off Instant Run from Settings → Build, Execution, Deployment → Instant Run and uncheck Enable Instant Run.
I have an Android project which includes a JavaScript app. The JS app uses Yarn for package installation and running the build script. When building from the terminal with the Gradle Wrapper everything works fine. But when I try to build/run the project from IntelliJ/Android Studio all environment variables I have set for my account (including $PATH) are reset. It seems like the Gradle runner in IntelliJ and Android Studio executes the build in an isolated shell. Since $PATH is not properly set up, it doesn't find Yarn and Node to build the JavaScript app.
I've searched through all settings in IntelliJ and Android Studio and couldn't find anything related to environment configuration for Gradle. Did anyone else have this issue?
Opening up a terminal in IntelliJ itself and running Gradle from there works properly.
I'm working on macOS Sierra with IntelliJ 2017.3 and Android Studio 3.0.1. The only reason I'm using both is that after not working in Android Studio I thought it might run in IntelliJ.
It seemed to be a bug in Android Studio. I needed to set at least one environment variable in Android Studio itself and then it suddenly also picked up all existing env properties.
For me it got solved when I updated Android studio from 3.0.1 to version 3.1.3.
I've updated to Android Studio 3.0 and now I cannot run the app with Instant Run enabled.
I get 'Execution failed for task' due to a java.io.FileNotFoundException because it can't find the apk under
../build/intermediates/instant-run-resources/resources-production/
Any idea how to overcome this so that I can run the project with Instant Run?
I'm not sure where to find the missing apk file or how to change the path to look for it in.
Have your settings as below,
Otherwise try to clean and re-install (after uninstalling exsisting apk) application.
I found the problem and the solution.
In my case the cause was dexcount-gradle-plugin. The plugin is expecting that the package task produces an APK, but that is not true anymore on Instant Run. So they released a new version that disables the process when running with Instant Run.
So I just had to update dexcount to the latest version.
Configure your project for Instant Run
Android Studio enables Instant Run by default for projects built using Android plugin for Gradle 2.3.0 and higher.
Please checkout this LINK to configure your project for instant run.
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.
I have problem with building my project in android studio.
I cant do ./gradlew clean and ./gradlew build from terminal and all is completed successful.
When im trying to click "Rebuild project" in android studio, im getting error:
org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.: Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
I think it happened, when I updated my Android Studio. Can you help me solve this problem?
Im using Kubuntu 13.10.
I needed to update Gradle to 1.8 and change it in project gradle Wrapper.