BUILD FAILURE: Build failed with an exception

Getting Build Error After marge the below pull request
Merge pull request #3755 from grzesiek2010/COLLECT-3751

Commit: 4d1ec38ede2d506fd6566edbb4cc21874195e8cf [4d1ec38]
Parents: 162ddd63fe, 1497179cbd
Author: Grzegorz Orczykowski gorczykowski@soldevelo.com
Date: Friday, April 3, 2020 12:54:39 PM
Committer: GitHub

  1. Firstly it shows that upgrade your android version. Target version is not supported.
    [My version was 3.5.3 .After getting this instruction i have upload it to 3.6.2]

  2. Then goes to build and it shows :
    Deprecated Gradle features ware used in this build, make it incompatible with Gradle 7.0

Beside this IDE Re-commanded for "Android Gradle Plugin is ready to update".

  1. After update the Gradle when goes to build then it takes long time showing "Download bikram-sambat:1.1.0" and after that time shows below error:

Executing tasks: [:collect_app:assembleDebug] in project blah

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':collect_app:compileDebugJavaWithJavac'.

Could not resolve all task dependencies for configuration ':collect_app:debugCompileClasspath'.
Could not resolve bikramsambat:bikram-sambat:1.1.0.
Required by:
project :collect_app
Skipped due to earlier error
Could not resolve bikramsambat:bikram-sambat:1.1.0.
Could not get resource 'https://staging.dev.medicmobile.org/_couch/maven-repo/bikramsambat/bikram-sambat/1.1.0/bikram-sambat-1.1.0.jar'.

  • 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.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See

BUILD FAILED in 10m 37s


Updating the Android Gradle Plugin will change configuration files (you'll see changes in the project's build.gradle). This can require other things to be changed (in this case how the bikram dependency is pulled in).

To fix your issue you need to update your local repo to the latest code on Open Data Kit's repo's master branch. This has had the Android Gradle Plugin update applied already.

Dear @seadowg , many thanks for your reply. I have tried many other ways to compile the project. But Still i can't.
[previously it was ok to build ]
Currently i am using : Android Gradle Plugin Version: 3.6.2
and Gradle Version: 6.2.2

My current (last) commit is:

Commit: 7fc6002226593d4aeb79323a15720e32dd82aece [7fc6002]
Parents: a39529066a
Author: Callum Stott callum@seadowg.com
Date: Wednesday, April 8, 2020 10:37:29 PM
Committer: Callum Stott

If i try to build in offline gradle, then it shows below problem :

collect_app\src\main\java\org\odk\collect\android\fragments\dialogs\BikramSambatDatePickerDialog.java:28: error: package bikramsambat does not exist
import bikramsambat.BsGregorianDate;

It i try to build in Gradle online mode then it takes too long to "Download Bidramsambat....."

it takes more than 9+ min and then shows "Read timed Out" .
I am using hi-speed internet (5 mbps+).So, there don't have any internet connectivity issue.

after all of this issue.I have fresh download the project today (9-4-20) and try to build and getting the below errors.

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath'.

Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.android.tools.build:gradle:3.6.1.

Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: No cached version of com.android.tools.build:gradle:3.6.1 available for offline mode.

No other way i can complile the project.

Could you please guys check and upgrade the necessary files into git and help to complie the project.

I just deleted my local gradle cache and was able to rebuild succesfully. It doesn't seem like we're seeing this issue on CI or anywhere else either.

I'm wondering if there is a connection issue here. Could you run a ./gradlew clean assembleDebug for me after deleting your local gradle cache? Also are you able to hit https://staging.dev.medicmobile.org/_couch/maven-repo from you local machine? Is your connection running through any proxies or VPNs?

dear @seadowg: thanks again.
I am a windows 10 user. first clean the cache by :

gradlew cleanBuildCache
Then run
gradlew clean assembleDebug

Still problem .Output is as below:
Beside this , i can not hit to your provided link.

Output:

Microsoft Windows [Version 10.0.18362.720]
(c) 2019 Microsoft Corporation. All rights reserved.

D:\Java\ODKAndroidStudio>gradlew cleanBuildCache
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 10s
2 actionable tasks: 2 executed

D:\Java\ODKAndroidStudio>gradlew clean assembleDebug

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':collect_app:processDebugResources'.

Could not resolve all task dependencies for configuration ':collect_app:debugRuntimeClasspath'.
Could not resolve com.github.mohamadian:PersianJodaTime:1.2.
Required by:
project :collect_app
Could not resolve com.github.mohamadian:PersianJodaTime:1.2.
Could not get resource '/github/mohamadian/PersianJodaTime/1.2/PersianJodaTime-1.2.pom'.
Could not HEAD '/github/mohamadian/PersianJodaTime/1.2/PersianJodaTime-1.2.pom'.
Connect to oss.sonatype.org:443 [18.213.82.141, 3.227.194.83] failed: Read timed out

  • 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 help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See docs userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 3m 8s

So you're seeing an error when clicking on https://staging.dev.medicmobile.org/_couch/maven-repo? I'm wondering if it is blocked by your network setup in anyway. That repo should be availble and I can get to it fine.

dear @seadowg ,thanks again.
I am able to hit your provided link and already resolve other errors. But currently, i am facing an error "cannot resolve symbol IOUtils" . I have tried all the process mention in this below links https://stackoverflow.com/questions/24578243/cannot-resolve-symbol-ioutils and https://stackoverflow.com/questions/54914735/failed-to-resolve-org-apache-directory-studioorg-apache-commons-io2-6 but still problem exists. I have updated

build.gradle

implementation 'org.apache.directory.studio:org.apache.commons.io:2.4
api group: 'commons-io', name: 'commons-io', version: '2.6'

Then Sync the build.gradle.
But still problem exists.

ERROR:

collect_app\src\main\java\org\odk\collect\android\activities\FormEntryActivity.java:71: error: cannot find symbol
import org.apache.commons.io.IOUtils;
^
symbol: class IOUtils


Beside this, i have clean and rebuild project multiple times.

Currently i am using :
Android Gradle Plugin Version: 3.6.2
and Gradle Version: 6.3

Could you please guide or check/update necessary?Thanks in advance.

It looks like you have changes in build.gradle files, settings.gradle and gradle-wrapper.properties (and it looks like you've updated the Gradle version from 6.2.2 to 6.3. Could you revert them and check if you still have any problems? You shouldn't (hopefully) need to change any config files.

dear @seadowg , Thanks again.
I have set all those mentioned files as of the current available online version and reset the gradle version to 6.2.2 and it's working completely fine. many thanks for your support. Beside this, is there have any programming (code) flow documents available to understand the programming flow. I have read the https://docs.opendatakit.org/ .But those are nothing about programming flow. regards.

Great! I'd start with the README.md which links to various other pieces of documentation we have.