gradle build error [Fatal Error] checker-qual-2.5.2.pom:2:1: Content is not allowed in prolog - flutter

[Fatal Error] checker-qual-2.5.2.pom:2:1: Content is not allowed in prolog.
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all artifacts for configuration ':classpath'.
Could not resolve org.checkerframework:checker-qual:2.5.2.
Required by:
project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.analytics-library:crash:26.5.0 > com.google.guava:guava:27.0.1-jre
Could not resolve org.checkerframework:checker-qual:2.5.2.
Could not parse POM https://jcenter.bintray.com/org/checkerframework/checker-qual/2.5.2/checker-qual-2.5.2.pom
Content is not allowed in prolog.
Could not resolve org.glassfish.jaxb:jaxb-runtime:2.2.11.
Required by:
project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0 > com.android.tools:sdklib:26.5.0 > com.android.tools:repository:26.5.0
Could not resolve org.glassfish.jaxb:jaxb-runtime:2.2.11.
Could not parse POM https://jcenter.bintray.com/org/glassfish/jaxb/jaxb-runtime/2.2.11/jaxb-runtime-2.2.11.pom
Could not resolve com.sun.xml.bind.mvn:jaxb-runtime-parent:2.2.11.
Could not resolve com.sun.xml.bind.mvn:jaxb-runtime-parent:2.2.11.
Could not parse POM https://jcenter.bintray.com/com/sun/xml/bind/mvn/jaxb-runtime-parent/2.2.11/jaxb-runtime-parent-2.2.11.pom
Could not resolve com.sun.xml.bind.mvn:jaxb-parent:2.2.11.
Could not resolve com.sun.xml.bind.mvn:jaxb-parent:2.2.11.
Could not parse POM https://jcenter.bintray.com/com/sun/xml/bind/mvn/jaxb-parent/2.2.11/jaxb-parent-2.2.11.pom
Resetting to invalid mark
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 https://help.gradle.org
BUILD FAILED in 44s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

I had this same problem once. I found the problem was because of my firewall. I disabled the firewall for a while to run my app and it worked fine. After that, I added Android Studio to my firewall whitelist.
If the firewall is causing you the problem, disable the firewall and try to run it again. If it works, add Android Studio to the firewall whitelist.
Hope it helps :)
EDIT:
Since the above solution is not working, delete all the contents of the following directories after closing Android Studio:
C:\Users\username\.gradle\caches
C:\Users\username\.android\build-cache
C:\Users\username\.android\cache

Related

Gradle 7.4.2 building Scala project returns error "Could not resolve all files for configuration ':app:compileClasspath'"

I am just trying to follow the gradle tutorial to build a scala project https://docs.gradle.org/current/samples/sample_building_scala_applications.html.
However, I am facing the following error when I give the gradle commands "jar", "build" and "run":
Task :app:compileScala FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileScala'.
Could not resolve all files for configuration ':app:compileClasspath'.
Could not resolve org.scala-lang:scala-library:2.13.6.
Required by:
project :app
Could not resolve org.scala-lang:scala-library:2.13.6.
Could not get resource 'https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.pom'.
Could not GET 'https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.pom'.
Connection reset
Could not resolve com.google.guava:guava:30.1.1-jre.
Required by:
project :app
Could not resolve com.google.guava:guava:30.1.1-jre.
Could not get resource 'https://repo.maven.apache.org/maven2/com/google/guava/guava/30.1.1-jre/guava-30.1.1-jre.pom'.
Could not GET 'https://repo.maven.apache.org/maven2/com/google/guava/guava/30.1.1-jre/guava-30.1.1-jre.pom'.
Connection reset
* 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 https://help.gradle.org
BUILD FAILED in 8s
1 actionable task: 1 executed
Does someone know how to solve it? My main goal is to generate a jar file of the project.

after few days update to flutter 3.0.1, i got this error on flutter secure storage package

[Fatal Error] kotlin-stdlib-jdk7-1.5.30.pom:2:1: Content is not allowed in prolog.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.30.
Required by:
project :app
project :app > project :flutter_secure_storage >io.flutter:flutter_embedding_debug:1.0.0-caaafc5604ee9172293eb84a381be6aadd660317 > androidx.window:window-java:1.0.0-beta04 > org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2 > org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.2 > org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.30
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.30.
> Could not parse POM https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.5.30/kotlin-stdlib-jdk7-1.5.30.pom
> Content is not allowed in prolog.
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.30.
> Could not parse POM https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.5.30/kotlin-stdlib-jdk7-1.5.30.pom
> Content is not allowed in prolog.
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 https://help.gradle.org
BUILD FAILED in 1m
Exception: Gradle task assembleDebug failed with exit code 1

Is a Gradle file affected when you add new files

On Github while working with my friend on some code (actually experimental malware for pentesting), we set up a Gradle check, and it failed. When it ran, it said this:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'wurstplus-two'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT.
Required by:
project :
> Could not resolve net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT.
> Unable to load Maven meta-data from http://repo.spongepowered.org/maven/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml.
> Could not get resource 'http://repo.spongepowered.org/maven/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml'.
> Could not GET 'http://repo.spongepowered.org/maven/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml'. Received status code 520 from server: Origin Error
> Could not resolve org.spongepowered:mixingradle:0.4-SNAPSHOT.
Required by:
project :
> Skipped due to earlier error
* 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 https://help.gradle.org
BUILD FAILED in 11s
Error: Process completed with exit code 1.
I know we added some files, so I was thinking that might be what happened. I don't know any Gradle, so that's really why I'm asking.
There's actually 2 questions: What does "exit code 1" mean, and was it triggered by those new files being added? The Github repository is here: https://github.com/Scottw1e/wurstplus-two.
try replacing http://repo.spongepowered.org/maven/ with https://repo.spongepowered.org/maven/ in your build.gradle file

when i run my flutter app ,there emerge a unexpected problem , error :

What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not resolve project :path_provider_macos.
Required by:
project :app > project :path_provider
Unable to find a matching configuration of project :path_provider_macos: None of the consumable configurations have attributes.
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 https://help.gradle.org
BUILD FAILED in 2s
Finished with error: Gradle task assembleDebug failed with exit code 1
Some imports are missing. Try flutter pub get to update packages, or flutter pub cache repair, which will re-import all dependencies.
thank everyone , i get the solution about my problem : go to your Flutter sdk folder ,then go to .pub-cache\hosted\pub.dartlang.org\ ,if there have a path_provider_macos-0.0.4 folder ,delete it ,if no ,you try go .pub-cache\hosted\pub.flutter-io.cn\ , and remove path_provider_macos-0.0.4 folder
Deleted the folder you said,but show this wrong : Project :flutter declares a dependency from configuration 'embed' to configuration 'default' which is not declared in the descriptor for project :path_provider_macos.
The following is detailed:
> A problem occurred configuring project ':flutter'.
> Could not resolve all dependencies for configuration ':flutter:embed'.
> Could not resolve project :path_provider_macos.
Required by:
project :flutter
> Project :flutter declares a dependency from configuration 'embed' to configuration 'default' which is not declared in the descriptor for project :path_provider_macos.
> Could not resolve project :path_provider_linux.
Required by:
project :flutter
> Project :flutter declares a dependency from configuration 'embed' to configuration 'default' which is not declared in the descriptor for project :path_provider_linux.

cordova build errord gradle

i'm trying to install cordova and open a project on eclipse...this error is coming out when typing cordova build android i setted the proxy gradle.properties under project_folder\prova\platforms\android also under all gradle directory...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:1.0.0+.
Required by:
:android:unspecified
> Failed to list versions for com.android.tools.build:gradle.
> Unable to load Maven meta-data from https://repo1.maven.org/maven2/co
m/android/tools/build/gradle/maven-metadata.xml.
> Could not GET 'https://repo1.maven.org/maven2/com/android/tools/bu
ild/gradle/maven-metadata.xml'.
> Connection reset by peer: connect
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 25.641 secs
Built the following apk(s):
proxy settings:
systemProp.http.proxyHost=***
systemProp.http.proxyPort=3128
systemProp.http.proxyUser=***
systemProp.http.proxyPassword=***
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
systemProp.https.proxyHost=***
systemProp.https.proxyPort=***
systemProp.https.proxyUser=***
systemProp.https.proxyPassword=***
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
i've already read other post so i've already tryied different procedure...