Explore all Maven open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Maven

jib

jib-cli v0.10.0

jsonschema2pojo

1.1.1

google-java-format

v1.15.0

DependencyCheck

Version 7.0.4

jetcache

Popular Libraries in Maven

awesome-mac

by jaywcjlove doticonjavascriptdoticon

star image 45297 doticonCC0-1.0

 Now we have become very big, Different from the original idea. Collect premium software in various categories.

jib

by GoogleContainerTools doticonjavadoticon

star image 11721 doticonApache-2.0

🏗 Build container images for your Java applications.

jsonschema2pojo

by joelittlejohn doticonjavadoticon

star image 5699 doticonNOASSERTION

Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc

gradle-retrolambda

by evant doticonjavadoticon

star image 5385 doticonApache-2.0

A gradle plugin for getting java lambda support in java 6, 7 and android

useful-java-links

by Vedenin doticonjavadoticon

star image 5162 doticonNOASSERTION

A list of useful Java frameworks, libraries, software and hello worlds examples

google-java-format

by google doticonjavadoticon

star image 4425 doticonApache-2.0

Reformats Java source code to comply with Google Java Style.

DependencyCheck

by jeremylong doticonjavadoticon

star image 3986 doticonApache-2.0

OWASP dependency-check is a software composition analysis utility that detects publicly disclosed vulnerabilities in application dependencies.

shopping-management-system

by zhanglei-workspace doticonjavadoticon

star image 3965 doticon

该项目为多个小项目的集合(持续更新中...)。内容类似淘宝、京东等网购管理系统以及图书管理、超市管理等系统。目的在于便于Java初级爱好者在学习完某一部分Java知识后有一个合适的项目锻炼、运用所学知识,完善知识体系。适用人群:Java基础到入门的爱好者。

libsvm

by cjlin1 doticonjavadoticon

star image 3945 doticonBSD-3-Clause

Trending New libraries in Maven

JooLun-wx

by Joolun doticonjavadoticon

star image 1363 doticonMIT

JooLun微信商城,Java + SpringBoot + Maven + Swagger + Mybatis Plus + Redis + Vue + elementUI,微信公众号开发、小程序商城、微信支付、订单管理;商业版还有微服务、多租户Sass、Uniapp商城、小程序直播、多规格SKU、拼团、砍价、商户管理、 秒杀、优惠券、积分、多店铺、商城拖拽装修、服务商收款等功能

mini-spring

by DerekYRC doticonjavadoticon

star image 1147 doticonApache-2.0

mini-spring是简化版的spring框架,能帮助你快速熟悉spring源码和掌握spring的核心原理。抽取了spring的核心逻辑,代码极度简化,保留spring的核心功能,如IoC和AOP、资源加载器、事件监听器、类型转换、容器扩展点、bean生命周期和作用域、应用上下文等核心功能。

jreleaser

by jreleaser doticonjavadoticon

star image 541 doticonApache-2.0

:rocket: Release projects quickly and easily with JReleaser

BigBookofR

by oscarbaruffa doticonhtmldoticon

star image 352 doticon

The biggest collection of R books (and maybe later some other resources too)

kotlin-gradle-plugin-template

by cortinico doticonkotlindoticon

star image 248 doticonMIT

🐘 A template to let you started with custom Gradle Plugins + Kotlin in a few seconds

modern-java-practices

by binkley doticonshelldoticon

star image 231 doticonUnlicense

Modern Java/JVM Build Practices

dependency-watch

by JakeWharton doticonkotlindoticon

star image 212 doticonApache-2.0

Script to wait for an artifact to appear in a Maven repository or to monitor coordinates for new versions.

create-html5-boilerplate

by h5bp doticonjavascriptdoticon

star image 205 doticonMIT

npx quick start for html5-boilerplate

spring-cloud-gcp

by GoogleCloudPlatform doticonjavadoticon

star image 186 doticonApache-2.0

New home for Spring Cloud GCP development starting with version 2.0.

Top Authors in Maven

1

apache

107 Libraries

star icon6642

2

googleapis

61 Libraries

star icon795

3

mojohaus

36 Libraries

star icon1294

4

jenkinsci

28 Libraries

star icon568

5

khmarbaise

23 Libraries

star icon292

6

sonatype

15 Libraries

star icon477

7

AdamBien

13 Libraries

star icon517

8

datanucleus

13 Libraries

star icon154

9

hellokoding

11 Libraries

star icon294

10

making

11 Libraries

star icon212

1

107 Libraries

star icon6642

2

61 Libraries

star icon795

3

36 Libraries

star icon1294

4

28 Libraries

star icon568

5

23 Libraries

star icon292

6

15 Libraries

star icon477

7

13 Libraries

star icon517

8

13 Libraries

star icon154

9

11 Libraries

star icon294

10

11 Libraries

star icon212

Trending Kits in Maven

No Trending Kits are available at this moment for Maven

Trending Discussions on Maven

Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'

Android : Could not GET/Find get repos from bintray.com

Could not GET 'play-services-location/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

Java, Intellij IDEA problem Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED

EmbeddedKafka failing since Spring Boot 2.6.X : AccessDeniedException: ..\AppData\Local\Temp\spring.kafka*

Allow insecure protocols, android gradle

Spring Cloud Gateway; Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway Issue

Android app won't build -- The minCompileSdk (31) specified in a dependency's androidx.work:work-runtime:2.7.0-beta01

Error when trying to run my React Native app on Android

https://dl.bintray.com/kotlin/kotlin-eap 502 bad gateway

QUESTION

Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'

Asked 2022-Apr-04 at 13:12

I want to add jitpack.io as a repository in my gradle file. This is my gradle root file:

1buildscript {
2    repositories {
3        google()
4        mavenCentral()
5    }
6    dependencies {
7        classpath "com.android.tools.build:gradle:7.0.2"
8        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"
9
10        classpath 'com.google.dagger:hilt-android-gradle-plugin:2.38.1'
11
12        // NOTE: Do not place your application dependencies here; they belong
13        // in the individual module build.gradle files
14    }
15}
16task clean(type: Delete) {
17    delete rootProject.buildDir
18}
19

Since I DON'T have a "allrepositories" to put my dependency there (only works there), I've created and added this code after buildscript code:

1buildscript {
2    repositories {
3        google()
4        mavenCentral()
5    }
6    dependencies {
7        classpath "com.android.tools.build:gradle:7.0.2"
8        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"
9
10        classpath 'com.google.dagger:hilt-android-gradle-plugin:2.38.1'
11
12        // NOTE: Do not place your application dependencies here; they belong
13        // in the individual module build.gradle files
14    }
15}
16task clean(type: Delete) {
17    delete rootProject.buildDir
18}
19allprojects {
20    repositories {
21        maven {url 'https://www.jitpack.io'}
22    }
23}
24

But this is the error I get

1buildscript {
2    repositories {
3        google()
4        mavenCentral()
5    }
6    dependencies {
7        classpath "com.android.tools.build:gradle:7.0.2"
8        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"
9
10        classpath 'com.google.dagger:hilt-android-gradle-plugin:2.38.1'
11
12        // NOTE: Do not place your application dependencies here; they belong
13        // in the individual module build.gradle files
14    }
15}
16task clean(type: Delete) {
17    delete rootProject.buildDir
18}
19allprojects {
20    repositories {
21        maven {url 'https://www.jitpack.io'}
22    }
23}
24Caused by: org.gradle.api.InvalidUserCodeException: Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'
25

ANSWER

Answered 2021-Sep-16 at 11:02

Android introduced a new way to define repositories.

Remove the dependencyResolutionManagement block from the setting.gradle file to have your project work the old way.

Source https://stackoverflow.com/questions/69163511

QUESTION

Android : Could not GET/Find get repos from bintray.com

Asked 2022-Apr-01 at 19:21

Trying to run old project with following config in build.gradle (root) file.

1// Top-level build file where you can add configuration options common to all sub-projects/modules.
2
3buildscript {
4    
5    repositories {
6        google()
7//        jcenter() //deprecated
8        mavenCentral()
9
10    }
11    dependencies {
12        classpath 'com.android.tools.build:gradle:3.3.1'
13        classpath 'me.tatarka:gradle-retrolambda:3.6.1'
14        classpath 'com.google.gms:google-services:4.2.0'
15        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
16//        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' //getting error because of this error so commented
17
18        // NOTE: Do not place your application dependencies here; they belong
19        // in the individual module build.gradle files
20    }
21}
22
23allprojects {
24    repositories {
25        google()
26//        maven { url "http://dl.bintray.com/populov/maven" } //getting error because of this error so commented 
27        maven {url "https://maven.google.com"}
28        maven { url 'https://jitpack.io' }
29        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
30        mavenCentral()
31        //        jcenter() //deprecated
32
33    }
34}
35
36task clean(type: Delete) {
37    delete rootProject.buildDir
38}
39

Got Error:

1: Could not GET 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'

Received status code 502 from server: Bad Gateway

2:Could not resolve com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3

I got it, Since jcenter() is shutdown, i need to use mavenCentral() and find replacement for outdated packages. i tried to replace with mavenCentral(). and try to find alternative but could not.. tried with commenting, those error giving repos, but still can not fetch my required dependencies.

Referred to Android Studio: Gradle sync failed: Could not HEAD '...'. Received status code 502 from server: Bad Gateway

Difference among mavenCentral(), jCenter() and mavenLocal()?

Bintray is now sunsetted

Jcenter 502 bad gateway after gradle refresh

Commented Following Repo In (build.gradle):

1// Top-level build file where you can add configuration options common to all sub-projects/modules.
2
3buildscript {
4    
5    repositories {
6        google()
7//        jcenter() //deprecated
8        mavenCentral()
9
10    }
11    dependencies {
12        classpath 'com.android.tools.build:gradle:3.3.1'
13        classpath 'me.tatarka:gradle-retrolambda:3.6.1'
14        classpath 'com.google.gms:google-services:4.2.0'
15        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
16//        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' //getting error because of this error so commented
17
18        // NOTE: Do not place your application dependencies here; they belong
19        // in the individual module build.gradle files
20    }
21}
22
23allprojects {
24    repositories {
25        google()
26//        maven { url "http://dl.bintray.com/populov/maven" } //getting error because of this error so commented 
27        maven {url "https://maven.google.com"}
28        maven { url 'https://jitpack.io' }
29        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
30        mavenCentral()
31        //        jcenter() //deprecated
32
33    }
34}
35
36task clean(type: Delete) {
37    delete rootProject.buildDir
38}
39 repositories: // maven { url "http://dl.bintray.com/populov/maven" }
40 dependencies: // classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
41

Error: After I commented above libraries , I got following error :

erro: screenshot

Any suggestion on migration or package replacement or quick fix would be great help.. Thank you.

ANSWER

Answered 2022-Apr-01 at 19:21

if you go to the missing library's Github page, you see that it was available only through jcenter, and since jcenter is down, you need to clone the library and build it yourself and put it on the classpath.

Source https://stackoverflow.com/questions/71583997

QUESTION

Could not GET 'play-services-location/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

Asked 2022-Mar-28 at 07:02

I have a project which was running well yesterday, but today I find this problem:

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not resolve com.google.android.gms:play-services-location:16.+. Required by: project :app > project :location > Failed to list versions for com.google.android.gms:play-services-location. > Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml. > Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml'. > Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

acutely I'm using classpath 'com.android.tools.build:gradle:4.1.0'with distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip I have followed this question and I upgraded 'com.android.tools.build:gradle:4.1.0' to classpath 'com.android.tools.build:gradle:4.2.0' then I changed distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip to distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip but I still got the error.

my android/build.gradle:

1buildscript {
2    repositories {
3        google()
4        jcenter()
5    }
6
7    dependencies {
8        classpath 'com.android.tools.build:gradle:4.2.0'
9    }
10}
11
12allprojects {
13    repositories {
14        google()
15        jcenter()
16    }
17}
18
19rootProject.buildDir = '../build'
20subprojects {
21    project.buildDir = "${rootProject.buildDir}/${project.name}"
22}
23subprojects {
24    project.evaluationDependsOn(':app')
25}
26
27task clean(type: Delete) {
28    delete rootProject.buildDir
29}
30

and gradle-wrapper.properties:

1buildscript {
2    repositories {
3        google()
4        jcenter()
5    }
6
7    dependencies {
8        classpath 'com.android.tools.build:gradle:4.2.0'
9    }
10}
11
12allprojects {
13    repositories {
14        google()
15        jcenter()
16    }
17}
18
19rootProject.buildDir = '../build'
20subprojects {
21    project.buildDir = "${rootProject.buildDir}/${project.name}"
22}
23subprojects {
24    project.evaluationDependsOn(':app')
25}
26
27task clean(type: Delete) {
28    delete rootProject.buildDir
29}
30distributionBase=GRADLE_USER_HOME
31distributionPath=wrapper/dists
32zipStoreBase=GRADLE_USER_HOME
33zipStorePath=wrapper/dists
34distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
35

Also I have changed the compileSdkVersion , minSdkVersion and targetSdkVersion to be 30 but nothing happened.

ANSWER

Answered 2021-Dec-01 at 09:09

It looks like a temporary issue, the server with these libraries is down. I have the same problem now with Room:

1buildscript {
2    repositories {
3        google()
4        jcenter()
5    }
6
7    dependencies {
8        classpath 'com.android.tools.build:gradle:4.2.0'
9    }
10}
11
12allprojects {
13    repositories {
14        google()
15        jcenter()
16    }
17}
18
19rootProject.buildDir = '../build'
20subprojects {
21    project.buildDir = "${rootProject.buildDir}/${project.name}"
22}
23subprojects {
24    project.evaluationDependsOn(':app')
25}
26
27task clean(type: Delete) {
28    delete rootProject.buildDir
29}
30distributionBase=GRADLE_USER_HOME
31distributionPath=wrapper/dists
32zipStoreBase=GRADLE_USER_HOME
33zipStorePath=wrapper/dists
34distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
35Could not GET 'https://google.bintray.com/exoplayer/androidx/room/room-common/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
36

You can try using offline mode if you're using Android Studio, then it will use the cached version of this library if you have it until it is fixed.

UPD. I switched to an alpha version of a flutter lib which caused this (workmanager) and it works well now. As far as I understand it was depending on an old version of Android Room library which is not available anymore since Bintray is not available. The new version of Room is available as it's being downloaded thorough another link. So for you the solution could be updating to a newer version of Flutter location package or forking it and changing the version of play-services-location to the most recent one.

Source https://stackoverflow.com/questions/70166663

QUESTION

Java, Intellij IDEA problem Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED

Asked 2022-Mar-26 at 15:23

I have newly installed

1IntelliJ IDEA 2021.2 (Ultimate Edition)
2Build #IU-212.4746.92, built on July 27, 2021
3Licensed to XXXXXX
4Subscription is active until August 15, 2021.
5Runtime version: 11.0.11+9-b1504.13 amd64
6VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
7Linux 5.4.0-80-generic
8GC: G1 Young Generation, G1 Old Generation
9Memory: 2048M
10Cores: 3
11
12Kotlin: 212-1.5.10-release-IJ4746.92
13Current Desktop: X-Cinnamon
14

I cloned project I work with on other workstation without issues, but cannot start any class with main method and IDEA says:

1IntelliJ IDEA 2021.2 (Ultimate Edition)
2Build #IU-212.4746.92, built on July 27, 2021
3Licensed to XXXXXX
4Subscription is active until August 15, 2021.
5Runtime version: 11.0.11+9-b1504.13 amd64
6VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
7Linux 5.4.0-80-generic
8GC: G1 Young Generation, G1 Old Generation
9Memory: 2048M
10Cores: 3
11
12Kotlin: 212-1.5.10-release-IJ4746.92
13Current Desktop: X-Cinnamon
14Abnormal build process termination: 
15/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java -Xmx700m -Djava.awt.headless=true -Djava.endorsed.dirs=\"\" -Dcompile.parallel=false -Drebuild.on.dependency.change=true -Djdt.compiler.useSingleThread=true -Daether.connector.resumeDownloads=false -Dio.netty.initialSeedUniquifier=-5972351880001011455 -Dfile.encoding=UTF-8 -Duser.language=en -Duser.country=US -Didea.paths.selector=IntelliJIdea2021.2 -Didea.home.path=/home/pm/idea-IU-212.4746.92 -Didea.config.path=/home/pm/.config/JetBrains/IntelliJIdea2021.2 -Didea.plugins.path=/home/pm/.local/share/JetBrains/IntelliJIdea2021.2 -Djps.log.dir=/home/pm/.cache/JetBrains/IntelliJIdea2021.2/log/build-log -Djps.fallback.jdk.home=/home/pm/idea-IU-212.4746.92/jbr -Djps.fallback.jdk.version=11.0.11 -Dio.netty.noUnsafe=true -Djava.io.tmpdir=/home/pm/.cache/JetBrains/IntelliJIdea2021.2/compile-server/rfg-survey-api_cc70fc05/_temp_ -Djps.backward.ref.index.builder=true -Djps.track.ap.dependencies=false --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED -Dtmh.instrument.annotations=true -Dtmh.generate.line.numbers=true -Dkotlin.incremental.compilation=true -Dkotlin.incremental.compilation.js=true -Dkotlin.daemon.enabled -Dkotlin.daemon.client.alive.path=\"/tmp/kotlin-idea-12426594439704512301-is-running\" -classpath /home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-launcher.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/lib/tools.jar org.jetbrains.jps.cmdline.Launcher /home/pm/idea-IU-212.4746.92/lib/slf4j.jar:/home/pm/idea-IU-212.4746.92/lib/idea_rt.jar:/home/pm/idea-IU-212.4746.92/lib/platform-api.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/maven-resolver-transport-file-1.3.3.jar:/home/pm/idea-IU-212.4746.92/lib/forms_rt.jar:/home/pm/idea-IU-212.4746.92/lib/util.jar:/home/pm/idea-IU-212.4746.92/lib/annotations.jar:/home/pm/idea-IU-212.4746.92/lib/3rd-party.jar:/home/pm/idea-IU-212.4746.92/lib/kotlin-stdlib-jdk8.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/maven-resolver-connector-basic-1.3.3.jar:/home/pm/idea-IU-212.4746.92/lib/jna-platform.jar:/home/pm/idea-IU-212.4746.92/lib/protobuf-java-3.15.8.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-builders-6.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/javac2.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/aether-dependency-resolver.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-builders.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-javac-extension-1.jar:/home/pm/idea-IU-212.4746.92/lib/jna.jar:/home/pm/idea-IU-212.4746.92/lib/jps-model.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/maven-resolver-transport-http-1.3.3.jar:/home/pm/idea-IU-212.4746.92/plugins/JavaEE/lib/jasper-v2-rt.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-reflect.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-plugin.jar:/home/pm/idea-IU-212.4746.92/plugins/ant/lib/ant-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/uiDesigner/lib/jps/java-guiForms-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/eclipse/lib/eclipse-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/eclipse/lib/eclipse-common.jar:/home/pm/idea-IU-212.4746.92/plugins/IntelliLang/lib/java-langInjection-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Groovy/lib/groovy-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Groovy/lib/groovy-constants-rt.jar:/home/pm/idea-IU-212.4746.92/plugins/maven/lib/maven-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/gradle-java/lib/gradle-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/devkit/lib/devkit-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/javaFX/lib/javaFX-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/javaFX/lib/javaFX-common.jar:/home/pm/idea-IU-212.4746.92/plugins/JavaEE/lib/javaee-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/webSphereIntegration/lib/jps/javaee-appServers-websphere-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/weblogicIntegration/lib/jps/javaee-appServers-weblogic-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/JPA/lib/jps/javaee-jpa-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Grails/lib/groovy-grails-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Grails/lib/groovy-grails-compilerPatch.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-jps-common.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-common.jar org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 34781 9f0681bb-da2a-48db-8344-900ddeb29804 /home/pm/.cache/JetBrains/IntelliJIdea2021.2/compile-server
16Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
17Error: Could not create the Java Virtual Machine.
18Error: A fatal exception has occurred. Program will exit.
19

I found other comment to check Lombok works and I see it is fine.

How to fix the problem?

ANSWER

Answered 2021-Jul-28 at 07:22

You are running the project via Java 1.8 and add the --add-opens option to the runner. However Java 1.8 does not support it.

So, the first option is to use Java 11 to run the project, as Java 11 can recognize this VM option.

Another solution is to find a place where --add-opens is added and remove it. Check Run configuration in IntelliJ IDEA (VM options field) and Maven/Gradle configuration files for argLine (Maven) and jvmArgs (Gradle)

Source https://stackoverflow.com/questions/68554693

QUESTION

EmbeddedKafka failing since Spring Boot 2.6.X : AccessDeniedException: ..\AppData\Local\Temp\spring.kafka*

Asked 2022-Mar-25 at 12:39

e: this has been fixed through Spring Boot 2.6.5 (see https://github.com/spring-projects/spring-boot/issues/30243)

Since upgrading to Spring Boot 2.6.X (in my case: 2.6.1), I have multiple projects that now have failing unit-tests on Windows that cannot start EmbeddedKafka, that do run with Linux

There is multiple errors, but this is the first one thrown

1...
2  .   ____          _            __ _ _
3 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
4( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
5 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
6  '  |____| .__|_| |_|_| |_\__, | / / / /
7 =========|_|==============|___/=/_/_/_/
8 :: Spring Boot ::                (v2.6.1)
9
102021-12-09 16:15:00.300  INFO 13864 --- [           main] k.utils.Log4jControllerRegistration$     : Registered kafka:type=kafka.Log4jController MBean
112021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : 
122021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :   ______                  _                                          
132021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :  |___  /                 | |                                         
142021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :     / /    ___     ___   | | __   ___    ___   _ __     ___   _ __   
152021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :    / /    / _ \   / _ \  | |/ /  / _ \  / _ \ | '_ \   / _ \ | '__|
162021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :   / /__  | (_) | | (_) | |   <  |  __/ |  __/ | |_) | |  __/ | |    
172021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :  /_____|  \___/   \___/  |_|\_\  \___|  \___| | .__/   \___| |_|
182021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :                                               | |                     
192021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :                                               |_|                     
202021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : 
212021-12-09 16:15:00.422  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : Server environment:zookeeper.version=3.6.3--6401e4ad2087061bc6b9f80dec2d69f2e3c8660a, built on 04/08/2021 16:35 GMT
222021-12-09 16:15:00.422  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : Server environment:host.name=host.docker.internal
232021-12-09 16:15:00.422  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : Server environment:java.version=11.0.11
242021-12-09 16:15:00.422  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : Server environment:java.vendor=AdoptOpenJDK
25...
262021-12-09 16:15:01.015  INFO 13864 --- [nelReaper-Fetch] lientQuotaManager$ThrottledChannelReaper : [ThrottledChannelReaper-Fetch]: Starting
272021-12-09 16:15:01.015  INFO 13864 --- [lReaper-Produce] lientQuotaManager$ThrottledChannelReaper : [ThrottledChannelReaper-Produce]: Starting
282021-12-09 16:15:01.016  INFO 13864 --- [lReaper-Request] lientQuotaManager$ThrottledChannelReaper : [ThrottledChannelReaper-Request]: Starting
292021-12-09 16:15:01.017  INFO 13864 --- [trollerMutation] lientQuotaManager$ThrottledChannelReaper : [ThrottledChannelReaper-ControllerMutation]: Starting
302021-12-09 16:15:01.037  INFO 13864 --- [           main] kafka.log.LogManager                     : Loading logs from log dirs ArraySeq(C:\Users\ddrop\AppData\Local\Temp\spring.kafka.bf8e2b62-a1f2-4092-b292-a15e35bd31ad18378079390566696446)
312021-12-09 16:15:01.040  INFO 13864 --- [           main] kafka.log.LogManager                     : Attempting recovery for all logs in C:\Users\ddrop\AppData\Local\Temp\spring.kafka.bf8e2b62-a1f2-4092-b292-a15e35bd31ad18378079390566696446 since no clean shutdown file was found
322021-12-09 16:15:01.043  INFO 13864 --- [           main] kafka.log.LogManager                     : Loaded 0 logs in 6ms.
332021-12-09 16:15:01.043  INFO 13864 --- [           main] kafka.log.LogManager                     : Starting log cleanup with a period of 300000 ms.
342021-12-09 16:15:01.045  INFO 13864 --- [           main] kafka.log.LogManager                     : Starting log flusher with a default period of 9223372036854775807 ms.
352021-12-09 16:15:01.052  INFO 13864 --- [           main] kafka.log.LogCleaner                     : Starting the log cleaner
362021-12-09 16:15:01.059  INFO 13864 --- [leaner-thread-0] kafka.log.LogCleaner                     : [kafka-log-cleaner-thread-0]: Starting
372021-12-09 16:15:01.224  INFO 13864 --- [name=forwarding] k.s.BrokerToControllerRequestThread      : [BrokerToControllerChannelManager broker=0 name=forwarding]: Starting
382021-12-09 16:15:01.325  INFO 13864 --- [           main] kafka.network.ConnectionQuotas           : Updated connection-accept-rate max connection creation rate to 2147483647
392021-12-09 16:15:01.327  INFO 13864 --- [           main] kafka.network.Acceptor                   : Awaiting socket connections on localhost:63919.
402021-12-09 16:15:01.345  INFO 13864 --- [           main] kafka.network.SocketServer               : [SocketServer listenerType=ZK_BROKER, nodeId=0] Created data-plane acceptor and processors for endpoint : ListenerName(PLAINTEXT)
412021-12-09 16:15:01.350  INFO 13864 --- [0 name=alterIsr] k.s.BrokerToControllerRequestThread      : [BrokerToControllerChannelManager broker=0 name=alterIsr]: Starting
422021-12-09 16:15:01.364  INFO 13864 --- [eaper-0-Produce] perationPurgatory$ExpiredOperationReaper : [ExpirationReaper-0-Produce]: Starting
432021-12-09 16:15:01.364  INFO 13864 --- [nReaper-0-Fetch] perationPurgatory$ExpiredOperationReaper : [ExpirationReaper-0-Fetch]: Starting
442021-12-09 16:15:01.365  INFO 13864 --- [0-DeleteRecords] perationPurgatory$ExpiredOperationReaper : [ExpirationReaper-0-DeleteRecords]: Starting
452021-12-09 16:15:01.365  INFO 13864 --- [r-0-ElectLeader] perationPurgatory$ExpiredOperationReaper : [ExpirationReaper-0-ElectLeader]: Starting
462021-12-09 16:15:01.374  INFO 13864 --- [rFailureHandler] k.s.ReplicaManager$LogDirFailureHandler  : [LogDirFailureHandler]: Starting
472021-12-09 16:15:01.390  INFO 13864 --- [           main] kafka.zk.KafkaZkClient                   : Creating /brokers/ids/0 (is it secure? false)
482021-12-09 16:15:01.400  INFO 13864 --- [           main] kafka.zk.KafkaZkClient                   : Stat of the created znode at /brokers/ids/0 is: 25,25,1639062901396,1639062901396,1,0,0,72059919267528704,204,0,25
49
502021-12-09 16:15:01.400  INFO 13864 --- [           main] kafka.zk.KafkaZkClient                   : Registered broker 0 at path /brokers/ids/0 with addresses: PLAINTEXT://localhost:63919, czxid (broker epoch): 25
512021-12-09 16:15:01.410 ERROR 13864 --- [           main] kafka.server.BrokerMetadataCheckpoint    : Failed to write meta.properties due to
52
53java.nio.file.AccessDeniedException: C:\Users\ddrop\AppData\Local\Temp\spring.kafka.bf8e2b62-a1f2-4092-b292-a15e35bd31ad18378079390566696446
54    at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) ~[na:na]
55    at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[na:na]
56    at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[na:na]
57
1...
2  .   ____          _            __ _ _
3 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
4( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
5 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
6  '  |____| .__|_| |_|_| |_\__, | / / / /
7 =========|_|==============|___/=/_/_/_/
8 :: Spring Boot ::                (v2.6.1)
9
102021-12-09 16:15:00.300  INFO 13864 --- [           main] k.utils.Log4jControllerRegistration$     : Registered kafka:type=kafka.Log4jController MBean
112021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : 
122021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :   ______                  _                                          
132021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :  |___  /                 | |                                         
142021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :     / /    ___     ___   | | __   ___    ___   _ __     ___   _ __   
152021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :    / /    / _ \   / _ \  | |/ /  / _ \  / _ \ | '_ \   / _ \ | '__|
162021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :   / /__  | (_) | | (_) | |   <  |  __/ |  __/ | |_) | |  __/ | |    
172021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :  /_____|  \___/   \___/  |_|\_\  \___|  \___| | .__/   \___| |_|
182021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :                                               | |                     
192021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     :                                               |_|                     
202021-12-09 16:15:00.420  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : 
212021-12-09 16:15:00.422  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : Server environment:zookeeper.version=3.6.3--6401e4ad2087061bc6b9f80dec2d69f2e3c8660a, built on 04/08/2021 16:35 GMT
222021-12-09 16:15:00.422  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : Server environment:host.name=host.docker.internal
232021-12-09 16:15:00.422  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : Server environment:java.version=11.0.11
242021-12-09 16:15:00.422  INFO 13864 --- [           main] o.a.zookeeper.server.ZooKeeperServer     : Server environment:java.vendor=AdoptOpenJDK
25...
262021-12-09 16:15:01.015  INFO 13864 --- [nelReaper-Fetch] lientQuotaManager$ThrottledChannelReaper : [ThrottledChannelReaper-Fetch]: Starting
272021-12-09 16:15:01.015  INFO 13864 --- [lReaper-Produce] lientQuotaManager$ThrottledChannelReaper : [ThrottledChannelReaper-Produce]: Starting
282021-12-09 16:15:01.016  INFO 13864 --- [lReaper-Request] lientQuotaManager$ThrottledChannelReaper : [ThrottledChannelReaper-Request]: Starting
292021-12-09 16:15:01.017  INFO 13864 --- [trollerMutation] lientQuotaManager$ThrottledChannelReaper : [ThrottledChannelReaper-ControllerMutation]: Starting
302021-12-09 16:15:01.037  INFO 13864 --- [           main] kafka.log.LogManager                     : Loading logs from log dirs ArraySeq(C:\Users\ddrop\AppData\Local\Temp\spring.kafka.bf8e2b62-a1f2-4092-b292-a15e35bd31ad18378079390566696446)
312021-12-09 16:15:01.040  INFO 13864 --- [           main] kafka.log.LogManager                     : Attempting recovery for all logs in C:\Users\ddrop\AppData\Local\Temp\spring.kafka.bf8e2b62-a1f2-4092-b292-a15e35bd31ad18378079390566696446 since no clean shutdown file was found
322021-12-09 16:15:01.043  INFO 13864 --- [           main] kafka.log.LogManager                     : Loaded 0 logs in 6ms.
332021-12-09 16:15:01.043  INFO 13864 --- [           main] kafka.log.LogManager                     : Starting log cleanup with a period of 300000 ms.
342021-12-09 16:15:01.045  INFO 13864 --- [           main] kafka.log.LogManager                     : Starting log flusher with a default period of 9223372036854775807 ms.
352021-12-09 16:15:01.052  INFO 13864 --- [           main] kafka.log.LogCleaner                     : Starting the log cleaner
362021-12-09 16:15:01.059  INFO 13864 --- [leaner-thread-0] kafka.log.LogCleaner                     : [kafka-log-cleaner-thread-0]: Starting
372021-12-09 16:15:01.224  INFO 13864 --- [name=forwarding] k.s.BrokerToControllerRequestThread      : [BrokerToControllerChannelManager broker=0 name=forwarding]: Starting
382021-12-09 16:15:01.325  INFO 13864 --- [           main] kafka.network.ConnectionQuotas           : Updated connection-accept-rate max connection creation rate to 2147483647
392021-12-09 16:15:01.327  INFO 13864 --- [           main] kafka.network.Acceptor                   : Awaiting socket connections on localhost:63919.
402021-12-09 16:15:01.345  INFO 13864 --- [           main] kafka.network.SocketServer               : [SocketServer listenerType=ZK_BROKER, nodeId=0] Created data-plane acceptor and processors for endpoint : ListenerName(PLAINTEXT)
412021-12-09 16:15:01.350  INFO 13864 --- [0 name=alterIsr] k.s.BrokerToControllerRequestThread      : [BrokerToControllerChannelManager broker=0 name=alterIsr]: Starting
422021-12-09 16:15:01.364  INFO 13864 --- [eaper-0-Produce] perationPurgatory$ExpiredOperationReaper : [ExpirationReaper-0-Produce]: Starting
432021-12-09 16:15:01.364  INFO 13864 --- [nReaper-0-Fetch] perationPurgatory$ExpiredOperationReaper : [ExpirationReaper-0-Fetch]: Starting
442021-12-09 16:15:01.365  INFO 13864 --- [0-DeleteRecords] perationPurgatory$ExpiredOperationReaper : [ExpirationReaper-0-DeleteRecords]: Starting
452021-12-09 16:15:01.365  INFO 13864 --- [r-0-ElectLeader] perationPurgatory$ExpiredOperationReaper : [ExpirationReaper-0-ElectLeader]: Starting
462021-12-09 16:15:01.374  INFO 13864 --- [rFailureHandler] k.s.ReplicaManager$LogDirFailureHandler  : [LogDirFailureHandler]: Starting
472021-12-09 16:15:01.390  INFO 13864 --- [           main] kafka.zk.KafkaZkClient                   : Creating /brokers/ids/0 (is it secure? false)
482021-12-09 16:15:01.400  INFO 13864 --- [           main] kafka.zk.KafkaZkClient                   : Stat of the created znode at /brokers/ids/0 is: 25,25,1639062901396,1639062901396,1,0,0,72059919267528704,204,0,25
49
502021-12-09 16:15:01.400  INFO 13864 --- [           main] kafka.zk.KafkaZkClient                   : Registered broker 0 at path /brokers/ids/0 with addresses: PLAINTEXT://localhost:63919, czxid (broker epoch): 25
512021-12-09 16:15:01.410 ERROR 13864 --- [           main] kafka.server.BrokerMetadataCheckpoint    : Failed to write meta.properties due to
52
53java.nio.file.AccessDeniedException: C:\Users\ddrop\AppData\Local\Temp\spring.kafka.bf8e2b62-a1f2-4092-b292-a15e35bd31ad18378079390566696446
54    at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) ~[na:na]
55    at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[na:na]
56    at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[na:na]
57package com.example.demo;
58
59import org.junit.jupiter.api.Test;
60import org.springframework.boot.test.context.SpringBootTest;
61import org.springframework.kafka.test.context.EmbeddedKafka;
62
63@SpringBootTest
64@EmbeddedKafka
65class ApplicationTest {
66
67    @Test
68    void run() {
69        int i = 1 + 1; // just a line of code to set a debug-point
70    }
71}
72

I do not have this error when pinning kafka.version to 2.8.1 in pom.xml's properties.

It seems like the cause is in Kafka itself, but I have a hard time figuring out if it is spring-kafka intitializing Kafka via EmbeddedKafka incorrectly or if Kafka itself is the culrit here.

Anyone has an idea? Am I missing a test-parameter to set?

ANSWER

Answered 2021-Dec-09 at 15:51

Known bug on the Apache Kafka side. Nothing to do from Spring perspective. See more info here: https://github.com/spring-projects/spring-kafka/discussions/2027. And here: https://issues.apache.org/jira/browse/KAFKA-13391

You need to wait until Apache Kafka 3.0.1 or don't use embedded Kafka and just rely on the Testcontainers, for example, or fully external Apache Kafka broker.

Source https://stackoverflow.com/questions/70292425

QUESTION

Allow insecure protocols, android gradle

Asked 2022-Mar-17 at 10:30

I recently updated my android studio to Arctic Fox and got an error in my project

1A problem occurred configuring root project 'so10'.
2> Could not resolve all dependencies for configuration ':classpath'.
3   > Using insecure protocols with repositories, without explicit opt-in, is     unsupported. Switch Maven repository 
4'maven3(http://oss.sonatype.org/content/repositories/snapshots)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols.
5 See https://docs.gradle.org/7.0.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details. 
6

This is my gradle where the problem occurs

1A problem occurred configuring root project 'so10'.
2> Could not resolve all dependencies for configuration ':classpath'.
3   > Using insecure protocols with repositories, without explicit opt-in, is     unsupported. Switch Maven repository 
4'maven3(http://oss.sonatype.org/content/repositories/snapshots)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols.
5 See https://docs.gradle.org/7.0.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details. 
6repositories {
7    // maven { url 'https://maven.fabric.io/public' }
8    maven { url "https://jitpack.io" }
9    maven { url 'https://raw.github.com/Raizlabs/maven-releases/master/releases' }
10    maven { url 'http://oss.sonatype.org/content/repositories/snapshots'}
11    maven { url "https://plugins.gradle.org/m2/" }
12    maven { url 'https://maven.google.com'  }
13    google()
14    mavenCentral()
15    jcenter()
16}
17

How do I solve it?

ANSWER

Answered 2022-Mar-17 at 10:30

For insecure HTTP connections in Gradle 7+ versions, we need to specify a boolean allowInsecureProtocol as true to MavenArtifactRepository closure.
Since you have received this error for sonatype repository, you need to set the repositories as below:

  1. Groovy DSL
1A problem occurred configuring root project 'so10'.
2> Could not resolve all dependencies for configuration ':classpath'.
3   > Using insecure protocols with repositories, without explicit opt-in, is     unsupported. Switch Maven repository 
4'maven3(http://oss.sonatype.org/content/repositories/snapshots)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols.
5 See https://docs.gradle.org/7.0.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details. 
6repositories {
7    // maven { url 'https://maven.fabric.io/public' }
8    maven { url "https://jitpack.io" }
9    maven { url 'https://raw.github.com/Raizlabs/maven-releases/master/releases' }
10    maven { url 'http://oss.sonatype.org/content/repositories/snapshots'}
11    maven { url "https://plugins.gradle.org/m2/" }
12    maven { url 'https://maven.google.com'  }
13    google()
14    mavenCentral()
15    jcenter()
16}
17repositories {
18    maven {
19        url "http://oss.sonatype.org/content/repositories/snapshots"
20        allowInsecureProtocol = true
21    }
22    // other repositories ...
23}
24
  1. Kotlin DSL
1A problem occurred configuring root project 'so10'.
2> Could not resolve all dependencies for configuration ':classpath'.
3   > Using insecure protocols with repositories, without explicit opt-in, is     unsupported. Switch Maven repository 
4'maven3(http://oss.sonatype.org/content/repositories/snapshots)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols.
5 See https://docs.gradle.org/7.0.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details. 
6repositories {
7    // maven { url 'https://maven.fabric.io/public' }
8    maven { url "https://jitpack.io" }
9    maven { url 'https://raw.github.com/Raizlabs/maven-releases/master/releases' }
10    maven { url 'http://oss.sonatype.org/content/repositories/snapshots'}
11    maven { url "https://plugins.gradle.org/m2/" }
12    maven { url 'https://maven.google.com'  }
13    google()
14    mavenCentral()
15    jcenter()
16}
17repositories {
18    maven {
19        url "http://oss.sonatype.org/content/repositories/snapshots"
20        allowInsecureProtocol = true
21    }
22    // other repositories ...
23}
24repositories {
25    maven {
26        url = uri("http://oss.sonatype.org/content/repositories/snapshots")
27        isAllowInsecureProtocol = true
28    }
29    // other repositories ...
30}
31

Source https://stackoverflow.com/questions/68585885

QUESTION

Spring Cloud Gateway; Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway Issue

Asked 2022-Mar-16 at 07:16

I got this below error when run the API-GATEWAY, I tried so many ways but I couldn't solve this issue.

Description:

Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.

Action:

Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.

Main Class

1package com.sample.apigateway;
2
3import org.springframework.boot.SpringApplication;
4import org.springframework.boot.autoconfigure.SpringBootApplication;
5import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
6
7@SpringBootApplication
8@EnableEurekaClient
9public class ApiGatewayApplication {
10
11    public static void main(String[] args) {
12        SpringApplication.run(ApiGatewayApplication.class, args);
13    }
14
15}
16

application.yml

1package com.sample.apigateway;
2
3import org.springframework.boot.SpringApplication;
4import org.springframework.boot.autoconfigure.SpringBootApplication;
5import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
6
7@SpringBootApplication
8@EnableEurekaClient
9public class ApiGatewayApplication {
10
11    public static void main(String[] args) {
12        SpringApplication.run(ApiGatewayApplication.class, args);
13    }
14
15}
16spring:
17  application:
18    name: GATEWAY-SERVICE
19
20  cloud:
21    gateway:
22      routes:
23        - id: USER-SERVICE
24          uri: lb://USER-SERVICE
25          predicates:
26            - Path=/users/**
27        - id: DEPARTMENT-SERVICE
28          uri: lb://DEPARTMENT-SERVICE
29          predicates:
30            - Path=/departments/**
31
32eureka:
33  client:
34    register-with-eureka: true
35    fetch-registry: true
36    service-url:
37      defaultZone: http://localhost:8761/eureka/
38
39  instance:
40    hostname: localhost
41
42server:
43  port: 9191
44

pom.xml

1package com.sample.apigateway;
2
3import org.springframework.boot.SpringApplication;
4import org.springframework.boot.autoconfigure.SpringBootApplication;
5import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
6
7@SpringBootApplication
8@EnableEurekaClient
9public class ApiGatewayApplication {
10
11    public static void main(String[] args) {
12        SpringApplication.run(ApiGatewayApplication.class, args);
13    }
14
15}
16spring:
17  application:
18    name: GATEWAY-SERVICE
19
20  cloud:
21    gateway:
22      routes:
23        - id: USER-SERVICE
24          uri: lb://USER-SERVICE
25          predicates:
26            - Path=/users/**
27        - id: DEPARTMENT-SERVICE
28          uri: lb://DEPARTMENT-SERVICE
29          predicates:
30            - Path=/departments/**
31
32eureka:
33  client:
34    register-with-eureka: true
35    fetch-registry: true
36    service-url:
37      defaultZone: http://localhost:8761/eureka/
38
39  instance:
40    hostname: localhost
41
42server:
43  port: 9191
44<?xml version="1.0" encoding="UTF-8"?>
45<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
46         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
47    <modelVersion>4.0.0</modelVersion>
48    <parent>
49        <groupId>org.springframework.boot</groupId>
50        <artifactId>spring-boot-starter-parent</artifactId>
51        <version>2.5.3</version>
52        <relativePath/> <!-- lookup parent from repository -->
53    </parent>
54    <groupId>com.sample.apigateway</groupId>
55    <artifactId>apigateway</artifactId>
56    <version>0.0.1-SNAPSHOT</version>
57    <name>apigateway</name>
58    <description>Demo project for Spring Boot</description>
59    <properties>
60        <java.version>11</java.version>
61        <spring-cloud.version>2020.0.3</spring-cloud.version>
62    </properties>
63    <dependencies>
64        <dependency>
65            <groupId>org.springframework.boot</groupId>
66            <artifactId>spring-boot-starter-actuator</artifactId>
67        </dependency>
68        <dependency>
69            <groupId>org.springframework.boot</groupId>
70            <artifactId>spring-boot-starter-webflux</artifactId>
71        </dependency>
72        <dependency>
73            <groupId>io.springfox</groupId>
74            <artifactId>springfox-boot-starter</artifactId>
75            <version>3.0.0</version>
76        </dependency>
77        <dependency>
78            <groupId>org.springframework.cloud</groupId>
79            <artifactId>spring-cloud-starter-gateway</artifactId>
80        </dependency>
81        <dependency>
82            <groupId>org.springframework.cloud</groupId>
83            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
84        </dependency>
85        <dependency>
86            <groupId>org.springframework.cloud</groupId>
87            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
88        </dependency>
89
90        <dependency>
91            <groupId>org.springframework.boot</groupId>
92            <artifactId>spring-boot-starter-test</artifactId>
93            <scope>test</scope>
94        </dependency>
95    </dependencies>
96    <dependencyManagement>
97        <dependencies>
98            <dependency>
99                <groupId>org.springframework.cloud</groupId>
100                <artifactId>spring-cloud-dependencies</artifactId>
101                <version>${spring-cloud.version}</version>
102                <type>pom</type>
103                <scope>import</scope>
104            </dependency>
105        </dependencies>
106    </dependencyManagement>
107
108    <build>
109        <plugins>
110            <plugin>
111                <groupId>org.springframework.boot</groupId>
112                <artifactId>spring-boot-maven-plugin</artifactId>
113            </plugin>
114        </plugins>
115    </build>
116
117</project>
118

Full Error Message

1package com.sample.apigateway;
2
3import org.springframework.boot.SpringApplication;
4import org.springframework.boot.autoconfigure.SpringBootApplication;
5import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
6
7@SpringBootApplication
8@EnableEurekaClient
9public class ApiGatewayApplication {
10
11    public static void main(String[] args) {
12        SpringApplication.run(ApiGatewayApplication.class, args);
13    }
14
15}
16spring:
17  application:
18    name: GATEWAY-SERVICE
19
20  cloud:
21    gateway:
22      routes:
23        - id: USER-SERVICE
24          uri: lb://USER-SERVICE
25          predicates:
26            - Path=/users/**
27        - id: DEPARTMENT-SERVICE
28          uri: lb://DEPARTMENT-SERVICE
29          predicates:
30            - Path=/departments/**
31
32eureka:
33  client:
34    register-with-eureka: true
35    fetch-registry: true
36    service-url:
37      defaultZone: http://localhost:8761/eureka/
38
39  instance:
40    hostname: localhost
41
42server:
43  port: 9191
44<?xml version="1.0" encoding="UTF-8"?>
45<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
46         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
47    <modelVersion>4.0.0</modelVersion>
48    <parent>
49        <groupId>org.springframework.boot</groupId>
50        <artifactId>spring-boot-starter-parent</artifactId>
51        <version>2.5.3</version>
52        <relativePath/> <!-- lookup parent from repository -->
53    </parent>
54    <groupId>com.sample.apigateway</groupId>
55    <artifactId>apigateway</artifactId>
56    <version>0.0.1-SNAPSHOT</version>
57    <name>apigateway</name>
58    <description>Demo project for Spring Boot</description>
59    <properties>
60        <java.version>11</java.version>
61        <spring-cloud.version>2020.0.3</spring-cloud.version>
62    </properties>
63    <dependencies>
64        <dependency>
65            <groupId>org.springframework.boot</groupId>
66            <artifactId>spring-boot-starter-actuator</artifactId>
67        </dependency>
68        <dependency>
69            <groupId>org.springframework.boot</groupId>
70            <artifactId>spring-boot-starter-webflux</artifactId>
71        </dependency>
72        <dependency>
73            <groupId>io.springfox</groupId>
74            <artifactId>springfox-boot-starter</artifactId>
75            <version>3.0.0</version>
76        </dependency>
77        <dependency>
78            <groupId>org.springframework.cloud</groupId>
79            <artifactId>spring-cloud-starter-gateway</artifactId>
80        </dependency>
81        <dependency>
82            <groupId>org.springframework.cloud</groupId>
83            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
84        </dependency>
85        <dependency>
86            <groupId>org.springframework.cloud</groupId>
87            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
88        </dependency>
89
90        <dependency>
91            <groupId>org.springframework.boot</groupId>
92            <artifactId>spring-boot-starter-test</artifactId>
93            <scope>test</scope>
94        </dependency>
95    </dependencies>
96    <dependencyManagement>
97        <dependencies>
98            <dependency>
99                <groupId>org.springframework.cloud</groupId>
100                <artifactId>spring-cloud-dependencies</artifactId>
101                <version>${spring-cloud.version}</version>
102                <type>pom</type>
103                <scope>import</scope>
104            </dependency>
105        </dependencies>
106    </dependencyManagement>
107
108    <build>
109        <plugins>
110            <plugin>
111                <groupId>org.springframework.boot</groupId>
112                <artifactId>spring-boot-maven-plugin</artifactId>
113            </plugin>
114        </plugins>
115    </build>
116
117</project>
1182021-07-30 23:12:02.420  WARN 19032 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration$SpringMvcFoundOnClasspathConfiguration': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration$SpringMvcFoundOnClasspathConfiguration]: Constructor threw exception; nested exception is org.springframework.cloud.gateway.support.MvcFoundOnClasspathException
1192021-07-30 23:12:02.423  INFO 19032 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
1202021-07-30 23:12:02.441  INFO 19032 --- [           main] ConditionEvaluationReportLoggingListener : 
121
122Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
1232021-07-30 23:12:02.454 ERROR 19032 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 
124
125***************************
126APPLICATION FAILED TO START
127***************************
128
129Description:
130
131Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.
132
133Action:
134
135Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.
136
137
138Process finished with exit code 1
139

ANSWER

Answered 2021-Aug-01 at 06:17

Please note that Spring Cloud Gateway is not compatible with Spring MVC (spring-boot-starter-web). This is outlined in section "How to include Spring Cloud Gateway in the official reference documentation":

Spring Cloud Gateway is built on Spring Boot 2.x, Spring WebFlux, and Project Reactor. As a consequence, many of the familiar synchronous libraries (Spring Data and Spring Security, for example) and patterns you know may not apply when you use Spring Cloud Gateway.

Additionally, it is stated that:

Spring Cloud Gateway requires the Netty runtime provided by Spring Boot and Spring Webflux. It does not work in a traditional Servlet Container or when built as a WAR.

As already suggested by the error message, you would need to remove the dependency on spring-boot-starter-web. You can list all your direct and transitive dependencies with the following command:

1package com.sample.apigateway;
2
3import org.springframework.boot.SpringApplication;
4import org.springframework.boot.autoconfigure.SpringBootApplication;
5import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
6
7@SpringBootApplication
8@EnableEurekaClient
9public class ApiGatewayApplication {
10
11    public static void main(String[] args) {
12        SpringApplication.run(ApiGatewayApplication.class, args);
13    }
14
15}
16spring:
17  application:
18    name: GATEWAY-SERVICE
19
20  cloud:
21    gateway:
22      routes:
23        - id: USER-SERVICE
24          uri: lb://USER-SERVICE
25          predicates:
26            - Path=/users/**
27        - id: DEPARTMENT-SERVICE
28          uri: lb://DEPARTMENT-SERVICE
29          predicates:
30            - Path=/departments/**
31
32eureka:
33  client:
34    register-with-eureka: true
35    fetch-registry: true
36    service-url:
37      defaultZone: http://localhost:8761/eureka/
38
39  instance:
40    hostname: localhost
41
42server:
43  port: 9191
44<?xml version="1.0" encoding="UTF-8"?>
45<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
46         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
47    <modelVersion>4.0.0</modelVersion>
48    <parent>
49        <groupId>org.springframework.boot</groupId>
50        <artifactId>spring-boot-starter-parent</artifactId>
51        <version>2.5.3</version>
52        <relativePath/> <!-- lookup parent from repository -->
53    </parent>
54    <groupId>com.sample.apigateway</groupId>
55    <artifactId>apigateway</artifactId>
56    <version>0.0.1-SNAPSHOT</version>
57    <name>apigateway</name>
58    <description>Demo project for Spring Boot</description>
59    <properties>
60        <java.version>11</java.version>
61        <spring-cloud.version>2020.0.3</spring-cloud.version>
62    </properties>
63    <dependencies>
64        <dependency>
65            <groupId>org.springframework.boot</groupId>
66            <artifactId>spring-boot-starter-actuator</artifactId>
67        </dependency>
68        <dependency>
69            <groupId>org.springframework.boot</groupId>
70            <artifactId>spring-boot-starter-webflux</artifactId>
71        </dependency>
72        <dependency>
73            <groupId>io.springfox</groupId>
74            <artifactId>springfox-boot-starter</artifactId>
75            <version>3.0.0</version>
76        </dependency>
77        <dependency>
78            <groupId>org.springframework.cloud</groupId>
79            <artifactId>spring-cloud-starter-gateway</artifactId>
80        </dependency>
81        <dependency>
82            <groupId>org.springframework.cloud</groupId>
83            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
84        </dependency>
85        <dependency>
86            <groupId>org.springframework.cloud</groupId>
87            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
88        </dependency>
89
90        <dependency>
91            <groupId>org.springframework.boot</groupId>
92            <artifactId>spring-boot-starter-test</artifactId>
93            <scope>test</scope>
94        </dependency>
95    </dependencies>
96    <dependencyManagement>
97        <dependencies>
98            <dependency>
99                <groupId>org.springframework.cloud</groupId>
100                <artifactId>spring-cloud-dependencies</artifactId>
101                <version>${spring-cloud.version}</version>
102                <type>pom</type>
103                <scope>import</scope>
104            </dependency>
105        </dependencies>
106    </dependencyManagement>
107
108    <build>
109        <plugins>
110            <plugin>
111                <groupId>org.springframework.boot</groupId>
112                <artifactId>spring-boot-maven-plugin</artifactId>
113            </plugin>
114        </plugins>
115    </build>
116
117</project>
1182021-07-30 23:12:02.420  WARN 19032 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration$SpringMvcFoundOnClasspathConfiguration': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration$SpringMvcFoundOnClasspathConfiguration]: Constructor threw exception; nested exception is org.springframework.cloud.gateway.support.MvcFoundOnClasspathException
1192021-07-30 23:12:02.423  INFO 19032 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
1202021-07-30 23:12:02.441  INFO 19032 --- [           main] ConditionEvaluationReportLoggingListener : 
121
122Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
1232021-07-30 23:12:02.454 ERROR 19032 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 
124
125***************************
126APPLICATION FAILED TO START
127***************************
128
129Description:
130
131Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.
132
133Action:
134
135Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.
136
137
138Process finished with exit code 1
139mvn dependency:tree
140

This will reveal that spring-cloud-starter-netflix-eureka-server depends on spring-boot-starter-web. Once you remove the following lines from your pom.xml, your application should start up:

1package com.sample.apigateway;
2
3import org.springframework.boot.SpringApplication;
4import org.springframework.boot.autoconfigure.SpringBootApplication;
5import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
6
7@SpringBootApplication
8@EnableEurekaClient
9public class ApiGatewayApplication {
10
11    public static void main(String[] args) {
12        SpringApplication.run(ApiGatewayApplication.class, args);
13    }
14
15}
16spring:
17  application:
18    name: GATEWAY-SERVICE
19
20  cloud:
21    gateway:
22      routes:
23        - id: USER-SERVICE
24          uri: lb://USER-SERVICE
25          predicates:
26            - Path=/users/**
27        - id: DEPARTMENT-SERVICE
28          uri: lb://DEPARTMENT-SERVICE
29          predicates:
30            - Path=/departments/**
31
32eureka:
33  client:
34    register-with-eureka: true
35    fetch-registry: true
36    service-url:
37      defaultZone: http://localhost:8761/eureka/
38
39  instance:
40    hostname: localhost
41
42server:
43  port: 9191
44<?xml version="1.0" encoding="UTF-8"?>
45<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
46         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
47    <modelVersion>4.0.0</modelVersion>
48    <parent>
49        <groupId>org.springframework.boot</groupId>
50        <artifactId>spring-boot-starter-parent</artifactId>
51        <version>2.5.3</version>
52        <relativePath/> <!-- lookup parent from repository -->
53    </parent>
54    <groupId>com.sample.apigateway</groupId>
55    <artifactId>apigateway</artifactId>
56    <version>0.0.1-SNAPSHOT</version>
57    <name>apigateway</name>
58    <description>Demo project for Spring Boot</description>
59    <properties>
60        <java.version>11</java.version>
61        <spring-cloud.version>2020.0.3</spring-cloud.version>
62    </properties>
63    <dependencies>
64        <dependency>
65            <groupId>org.springframework.boot</groupId>
66            <artifactId>spring-boot-starter-actuator</artifactId>
67        </dependency>
68        <dependency>
69            <groupId>org.springframework.boot</groupId>
70            <artifactId>spring-boot-starter-webflux</artifactId>
71        </dependency>
72        <dependency>
73            <groupId>io.springfox</groupId>
74            <artifactId>springfox-boot-starter</artifactId>
75            <version>3.0.0</version>
76        </dependency>
77        <dependency>
78            <groupId>org.springframework.cloud</groupId>
79            <artifactId>spring-cloud-starter-gateway</artifactId>
80        </dependency>
81        <dependency>
82            <groupId>org.springframework.cloud</groupId>
83            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
84        </dependency>
85        <dependency>
86            <groupId>org.springframework.cloud</groupId>
87            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
88        </dependency>
89
90        <dependency>
91            <groupId>org.springframework.boot</groupId>
92            <artifactId>spring-boot-starter-test</artifactId>
93            <scope>test</scope>
94        </dependency>
95    </dependencies>
96    <dependencyManagement>
97        <dependencies>
98            <dependency>
99                <groupId>org.springframework.cloud</groupId>
100                <artifactId>spring-cloud-dependencies</artifactId>
101                <version>${spring-cloud.version}</version>
102                <type>pom</type>
103                <scope>import</scope>
104            </dependency>
105        </dependencies>
106    </dependencyManagement>
107
108    <build>
109        <plugins>
110            <plugin>
111                <groupId>org.springframework.boot</groupId>
112                <artifactId>spring-boot-maven-plugin</artifactId>
113            </plugin>
114        </plugins>
115    </build>
116
117</project>
1182021-07-30 23:12:02.420  WARN 19032 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration$SpringMvcFoundOnClasspathConfiguration': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration$SpringMvcFoundOnClasspathConfiguration]: Constructor threw exception; nested exception is org.springframework.cloud.gateway.support.MvcFoundOnClasspathException
1192021-07-30 23:12:02.423  INFO 19032 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
1202021-07-30 23:12:02.441  INFO 19032 --- [           main] ConditionEvaluationReportLoggingListener : 
121
122Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
1232021-07-30 23:12:02.454 ERROR 19032 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 
124
125***************************
126APPLICATION FAILED TO START
127***************************
128
129Description:
130
131Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.
132
133Action:
134
135Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.
136
137
138Process finished with exit code 1
139mvn dependency:tree
140<dependency>
141    <groupId>org.springframework.cloud</groupId>
142    <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
143</dependency>
144

Source https://stackoverflow.com/questions/68587832

QUESTION

Android app won't build -- The minCompileSdk (31) specified in a dependency's androidx.work:work-runtime:2.7.0-beta01

Asked 2022-Mar-11 at 16:01

I'm trying to build a project in my M1,

but I got this error when I run npx react-native run-android

1FAILURE: Build failed with an exception.
2
3* What went wrong:
4Execution failed for task ':app:checkDebugAarMetadata'.
5> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
6   > The minCompileSdk (31) specified in a
7     dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
8     is greater than this module's compileSdkVersion (android-30).
9     Dependency: androidx.work:work-runtime:2.7.0-beta01.
10     AAR metadata file: /Users/macpro/.gradle/caches/transforms-3/999e9d813832e06d8f1b7de52647a502/transformed/work-runtime-2.7.0-beta01/META-INF/com/android/build/gradle/aar-metadata.properties.
11

Android/build.gradle

1FAILURE: Build failed with an exception.
2
3* What went wrong:
4Execution failed for task ':app:checkDebugAarMetadata'.
5> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
6   > The minCompileSdk (31) specified in a
7     dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
8     is greater than this module's compileSdkVersion (android-30).
9     Dependency: androidx.work:work-runtime:2.7.0-beta01.
10     AAR metadata file: /Users/macpro/.gradle/caches/transforms-3/999e9d813832e06d8f1b7de52647a502/transformed/work-runtime-2.7.0-beta01/META-INF/com/android/build/gradle/aar-metadata.properties.
11// Top-level build file where you can add configuration options common to all sub-projects/modules.
12
13buildscript {
14    ext {
15        buildToolsVersion = "30.0.0"
16        minSdkVersion = 21
17        compileSdkVersion = 30
18        targetSdkVersion = 30
19        supportLibVersion   = "28.0.0"
20    }
21    repositories {
22        google()
23        jcenter()
24    }
25    dependencies {
26        classpath('com.android.tools.build:gradle:4.1.2')
27        classpath('com.google.gms:google-services:4.3.0')
28        // NOTE: Do not place your application dependencies here; they belong
29        // in the individual module build.gradle files
30    }
31}
32
33allprojects {
34    repositories {
35        mavenLocal()
36        maven {
37            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
38            url("$rootDir/../node_modules/react-native/android")
39        }
40        maven {
41            // Android JSC is installed from npm
42            url("$rootDir/../node_modules/jsc-android/dist")
43        }
44
45        google()
46        jcenter()
47        maven { url 'https://www.jitpack.io' }
48    }
49    
50}
51

gradle-wrapper.properties

1FAILURE: Build failed with an exception.
2
3* What went wrong:
4Execution failed for task ':app:checkDebugAarMetadata'.
5> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
6   > The minCompileSdk (31) specified in a
7     dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
8     is greater than this module's compileSdkVersion (android-30).
9     Dependency: androidx.work:work-runtime:2.7.0-beta01.
10     AAR metadata file: /Users/macpro/.gradle/caches/transforms-3/999e9d813832e06d8f1b7de52647a502/transformed/work-runtime-2.7.0-beta01/META-INF/com/android/build/gradle/aar-metadata.properties.
11// Top-level build file where you can add configuration options common to all sub-projects/modules.
12
13buildscript {
14    ext {
15        buildToolsVersion = "30.0.0"
16        minSdkVersion = 21
17        compileSdkVersion = 30
18        targetSdkVersion = 30
19        supportLibVersion   = "28.0.0"
20    }
21    repositories {
22        google()
23        jcenter()
24    }
25    dependencies {
26        classpath('com.android.tools.build:gradle:4.1.2')
27        classpath('com.google.gms:google-services:4.3.0')
28        // NOTE: Do not place your application dependencies here; they belong
29        // in the individual module build.gradle files
30    }
31}
32
33allprojects {
34    repositories {
35        mavenLocal()
36        maven {
37            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
38            url("$rootDir/../node_modules/react-native/android")
39        }
40        maven {
41            // Android JSC is installed from npm
42            url("$rootDir/../node_modules/jsc-android/dist")
43        }
44
45        google()
46        jcenter()
47        maven { url 'https://www.jitpack.io' }
48    }
49    
50}
51distributionBase=GRADLE_USER_HOME
52distributionPath=wrapper/dists
53distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
54zipStoreBase=GRADLE_USER_HOME
55zipStorePath=wrapper/dists
56

ANSWER

Answered 2021-Sep-02 at 23:03

The error is being caused because one of your dependencies is internally using WorkManager 2.7.0-beta01 that was released today (which needs API 31). In my case it was CheckAarMetadata.kt.

You can fix it by forcing Gradle to use an older version of Work Manager for the transitive dependency that works with API 30. In your build.gradle file add:

1FAILURE: Build failed with an exception.
2
3* What went wrong:
4Execution failed for task ':app:checkDebugAarMetadata'.
5> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
6   > The minCompileSdk (31) specified in a
7     dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
8     is greater than this module's compileSdkVersion (android-30).
9     Dependency: androidx.work:work-runtime:2.7.0-beta01.
10     AAR metadata file: /Users/macpro/.gradle/caches/transforms-3/999e9d813832e06d8f1b7de52647a502/transformed/work-runtime-2.7.0-beta01/META-INF/com/android/build/gradle/aar-metadata.properties.
11// Top-level build file where you can add configuration options common to all sub-projects/modules.
12
13buildscript {
14    ext {
15        buildToolsVersion = "30.0.0"
16        minSdkVersion = 21
17        compileSdkVersion = 30
18        targetSdkVersion = 30
19        supportLibVersion   = "28.0.0"
20    }
21    repositories {
22        google()
23        jcenter()
24    }
25    dependencies {
26        classpath('com.android.tools.build:gradle:4.1.2')
27        classpath('com.google.gms:google-services:4.3.0')
28        // NOTE: Do not place your application dependencies here; they belong
29        // in the individual module build.gradle files
30    }
31}
32
33allprojects {
34    repositories {
35        mavenLocal()
36        maven {
37            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
38            url("$rootDir/../node_modules/react-native/android")
39        }
40        maven {
41            // Android JSC is installed from npm
42            url("$rootDir/../node_modules/jsc-android/dist")
43        }
44
45        google()
46        jcenter()
47        maven { url 'https://www.jitpack.io' }
48    }
49    
50}
51distributionBase=GRADLE_USER_HOME
52distributionPath=wrapper/dists
53distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
54zipStoreBase=GRADLE_USER_HOME
55zipStorePath=wrapper/dists
56dependencies {
57    def work_version = "2.6.0"
58    // Force WorkManager 2.6.0 for transitive dependency
59    implementation("androidx.work:work-runtime-ktx:$work_version") {
60        force = true
61    }
62}
63

This should fix it.

Source https://stackoverflow.com/questions/69037481

QUESTION

Error when trying to run my React Native app on Android

Asked 2022-Mar-06 at 07:58

I've built my React Native app and tested and troubleshooted with my iOS devices for months. Now I'm trying to built and test the app on Android for the first time. The thing is, that I keep getting errors trying to run the Android-version of my app. After hours of debugging and troubleshooting, I tried to create a new RN project and see if that could run on my emulator and device. I got that part working and then I wanted to copy/paste the files of my existing app project into the new project.

I pasted my existing assets, styles, the source JS-files and the package.json file into the new project, ran npm install and then I ended up with the exact same error message as I had in the original project when I run react-native run-android.

The full error message is here:

1error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
2Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
3Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
4Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
5Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
6Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
7Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
8
9FAILURE: Build failed with an exception.
10
11* What went wrong:
12Execution failed for task ':app:mergeDebugAssets'.
13> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
14   > Could not find com.facebook.yoga:proguard-annotations:1.14.1.
15     Searched in the following locations:
16       - https://dl.google.com/dl/android/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
17       - https://repo.maven.apache.org/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
18       - file:/Users/MyUser/.m2/repository/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
19       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
20       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
21       - https://www.jitpack.io/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
22     Required by:
23         project :app > com.facebook.react:react-native:0.64.2
24   > Could not find com.facebook.fbjni:fbjni-java-only:0.0.3.
25     Searched in the following locations:
26       - https://dl.google.com/dl/android/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
27       - https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
28       - file:/Users/MyUser/.m2/repository/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
29       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
30       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
31       - https://www.jitpack.io/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
32     Required by:
33         project :app > com.facebook.react:react-native:0.64.2
34   > Could not find com.yqritc:android-scalablevideoview:1.0.4.
35     Searched in the following locations:
36       - https://dl.google.com/dl/android/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
37       - https://repo.maven.apache.org/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
38       - file:/Users/MyUser/.m2/repository/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
39       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
40       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
41       - https://www.jitpack.io/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
42     Required by:
43         project :app > project :react-native-video
44
45* Try:
46Run 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.
47
48* Get more help at https://help.gradle.org
49
50BUILD FAILED in 10s
51
52    at makeError (/Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:174:9)
53    at /Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:278:16
54    at processTicksAndRejections (node:internal/process/task_queues:96:5)
55    at async runOnAllDevices (/Users/MyUser/MyAppFolder/MyApp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
56    at async Command.handleAction (/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:186:9)
57

I've tried to run ./gradlew clean in the android-folder without any luck. My build.gradle-file looks like this:

1error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
2Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
3Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
4Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
5Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
6Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
7Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
8
9FAILURE: Build failed with an exception.
10
11* What went wrong:
12Execution failed for task ':app:mergeDebugAssets'.
13> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
14   > Could not find com.facebook.yoga:proguard-annotations:1.14.1.
15     Searched in the following locations:
16       - https://dl.google.com/dl/android/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
17       - https://repo.maven.apache.org/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
18       - file:/Users/MyUser/.m2/repository/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
19       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
20       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
21       - https://www.jitpack.io/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
22     Required by:
23         project :app > com.facebook.react:react-native:0.64.2
24   > Could not find com.facebook.fbjni:fbjni-java-only:0.0.3.
25     Searched in the following locations:
26       - https://dl.google.com/dl/android/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
27       - https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
28       - file:/Users/MyUser/.m2/repository/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
29       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
30       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
31       - https://www.jitpack.io/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
32     Required by:
33         project :app > com.facebook.react:react-native:0.64.2
34   > Could not find com.yqritc:android-scalablevideoview:1.0.4.
35     Searched in the following locations:
36       - https://dl.google.com/dl/android/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
37       - https://repo.maven.apache.org/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
38       - file:/Users/MyUser/.m2/repository/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
39       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
40       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
41       - https://www.jitpack.io/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
42     Required by:
43         project :app > project :react-native-video
44
45* Try:
46Run 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.
47
48* Get more help at https://help.gradle.org
49
50BUILD FAILED in 10s
51
52    at makeError (/Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:174:9)
53    at /Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:278:16
54    at processTicksAndRejections (node:internal/process/task_queues:96:5)
55    at async runOnAllDevices (/Users/MyUser/MyAppFolder/MyApp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
56    at async Command.handleAction (/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:186:9)
57// Top-level build file where you can add configuration options common to all sub-projects/modules.
58
59buildscript {
60    ext {
61        buildToolsVersion = "30.0.2"
62        minSdkVersion = 21
63        compileSdkVersion = 30
64        targetSdkVersion = 30
65        ndkVersion = "20.1.5948944"
66        kotlinVersion = "1.3.72"
67    }
68    repositories {
69        repositories {
70            google()
71            maven { url 'https://maven.google.com' }
72            mavenLocal()
73            mavenCentral()
74
75           // jcenter()
76            maven {
77                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
78                url "$rootDir/../node_modules/react-native/android"
79            }
80        }
81    }
82    dependencies {
83        classpath("com.android.tools.build:gradle:4.2.1")
84        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
85        // NOTE: Do not place your application dependencies here; they belong
86        // in the individual module build.gradle files
87    }
88}
89
90allprojects {
91    repositories {
92        google()
93        mavenCentral()
94
95        mavenLocal()
96        maven {
97            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
98            url("$rootDir/../node_modules/react-native/android")
99        }
100        maven {
101            // Android JSC is installed from npm
102            url("$rootDir/../node_modules/jsc-android/dist")
103        }
104
105        maven { url 'https://www.jitpack.io' }
106    }
107}
108

Please let me know if you know what to do or if you have experienced a similar issue!

ANSWER

Answered 2021-Aug-21 at 13:43

I've hit this same issue and have temporarily resolved it by uninstalling react-native-video (npm uninstall --save react-native-video). That's not a great answer as I need that component, but I don't have a full solution yet. I think somehow com.yqritc:android-scalablevideoview:1.0.4. is required by react-native-video but has gotten lost or removed. Other thoughts are welcome.

UPDATE: Resolved! In your build.gradle in your Android folder you need to add the repository "jcenter()" in allprojects (not in build dependencies) like this...

1error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
2Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
3Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
4Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
5Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
6Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
7Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
8
9FAILURE: Build failed with an exception.
10
11* What went wrong:
12Execution failed for task ':app:mergeDebugAssets'.
13> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
14   > Could not find com.facebook.yoga:proguard-annotations:1.14.1.
15     Searched in the following locations:
16       - https://dl.google.com/dl/android/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
17       - https://repo.maven.apache.org/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
18       - file:/Users/MyUser/.m2/repository/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
19       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
20       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
21       - https://www.jitpack.io/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
22     Required by:
23         project :app > com.facebook.react:react-native:0.64.2
24   > Could not find com.facebook.fbjni:fbjni-java-only:0.0.3.
25     Searched in the following locations:
26       - https://dl.google.com/dl/android/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
27       - https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
28       - file:/Users/MyUser/.m2/repository/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
29       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
30       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
31       - https://www.jitpack.io/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
32     Required by:
33         project :app > com.facebook.react:react-native:0.64.2
34   > Could not find com.yqritc:android-scalablevideoview:1.0.4.
35     Searched in the following locations:
36       - https://dl.google.com/dl/android/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
37       - https://repo.maven.apache.org/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
38       - file:/Users/MyUser/.m2/repository/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
39       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
40       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
41       - https://www.jitpack.io/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
42     Required by:
43         project :app > project :react-native-video
44
45* Try:
46Run 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.
47
48* Get more help at https://help.gradle.org
49
50BUILD FAILED in 10s
51
52    at makeError (/Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:174:9)
53    at /Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:278:16
54    at processTicksAndRejections (node:internal/process/task_queues:96:5)
55    at async runOnAllDevices (/Users/MyUser/MyAppFolder/MyApp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
56    at async Command.handleAction (/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:186:9)
57// Top-level build file where you can add configuration options common to all sub-projects/modules.
58
59buildscript {
60    ext {
61        buildToolsVersion = "30.0.2"
62        minSdkVersion = 21
63        compileSdkVersion = 30
64        targetSdkVersion = 30
65        ndkVersion = "20.1.5948944"
66        kotlinVersion = "1.3.72"
67    }
68    repositories {
69        repositories {
70            google()
71            maven { url 'https://maven.google.com' }
72            mavenLocal()
73            mavenCentral()
74
75           // jcenter()
76            maven {
77                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
78                url "$rootDir/../node_modules/react-native/android"
79            }
80        }
81    }
82    dependencies {
83        classpath("com.android.tools.build:gradle:4.2.1")
84        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
85        // NOTE: Do not place your application dependencies here; they belong
86        // in the individual module build.gradle files
87    }
88}
89
90allprojects {
91    repositories {
92        google()
93        mavenCentral()
94
95        mavenLocal()
96        maven {
97            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
98            url("$rootDir/../node_modules/react-native/android")
99        }
100        maven {
101            // Android JSC is installed from npm
102            url("$rootDir/../node_modules/jsc-android/dist")
103        }
104
105        maven { url 'https://www.jitpack.io' }
106    }
107}
108allprojects {
109    repositories {
110        mavenCentral()
111        mavenLocal()
112        jcenter()
113}
114

Source https://stackoverflow.com/questions/68835157

QUESTION

https://dl.bintray.com/kotlin/kotlin-eap 502 bad gateway

Asked 2022-Feb-26 at 13:18

My apk is failing to compile saying it could not get

Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.4.21'] was not found in any of the following sources:

When I try to visit: https://dl.bintray.com/kotlin/kotlin-eap I get a 502 bad gateway

is this the reason why it's failing to build?

my gradle:

1// Top-level build file where you can add configuration options common to all sub-projects/modules.
2
3buildscript {
4    ext.kotlin_version = '1.3.50'
5    repositories {
6        jcenter()
7        google()
8        gradlePluginPortal()
9
10    }
11    dependencies {
12        classpath 'com.android.tools.build:gradle:4.0.1'
13        classpath 'com.google.gms:google-services:4.3.4'
14        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
16        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
17        // NOTE: Do not place your application dependencies here; they belong
18        // in the individual module build.gradle files
19    }
20}
21plugins {
22    id 'org.jetbrains.kotlin.jvm' version '1.4.21'
23}
24
25allprojects {
26            repositories {
27                maven { url "https://maven.google.com" }
28                maven { url "https://jitpack.io" }
29                maven { url "http://dl.bintray.com/jlmd/maven" }
30                maven{
31                    url "https://oss.sonatype.org/content/repositories/snapshots"
32
33                }
34                maven {
35                    url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
36            credentials {
37                username 'braintree_team_sdk'
38                password 'AKCp8jQcoDy2hxSWhDAUQKXLDPDx6NYRkqrgFLRc3qDrayg6rrCbJpsKKyMwaykVL8FWusJpp'
39            }
40        }
41        maven{
42            url 'https://zendesk.jfrog.io/zendesk/oss-releases-local'
43
44        }
45        jcenter()
46        google()
47
48        mavenCentral()
49
50    }
51}
52
53repositories {
54    maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
55    mavenCentral()
56}
57dependencies {
58    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
59}
60compileKotlin {
61    kotlinOptions {
62        jvmTarget = "1.8"
63    }
64}
65compileTestKotlin {
66    kotlinOptions {
67        jvmTarget = "1.8"
68    }
69}
70

i can't find the reason why my apk suddenly stopped building it was working last month i need to find the solution before tomorrow please someone help me.

full error code

1// Top-level build file where you can add configuration options common to all sub-projects/modules.
2
3buildscript {
4    ext.kotlin_version = '1.3.50'
5    repositories {
6        jcenter()
7        google()
8        gradlePluginPortal()
9
10    }
11    dependencies {
12        classpath 'com.android.tools.build:gradle:4.0.1'
13        classpath 'com.google.gms:google-services:4.3.4'
14        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
16        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
17        // NOTE: Do not place your application dependencies here; they belong
18        // in the individual module build.gradle files
19    }
20}
21plugins {
22    id 'org.jetbrains.kotlin.jvm' version '1.4.21'
23}
24
25allprojects {
26            repositories {
27                maven { url "https://maven.google.com" }
28                maven { url "https://jitpack.io" }
29                maven { url "http://dl.bintray.com/jlmd/maven" }
30                maven{
31                    url "https://oss.sonatype.org/content/repositories/snapshots"
32
33                }
34                maven {
35                    url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
36            credentials {
37                username 'braintree_team_sdk'
38                password 'AKCp8jQcoDy2hxSWhDAUQKXLDPDx6NYRkqrgFLRc3qDrayg6rrCbJpsKKyMwaykVL8FWusJpp'
39            }
40        }
41        maven{
42            url 'https://zendesk.jfrog.io/zendesk/oss-releases-local'
43
44        }
45        jcenter()
46        google()
47
48        mavenCentral()
49
50    }
51}
52
53repositories {
54    maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
55    mavenCentral()
56}
57dependencies {
58    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
59}
60compileKotlin {
61    kotlinOptions {
62        jvmTarget = "1.8"
63    }
64}
65compileTestKotlin {
66    kotlinOptions {
67        jvmTarget = "1.8"
68    }
69}
70Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.4.21'] was not found in any of the following sources:
71
72- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
73- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.4.21')
74  Searched in the following repositories:
75    maven(https://dl.bintray.com/kotlin/kotlin-eap)
76    MavenRepo
77    maven2(https://plugins.gradle.org/m2/)
78

ANSWER

Answered 2021-Dec-14 at 02:15

Bintray and JCenter is not supported yet

Remove all Bintray and JCenter repository configure in your gradle file. And use mavenCentral() instead.

Here is the solution:

1// Top-level build file where you can add configuration options common to all sub-projects/modules.
2
3buildscript {
4    ext.kotlin_version = '1.3.50'
5    repositories {
6        jcenter()
7        google()
8        gradlePluginPortal()
9
10    }
11    dependencies {
12        classpath 'com.android.tools.build:gradle:4.0.1'
13        classpath 'com.google.gms:google-services:4.3.4'
14        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
16        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
17        // NOTE: Do not place your application dependencies here; they belong
18        // in the individual module build.gradle files
19    }
20}
21plugins {
22    id 'org.jetbrains.kotlin.jvm' version '1.4.21'
23}
24
25allprojects {
26            repositories {
27                maven { url "https://maven.google.com" }
28                maven { url "https://jitpack.io" }
29                maven { url "http://dl.bintray.com/jlmd/maven" }
30                maven{
31                    url "https://oss.sonatype.org/content/repositories/snapshots"
32
33                }
34                maven {
35                    url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
36            credentials {
37                username 'braintree_team_sdk'
38                password 'AKCp8jQcoDy2hxSWhDAUQKXLDPDx6NYRkqrgFLRc3qDrayg6rrCbJpsKKyMwaykVL8FWusJpp'
39            }
40        }
41        maven{
42            url 'https://zendesk.jfrog.io/zendesk/oss-releases-local'
43
44        }
45        jcenter()
46        google()
47
48        mavenCentral()
49
50    }
51}
52
53repositories {
54    maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
55    mavenCentral()
56}
57dependencies {
58    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
59}
60compileKotlin {
61    kotlinOptions {
62        jvmTarget = "1.8"
63    }
64}
65compileTestKotlin {
66    kotlinOptions {
67        jvmTarget = "1.8"
68    }
69}
70Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.4.21'] was not found in any of the following sources:
71
72- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
73- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.4.21')
74  Searched in the following repositories:
75    maven(https://dl.bintray.com/kotlin/kotlin-eap)
76    MavenRepo
77    maven2(https://plugins.gradle.org/m2/)
78// Top-level build file where you can add configuration options common to all sub-projects/modules.
79
80buildscript {
81    ext.kotlin_version = '1.3.50'
82    repositories {
83        // jcenter()
84        mavenCentral() // use this instead
85        google()
86        gradlePluginPortal()
87
88    }
89    dependencies {
90        classpath 'com.android.tools.build:gradle:4.0.1'
91        classpath 'com.google.gms:google-services:4.3.4'
92        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
93        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
94        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
95        // NOTE: Do not place your application dependencies here; they belong
96        // in the individual module build.gradle files
97    }
98}
99plugins {
100    id 'org.jetbrains.kotlin.jvm' version '1.4.21'
101}
102
103allprojects {
104            repositories {
105                maven { url "https://maven.google.com" }
106                maven { url "https://jitpack.io" }
107                // maven { url "http://dl.bintray.com/jlmd/maven" }
108                maven{
109                    url "https://oss.sonatype.org/content/repositories/snapshots"
110
111                }
112                maven {
113                    // url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
114            credentials {
115                username 'braintree_team_sdk'
116                password 'AKCp8jQcoDy2hxSWhDAUQKXLDPDx6NYRkqrgFLRc3qDrayg6rrCbJpsKKyMwaykVL8FWusJpp'
117            }
118        }
119        maven{
120            // url 'https://zendesk.jfrog.io/zendesk/oss-releases-local'
121
122        }
123        // jcenter()
124        google()
125
126        mavenCentral()
127
128    }
129}
130
131repositories {
132    maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
133    mavenCentral()
134}
135dependencies {
136    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
137}
138compileKotlin {
139    kotlinOptions {
140        jvmTarget = "1.8"
141    }
142}
143compileTestKotlin {
144    kotlinOptions {
145        jvmTarget = "1.8"
146    }
147}
148

Source https://stackoverflow.com/questions/70338843

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Maven

Tutorials and Learning Resources are not available at this moment for Maven

Share this Page

share link

Get latest updates on Maven