gradle sync failed due to ASCII open file - firebase

When i try to connect my project in firebase an error raise. It shows, gradle sync failed and ASCII open file. How to solve it? Please give a way.

I changed dependency at gradle.build - Project as follows :
dependencies { classpath 'com.android.tools.build:gradle:3.0.0' classpath 'com.google.gms:google-services:3.1.0' }

Related

Flutter - Error after include cloud firestore dependency.[Resolved]

I'd like a help to resolve this Issue. I cannot build my flutter application after insert the cloud firestore dependency at the pubspec.yaml
dependencies:
flutter:
sdk: flutter
firebase_core: ^0.4.3+2
cloud_firestore: ^0.13.0+1
Error description:
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not resolve io.grpc:grpc-core:[1.21.0].
Required by:
project :app > io.grpc:grpc-okhttp:1.21.0
Failed to list versions for io.grpc:grpc-core.
Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
Connection reset
Failed to list versions for io.grpc:grpc-core.
Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
Connection reset
Failed to list versions for io.grpc:grpc-core.
Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
Connection reset
This seems to be an internet connection problem, so please check your network.
This is more looking as if some connection issues are present,but if not then
First of all checkout your .gradle version it should be greater than 5
If you have created your project recently or under one month then you may need to check this step.
Then go to android/build.gradle and check your dependencies It should look like
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
}
If you donot use kotlin support then no need to write that classpath.Its for those who has kotlin support enabled by default.
In android/gradle.properties
you should have
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
in app level build.gradle
defaultConfig {
minSdkVersion 23
}
and most importantly you should have downloaded your google-services.json file in your android project folder. For Firebase you also require sha1 or sometimes sha256 keys.
Now it should run properly.
May it helped you :)
`

Gradle implementation vs compile in jar task

I can successfully use Gradle to compile a fat JAR, but having trouble running the JAR after recently switching from the "compile" dependency specification to the "implementation/api" specification. I have isolated that the problem occurs in only one of the two following cases. The application runs in either case inside IntelliJ.
first/problem:
dependencies {implementation 'no.tornado:tornadofx:1.7.18'}
second/works:
dependencies {compile'no.tornado:tornadofx:1.7.18'}
The JAR compiles in both cases. The problem appears when I attempt to start the first case JAR on the command line and it throws the following error.
C:\aaa_eric\code\testr\mic\build\libs>java -jar mic-1.0-snapshot.jar
Error: Could not find or load main class app.MyApp
Caused by: java.lang.NoClassDefFoundError: tornadofx/App
Here is the JAR task in build.gradle. Is it possible that the tornadofx dependency is available at compile time, but not at run time? Thanks for any help.
jar {
manifest {
attributes 'Main-Class': 'app.MyApp'
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
Changing configurations.compile.collect to configurations.compileClasspath.collect fixed the problem for me.
I was having the same problem and stumbled across this in https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/ConfigurationContainer.html:
An example showing how to refer to a given configuration by name in
order to get hold of all dependencies (e.g. jars, but only)
apply plugin: 'java' //so that I can use 'implementation', 'compileClasspath' configuration
dependencies {
implementation 'org.slf4j:slf4j-api:1.7.26'
}
//copying all dependencies attached to 'compileClasspath' into a specific folder
task copyAllDependencies(type: Copy) {
//referring to the 'compileClasspath' configuration
from configurations.compileClasspath
into 'allLibs'
}
One thing to note is that configurations.compileClasspath.collect worked for me even when I was using the compile specification instead of implement.

Could Not File: Corda Crash Shell during Gradle Build

We are using artifactory to connect through a firewall to the internet. When running ./gradlew clean build we get the following exception message:
Could not resolve all dependencies for configuration ':java-source:testCompileClasspath'.
> Could not find com.github.corda.crash:crash.shell:9d242da2a10e686f33a3aefc69e4768824ad0716.
Searched in the following locations:
http://code-artifacts.bankofamerica.com:18081/artifactory/virtual-java/com/github/corda/crash/crash.shell/9d242da2a10e686f33a3aefc69e4768824ad0716/crash.shell-9d242da2a10e686f33a3aefc69e4768824ad0716.pom
http://code-artifacts.bankofamerica.com:18081/artifactory/virtual-java/com/github/corda/crash/crash.shell/9d242da2a10e686f33a3aefc69e4768824ad0716/crash.shell-9d242da2a10e686f33a3aefc69e4768824ad0716.jar
Required by:
project :java-source > net.corda:corda-node-driver:1.0.0 > net.corda:corda-test-utils:1.0.0 > net.corda:corda-node:1.0.0
We are wondering if the version number of crash.shell is having an affect on jar lookup.
In Corda V1.0, net.corda:corda-node:1.0.0 lists com.github.corda.crash:crash.shell:9d242da2a10e686f33a3aefc69e4768824ad0716 as a compile dependency. This corresponds to https://github.com/corda/crash/tree/9d242da2a10e686f33a3aefc69e4768824ad0716/shell.
If you are behind a firewall and this dependency isn't present in your artifactory, the build will fail.
This is now in the R3 corda-dependencies repo so you just need to update your build.gradle:
repositories {
jcenter()
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases' }
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-dependencies' }
}

While trying to run "gradle test jacoco" in gitbash I am getting TestExecutionException, NoClassDefFoundError, ClassNotFoundException

While trying to run jacoco in my gradle project, I am getting exceptions.
I have added following dependencies:
compile "org.jacoco:org.jacoco.report:0.7.8"
compile "org.jacoco:org.jacoco.core:0.7.8"
compile "org.ow2.asm:asm-all:5.1"
I also tried with different options like providedCompile, testCompile also.
I am getting this exception, while trying to run "gradle test jacoco" in gitbash.
Exceptions:
org.gralde.api.tasks: TaskExecutionException: Exception failed for
task:'practice-app:jacocoTestReport'
Caused by: java.lang.NoClassDefFoundError:
org/jacoco/report/IReportVistor
Caused by: java.lang.ClassNotFoundException:
org.jacoco.report.IReportVisitor
I also verified other checks like jacoco jars available in my local gradle repo etc.
I had also experienced the similar problem during Jacoco integration in one of our gradle project. The plugin somehow did not bring the required jars. Then, I tried to add all the dependencies manually
say :-
compile "org.jacoco:org.jacoco.report:0.7.8"
compile "org.jacoco:org.jacoco.core:0.7.8"
compile "org.ow2.asm:asm-all:0.7.8"
etc., but that trick also did not work. Still got classnotfound exception against jacoco jars. Then after a lot hit & trial, I came to know about jacocoClasspath. I did the followings:
1) First changed Jacoco version to
jacoco {
toolVersion = "0.7.8+"
}
As got some incompatibility version issue (Don't remember the exact error/exception).
2) Then, added the below code in build.gradle to ensure that required dependencies are present in the jacoco class path.
jacocoTestReport.doFirst {
configurations.testRuntime.each { jacocoClasspath += files(it); }
}
Notes:
1) doFirst will be executed before jacoco task gets executed.
2) I just added whatever present in my runtime to the jacocoClasspath. You may refine the code, to add only the required jars to the jacoco class path.

dependency resolution issue in gradle

i developed project in gradle using hadoop and hive dependencies below are the dependencies of project
org.apache.hive:hive-common:1.2.1'
'org.apache.hive:hive-service:1.2.1'
'org.apache.hive:hive-metastore:1.2.1'
'org.apache.derby:derby:10.11.1.1'
'org.apache.hive:hive-jdbc:1.2.1'
but i am facing below error which i am unable to resolve wonderful thing is that if i build the project using maven and added same dependencies in maven project its working fine could you please let me know problem associated with gradle
error:
Could not resolve all dependencies for configuration ':compile'.
> Could not find org.pentaho:pentaho-aggdesigner-algorithm:5.1.5-jhyde.
Searched in the following locations:
https://jcenter.bintray.com/org/pentaho/pentaho-aggdesigner-algorithm/5.1.5-jhyde/pentaho-aggdesigner-algorithm-5.1.5-jhyde.pom
https://jcenter.bintray.com/org/pentaho/pentaho-aggdesigner-algorithm/5.1.5-jhyde/pentaho-aggdesigner-algorithm-5.1.5-jhyde.jar
Required by:
:HiveUnit:unspecified > org.apache.hive:hive-service:1.2.1 > org.apache.hive:hive-exec:1.2.1 > org.apache.calcite:calcite-core:1.2.0-incubating
You need to add the suggested hack in your build.gradle file
repositories {
mavenCentral()
maven {
url "http://conjars.org/repo"
}
}
As hack could be used
repositories {
mavenCentral()
maven {
url "http://conjars.org/repo"
}
}

Resources