Popular New Releases in Gradle
tinker
gradle
7.4.2
jib
jib-cli v0.10.0
dex2jar
jsonschema2pojo
1.1.1
Popular Libraries in Gradle
by Tencent java
16260 NOASSERTION
Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.
by gradle groovy
13299 Apache-2.0
Adaptable, fast automation for all
by GoogleContainerTools java
11721 Apache-2.0
๐ Build container images for your Java applications.
by KotlinBy kotlin
9775 Apache-2.0
A curated list of awesome Kotlin related stuff Inspired by awesome-java.
by pxb1988 java
9043 Apache-2.0
Tools to work with android .dex and java .class files
by square java
8940 Apache-2.0
A Java API for generating .java source files.
by Freelander java
8409
Some Android learning materials, hoping to help you learn Android development.
by android c++
8125 Apache-2.0
Android NDK samples with Android Studio
by square kotlin
7975 Apache-2.0
A modern JSON library for Kotlin and Java.
Trending New libraries in Gradle
by bytedance java
1948 Apache-2.0
ByteX is a bytecode plugin platform based on Android Gradle Transform API and ASM. ๅญ่็ ๆไปถๅผๅๅนณๅฐ
by cortinico kotlin
1330 MIT
Android + Kotlin + Github Actions + ktlint + Detekt + Gradle Kotlin DSL + buildSrc = โค๏ธ
by jevakallio typescript
1261 MIT
๐ ๐ฃ Communicate important updates to your team via git commit messages
by Aliucord java
980 OSL-3.0
A modification for the Discord Android App
by spotify kotlin
767 Apache-2.0
Gradle plugin which helps you analyze the size of your Android apps.
by android kotlin
744 Apache-2.0
Ready-to-use recipes for common build customizations that showcase the Android Gradle plugin's public APIs and DSL.
by Bryanx kotlin
588 MIT
Customisable toggle buttons inside a FlexboxLayout.
by JakeWharton kotlin
565 Apache-2.0
An intelligent diff tool for the output of Gradle's dependencies task
by jreleaser java
541 Apache-2.0
:rocket: Release projects quickly and easily with JReleaser
Top Authors in Gradle
1
25 Libraries
18640
2
20 Libraries
116
3
19 Libraries
822
4
18 Libraries
700
5
17 Libraries
2310
6
14 Libraries
1365
7
13 Libraries
577
8
12 Libraries
106
9
12 Libraries
140
10
12 Libraries
529
1
25 Libraries
18640
2
20 Libraries
116
3
19 Libraries
822
4
18 Libraries
700
5
17 Libraries
2310
6
14 Libraries
1365
7
13 Libraries
577
8
12 Libraries
106
9
12 Libraries
140
10
12 Libraries
529
Trending Kits in Gradle
No Trending Kits are available at this moment for Gradle
Trending Discussions on Gradle
Error: Member not found: 'packageRoot', how to solve ignore: deprecated_member_use in Flutter?
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'
Error: MainActivity must extend android.app.Activity [Instantiatable]
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
Springboot 2.6.0 / Spring fox 3 - Failed to start bean 'documentationPluginsBootstrapper'
Message "error: resource android:attr/lStar not found"
Plugin [id: 'dagger.hilt.android.plugin'] was not found in any of the following sources
Your project requires a newer version of the Kotlin Gradle plugin. (Android Studio)
IntelliJ - Invalid source release: 17
QUESTION
Error: Member not found: 'packageRoot', how to solve ignore: deprecated_member_use in Flutter?
Asked 2022-Apr-05 at 06:52In my flutter project, I have made some updates of plugins and then used flutter upgrade. After that, whenever I am running my flutter project it is showing following error-
1 /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.0.2/lib/src/interface/local_platform.dart:46:19: Error: Member not found: 'packageRoot'.
2 io.Platform.packageRoot; // ignore: deprecated_member_use
3 ^^^^^^^^^^^ FAILURE: Build failed with an exception.
4
5* Where: Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
6
7* What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.
8> Process 'command 'C:\src\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1
9
10* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
11
12* Get more help at https://help.gradle.org
13
14BUILD FAILED in 20s Exception: Gradle task assembleDebug failed with exit code 1
15
So, I need a suggestion that how can I solve this issue?
ANSWER
Answered 2021-Dec-16 at 11:49For me, cleaning and getting the packages didn't work. This error started after I upgraded flutter. I was on the master channel, a quick fix for me was to switch to stable.
1 /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.0.2/lib/src/interface/local_platform.dart:46:19: Error: Member not found: 'packageRoot'.
2 io.Platform.packageRoot; // ignore: deprecated_member_use
3 ^^^^^^^^^^^ FAILURE: Build failed with an exception.
4
5* Where: Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
6
7* What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.
8> Process 'command 'C:\src\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1
9
10* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
11
12* Get more help at https://help.gradle.org
13
14BUILD FAILED in 20s Exception: Gradle task assembleDebug failed with exit code 1
15flutter channel stable
16flutter upgrade
17
Perhaps theres a better solution which deals with platform package directly.
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:12I 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:02Android introduced a new way to define repositories.
Remove the dependencyResolutionManagement
block from the setting.gradle
file to have your project work the old way.
QUESTION
Error: MainActivity must extend android.app.Activity [Instantiatable]
Asked 2022-Mar-31 at 02:13I tried upgrading Android Gradle Plugin from 4.2.2 to 7.0.1 using the upgrade assistant which is available in Android Studio at Tools > AGP Upgrade Assistant. The only change it made was to my project-level build.gradle file:
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11
However, now when I run ./gradlew assemble assembleAndroidTest
I get the following error:
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12 android:name="com.locuslabs.appsdk.MainActivity"
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 Explanation for issues of type "Instantiatable":
15 Activities, services, broadcast receivers etc. registered in the manifest
16 file (or for custom views, in a layout file) must be "instantiatable" by
17 the system, which means that the class must be public, it must have an
18 empty public constructor, and if it's an inner class, it must be a static
19 inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25 lintOptions {
26 checkReleaseBuilds false
27 // Or, if you prefer, you can continue to check for errors in release builds,
28 // but continue the build even when errors are found:
29 abortOnError false
30 }
31}
32
My project is multi-module, but I don't suspect that as the problem since it's complaining about the application module, not a library module.
I believe my <activity>
tag is well formed in my AndroidManifest.xml for my application module:
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12 android:name="com.locuslabs.appsdk.MainActivity"
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 Explanation for issues of type "Instantiatable":
15 Activities, services, broadcast receivers etc. registered in the manifest
16 file (or for custom views, in a layout file) must be "instantiatable" by
17 the system, which means that the class must be public, it must have an
18 empty public constructor, and if it's an inner class, it must be a static
19 inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25 lintOptions {
26 checkReleaseBuilds false
27 // Or, if you prefer, you can continue to check for errors in release builds,
28 // but continue the build even when errors are found:
29 abortOnError false
30 }
31}
32 <activity
33 android:name="com.locuslabs.appsdk.MainActivity"
34 android:label="@string/app_name"
35 android:windowSoftInputMode="adjustNothing">
36 <intent-filter>
37 <action android:name="android.intent.action.MAIN" />
38
39 <category android:name="android.intent.category.LAUNCHER" />
40 </intent-filter>
41 </activity>
42
Furthermore, I don't think there is anything wrong with extending AppCompatActivity
instead of android.app.Activity
as I'm doing in my MainActivity.kt:
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12 android:name="com.locuslabs.appsdk.MainActivity"
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 Explanation for issues of type "Instantiatable":
15 Activities, services, broadcast receivers etc. registered in the manifest
16 file (or for custom views, in a layout file) must be "instantiatable" by
17 the system, which means that the class must be public, it must have an
18 empty public constructor, and if it's an inner class, it must be a static
19 inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25 lintOptions {
26 checkReleaseBuilds false
27 // Or, if you prefer, you can continue to check for errors in release builds,
28 // but continue the build even when errors are found:
29 abortOnError false
30 }
31}
32 <activity
33 android:name="com.locuslabs.appsdk.MainActivity"
34 android:label="@string/app_name"
35 android:windowSoftInputMode="adjustNothing">
36 <intent-filter>
37 <action android:name="android.intent.action.MAIN" />
38
39 <category android:name="android.intent.category.LAUNCHER" />
40 </intent-filter>
41 </activity>
42import androidx.appcompat.app.AppCompatActivity
43
44class MainActivity : AppCompatActivity() {
45 // ...
46}
47
I'm concerned that Android Gradle Plugin 7.0.1 is not really ready for prime-time because the Android Gradle Plugin documentation still says classpath 'com.android.tools.build:gradle:4.2.0'
instead of 7.0.1.
I saw that the Android Gradle Plugin 7.0.1 release notes mentioned some changes to linting but none of those changes seemed relevant to me.
I also skimmed through the Android Gradle Plugin source code to see if I could find the linting stage any identify any changes but it looked like a lot of work to find that code and do that analysis.
I searched for answers but all I could find were these two stackoverflow entries where the error was legitimate and the programmer just needed to change their code to ensure they were referencing an actual Activity
:
- Android Studio Error: Activity must extend android.app.activity
- MainActivity cannot be cast to android.app.Activity
I also tried Android Gradle Plugin 7.0.0 but got the same error. Only Android Gradle Plugin 4.2.2 prevents the error.
Is this a bug in Android Gradle Plugin 7.0.1?
Update: could not disable Instantiatable
I tried to disable the Instantiatable
lint error the following ways but none of them prevented the error.
First, I tried adding disable "Instantiatable"
to my application-level build.gradle file:
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12 android:name="com.locuslabs.appsdk.MainActivity"
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 Explanation for issues of type "Instantiatable":
15 Activities, services, broadcast receivers etc. registered in the manifest
16 file (or for custom views, in a layout file) must be "instantiatable" by
17 the system, which means that the class must be public, it must have an
18 empty public constructor, and if it's an inner class, it must be a static
19 inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25 lintOptions {
26 checkReleaseBuilds false
27 // Or, if you prefer, you can continue to check for errors in release builds,
28 // but continue the build even when errors are found:
29 abortOnError false
30 }
31}
32 <activity
33 android:name="com.locuslabs.appsdk.MainActivity"
34 android:label="@string/app_name"
35 android:windowSoftInputMode="adjustNothing">
36 <intent-filter>
37 <action android:name="android.intent.action.MAIN" />
38
39 <category android:name="android.intent.category.LAUNCHER" />
40 </intent-filter>
41 </activity>
42import androidx.appcompat.app.AppCompatActivity
43
44class MainActivity : AppCompatActivity() {
45 // ...
46}
47android {
48 lintOptions {
49 disable "Instantiatable"
50 }
51}
52
Second, I tried prepending @SdkSuppress("Instantiatable")
to the class:
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12 android:name="com.locuslabs.appsdk.MainActivity"
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 Explanation for issues of type "Instantiatable":
15 Activities, services, broadcast receivers etc. registered in the manifest
16 file (or for custom views, in a layout file) must be "instantiatable" by
17 the system, which means that the class must be public, it must have an
18 empty public constructor, and if it's an inner class, it must be a static
19 inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25 lintOptions {
26 checkReleaseBuilds false
27 // Or, if you prefer, you can continue to check for errors in release builds,
28 // but continue the build even when errors are found:
29 abortOnError false
30 }
31}
32 <activity
33 android:name="com.locuslabs.appsdk.MainActivity"
34 android:label="@string/app_name"
35 android:windowSoftInputMode="adjustNothing">
36 <intent-filter>
37 <action android:name="android.intent.action.MAIN" />
38
39 <category android:name="android.intent.category.LAUNCHER" />
40 </intent-filter>
41 </activity>
42import androidx.appcompat.app.AppCompatActivity
43
44class MainActivity : AppCompatActivity() {
45 // ...
46}
47android {
48 lintOptions {
49 disable "Instantiatable"
50 }
51}
52@SdkSuppress("Instantiatable")
53class MainActivity : AppCompatActivity() {
54 // ...
55}
56
Similarly, I tried @SuppressLint("Instantiatable")
but that didn't work either.
ANSWER
Answered 2021-Aug-24 at 16:35the Android Gradle Plugin documentation still says classpath 'com.android.tools.build:gradle:4.2.0' instead of 7.0.1.
You need to read further down the page, to this and this. That table is only relevant for pre-7.0.0 versions.
Is this a bug in Android Gradle Plugin 7.0.1?
Quite possibly. Or, perhaps beyond, as the Instantiatable
Lint check has a history of problems.
If your scenario does not match one of those three August 2021 bugs, and you are in position to provide a reproducible test case, file a fresh issue! Beyond that, if a clean-and-rebuild is not clearing up your problem, you might need to simply disable the Instantiatable
Lint check for the time being by adding the following to all of your build.gradle files at the application or library level (i.e. all except your project-level build.gradle):
1buildscript {
2 repositories {
3 google()
4 mavenCentral()
5 }
6 dependencies {
7 classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8 // ...
9 }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12 android:name="com.locuslabs.appsdk.MainActivity"
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 Explanation for issues of type "Instantiatable":
15 Activities, services, broadcast receivers etc. registered in the manifest
16 file (or for custom views, in a layout file) must be "instantiatable" by
17 the system, which means that the class must be public, it must have an
18 empty public constructor, and if it's an inner class, it must be a static
19 inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25 lintOptions {
26 checkReleaseBuilds false
27 // Or, if you prefer, you can continue to check for errors in release builds,
28 // but continue the build even when errors are found:
29 abortOnError false
30 }
31}
32 <activity
33 android:name="com.locuslabs.appsdk.MainActivity"
34 android:label="@string/app_name"
35 android:windowSoftInputMode="adjustNothing">
36 <intent-filter>
37 <action android:name="android.intent.action.MAIN" />
38
39 <category android:name="android.intent.category.LAUNCHER" />
40 </intent-filter>
41 </activity>
42import androidx.appcompat.app.AppCompatActivity
43
44class MainActivity : AppCompatActivity() {
45 // ...
46}
47android {
48 lintOptions {
49 disable "Instantiatable"
50 }
51}
52@SdkSuppress("Instantiatable")
53class MainActivity : AppCompatActivity() {
54 // ...
55}
56android {
57 lintOptions {
58 disable "Instantiatable"
59 }
60}
61
QUESTION
Could not GET 'play-services-location/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
Asked 2022-Mar-28 at 07:02I 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:09It 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.
QUESTION
Java, Intellij IDEA problem Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
Asked 2022-Mar-26 at 15:23I 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:22You 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)
QUESTION
Springboot 2.6.0 / Spring fox 3 - Failed to start bean 'documentationPluginsBootstrapper'
Asked 2022-Mar-25 at 06:14I'm trying to initiate a Springboot project using Open Jdk 15, Springboot 2.6.0, Springfox 3. We are working on a project that replaced Netty as the webserver and used Jetty instead because we do not need a non-blocking environment.
In the code we depend primarily on Reactor API (Flux, Mono), so we can not remove org.springframework.boot:spring-boot-starter-webflux
dependencies.
I replicated the problem that we have in a new project.: https://github.com/jvacaq/spring-fox.
I figured out that these lines in our build.gradle file are the origin of the problem.
1compile("org.springframework.boot:spring-boot-starter-web") {
2 exclude module: "spring-boot-starter-tomcat"
3}
4compile("org.springframework.boot:spring-boot-starter-jetty")
5
Here is the build.gradle
file:
1compile("org.springframework.boot:spring-boot-starter-web") {
2 exclude module: "spring-boot-starter-tomcat"
3}
4compile("org.springframework.boot:spring-boot-starter-jetty")
5plugins {
6 id 'org.springframework.boot' version '2.6.0'
7 id 'io.spring.dependency-management' version '1.0.11.RELEASE'
8 id 'java'
9}
10
11group = 'com.example'
12version = '0.0.1-SNAPSHOT'
13sourceCompatibility = '11'
14
15repositories {
16 mavenCentral()
17}
18
19dependencies {
20 compile("org.springframework.boot:spring-boot-starter-web") {
21 exclude module: "spring-boot-starter-tomcat"
22 }
23 compile("org.springframework.boot:spring-boot-starter-jetty")
24 implementation 'org.springframework.boot:spring-boot-starter-webflux'
25 testImplementation 'org.springframework.boot:spring-boot-starter-test'
26 testImplementation 'io.projectreactor:reactor-test'
27 implementation "io.springfox:springfox-boot-starter:3.0.0"
28}
29
30test {
31 useJUnitPlatform()
32}
33
34
I issued the command gradle clean bootrun
. The result is this error:
1compile("org.springframework.boot:spring-boot-starter-web") {
2 exclude module: "spring-boot-starter-tomcat"
3}
4compile("org.springframework.boot:spring-boot-starter-jetty")
5plugins {
6 id 'org.springframework.boot' version '2.6.0'
7 id 'io.spring.dependency-management' version '1.0.11.RELEASE'
8 id 'java'
9}
10
11group = 'com.example'
12version = '0.0.1-SNAPSHOT'
13sourceCompatibility = '11'
14
15repositories {
16 mavenCentral()
17}
18
19dependencies {
20 compile("org.springframework.boot:spring-boot-starter-web") {
21 exclude module: "spring-boot-starter-tomcat"
22 }
23 compile("org.springframework.boot:spring-boot-starter-jetty")
24 implementation 'org.springframework.boot:spring-boot-starter-webflux'
25 testImplementation 'org.springframework.boot:spring-boot-starter-test'
26 testImplementation 'io.projectreactor:reactor-test'
27 implementation "io.springfox:springfox-boot-starter:3.0.0"
28}
29
30test {
31 useJUnitPlatform()
32}
33
34 gradle clean bootrun
35
36> Task :bootRun FAILED
37
38 . ____ _ __ _ _
39 /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
40( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
41 \\/ ___)| |_)| | | | | || (_| | ) ) ) )
42 ' |____| .__|_| |_|_| |_\__, | / / / /
43 =========|_|==============|___/=/_/_/_/
44 :: Spring Boot :: (v2.6.0)
45
462021-11-19 09:41:06.665 INFO 16666 --- [ main] c.e.springfox.SpringFoxApplication : Starting SpringFoxApplication using Java 15.0.2 on advance-Inspiron-5379 with PID 16666 (/home/advance/projects/spring-fox/build/classes/java/main started by advance in /home/advance/projects/spring-fox)
472021-11-19 09:41:06.666 INFO 16666 --- [ main] c.e.springfox.SpringFoxApplication : No active profile set, falling back to default profiles: default
482021-11-19 09:41:07.294 INFO 16666 --- [ main] org.eclipse.jetty.util.log : Logging initialized @1132ms to org.eclipse.jetty.util.log.Slf4jLog
492021-11-19 09:41:07.396 INFO 16666 --- [ main] o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port: 8080
502021-11-19 09:41:07.398 INFO 16666 --- [ main] org.eclipse.jetty.server.Server : jetty-9.4.44.v20210927; built: 2021-09-27T23:02:44.612Z; git: 8da83308eeca865e495e53ef315a249d63ba9332; jvm 15.0.2+7-27
512021-11-19 09:41:07.417 INFO 16666 --- [ main] o.e.j.s.h.ContextHandler.application : Initializing Spring embedded WebApplicationContext
522021-11-19 09:41:07.417 INFO 16666 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 713 ms
532021-11-19 09:41:07.474 INFO 16666 --- [ main] org.eclipse.jetty.server.session : DefaultSessionIdManager workerName=node0
542021-11-19 09:41:07.474 INFO 16666 --- [ main] org.eclipse.jetty.server.session : No SessionScavenger set, using defaults
552021-11-19 09:41:07.475 INFO 16666 --- [ main] org.eclipse.jetty.server.session : node0 Scavenging every 660000ms
562021-11-19 09:41:07.480 INFO 16666 --- [ main] o.e.jetty.server.handler.ContextHandler : Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@6aa3bfc{application,/,[file:///tmp/jetty-docbase.8080.2024342829220941812/, jar:file:/home/advance/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-swagger-ui/3.0.0/1e665fbe22148f7c36fa8a08e515a0047cd4390b/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],AVAILABLE}
572021-11-19 09:41:07.480 INFO 16666 --- [ main] org.eclipse.jetty.server.Server : Started @1318ms
582021-11-19 09:41:07.920 INFO 16666 --- [ main] o.e.j.s.h.ContextHandler.application : Initializing Spring DispatcherServlet 'dispatcherServlet'
592021-11-19 09:41:07.920 INFO 16666 --- [ main] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
602021-11-19 09:41:07.921 INFO 16666 --- [ main] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
612021-11-19 09:41:07.931 INFO 16666 --- [ main] o.e.jetty.server.AbstractConnector : Started ServerConnector@2643d762{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
622021-11-19 09:41:07.932 INFO 16666 --- [ main] o.s.b.web.embedded.jetty.JettyWebServer : Jetty started on port(s) 8080 (http/1.1) with context path '/'
632021-11-19 09:41:07.934 WARN 16666 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()" because "this.condition" is null
642021-11-19 09:41:07.949 INFO 16666 --- [ main] o.e.jetty.server.AbstractConnector : Stopped ServerConnector@2643d762{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
652021-11-19 09:41:07.950 INFO 16666 --- [ main] org.eclipse.jetty.server.session : node0 Stopped scavenging
662021-11-19 09:41:07.951 INFO 16666 --- [ main] o.e.j.s.h.ContextHandler.application : Destroying Spring FrameworkServlet 'dispatcherServlet'
672021-11-19 09:41:07.951 INFO 16666 --- [ main] o.e.jetty.server.handler.ContextHandler : Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext@6aa3bfc{application,/,[file:///tmp/jetty-docbase.8080.2024342829220941812/, jar:file:/home/advance/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-swagger-ui/3.0.0/1e665fbe22148f7c36fa8a08e515a0047cd4390b/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],STOPPED}
682021-11-19 09:41:07.958 INFO 16666 --- [ main] ConditionEvaluationReportLoggingListener :
69
70Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
712021-11-19 09:41:07.970 ERROR 16666 --- [ main] o.s.boot.SpringApplication : Application run failed
72
73org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()" because "this.condition" is null
74 at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.3.13.jar:5.3.13]
75 at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.13.jar:5.3.13]
76 at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.13.jar:5.3.13]
77 at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
78 at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.13.jar:5.3.13]
79 at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.13.jar:5.3.13]
80 at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935) ~[spring-context-5.3.13.jar:5.3.13]
81 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.13.jar:5.3.13]
82 at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.0.jar:2.6.0]
83 at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-2.6.0.jar:2.6.0]
84 at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) ~[spring-boot-2.6.0.jar:2.6.0]
85 at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) ~[spring-boot-2.6.0.jar:2.6.0]
86 at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.0.jar:2.6.0]
87 at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) ~[spring-boot-2.6.0.jar:2.6.0]
88 at com.example.springfox.SpringFoxApplication.main(SpringFoxApplication.java:10) ~[main/:na]
89Caused by: java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()" because "this.condition" is null
90 at springfox.documentation.spring.web.WebMvcPatternsRequestConditionWrapper.getPatterns(WebMvcPatternsRequestConditionWrapper.java:56) ~[springfox-spring-webmvc-3.0.0.jar:3.0.0]
91 at springfox.documentation.RequestHandler.sortedPaths(RequestHandler.java:113) ~[springfox-core-3.0.0.jar:3.0.0]
92 at springfox.documentation.spi.service.contexts.Orderings.lambda$byPatternsCondition$3(Orderings.java:89) ~[springfox-spi-3.0.0.jar:3.0.0]
93 at java.base/java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:469) ~[na:na]
94 at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) ~[na:na]
95 at java.base/java.util.TimSort.sort(TimSort.java:220) ~[na:na]
96 at java.base/java.util.Arrays.sort(Arrays.java:1306) ~[na:na]
97 at java.base/java.util.ArrayList.sort(ArrayList.java:1721) ~[na:na]
98 at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:392) ~[na:na]
99 at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) ~[na:na]
100 at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) ~[na:na]
101 at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) ~[na:na]
102 at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258) ~[na:na]
103 at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) ~[na:na]
104 at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
105 at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na]
106 at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
107 at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na]
108 at springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider.requestHandlers(WebMvcRequestHandlerProvider.java:81) ~[springfox-spring-webmvc-3.0.0.jar:3.0.0]
109 at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na]
110 at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[na:na]
111 at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
112 at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
113 at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na]
114 at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
115 at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na]
116 at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.withDefaults(AbstractDocumentationPluginsBootstrapper.java:107) ~[springfox-spring-web-3.0.0.jar:3.0.0]
117 at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.buildContext(AbstractDocumentationPluginsBootstrapper.java:91) ~[springfox-spring-web-3.0.0.jar:3.0.0]
118 at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.bootstrapDocumentationPlugins(AbstractDocumentationPluginsBootstrapper.java:82) ~[springfox-spring-web-3.0.0.jar:3.0.0]
119 at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:100) ~[springfox-spring-web-3.0.0.jar:3.0.0]
120 at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178) ~[spring-context-5.3.13.jar:5.3.13]
121 ... 14 common frames omitted
122
123
124FAILURE: Build failed with an exception.
125
126* What went wrong:
127Execution failed for task ':bootRun'.
128> Process 'command '/home/advance/.sdkman/candidates/java/15.0.2-open/bin/java'' finished with non-zero exit value 1
129
130* Try:
131Run 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.
132
133* Get more help at https://help.gradle.org
134
135Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
136Use '--warning-mode all' to show the individual deprecation warnings.
137See https://docs.gradle.org/6.9.1/userguide/command_line_interface.html#sec:command_line_warnings
138
139BUILD FAILED in 2s
1405 actionable tasks: 5 executed
141
Does anyone have an idea how to solve it?
ANSWER
Answered 2022-Feb-08 at 12:36This problem's caused by a bug in Springfox. It's making an assumption about how Spring MVC is set up that doesn't always hold true. Specifically, it's assuming that MVC's path matching will use the Ant-based path matcher and not the PathPattern-based matcher. PathPattern-based matching has been an option for some time now and is the default as of Spring Boot 2.6.
As described in Spring Boot 2.6's release notes, you can restore the configuration that Springfox assumes will be used by setting spring.mvc.pathmatch.matching-strategy
to ant-path-matcher
in your application.properties
file. Note that this will only work if you are not using Spring Boot's Actuator. The Actuator always uses PathPattern-based parsing, irrespective of the configured matching-strategy
. A change to Springfox will be required if you want to use it with the Actuator in Spring Boot 2.6 and later.
QUESTION
Message "error: resource android:attr/lStar not found"
Asked 2022-Mar-23 at 14:37A Flutter Android app I developed suddenly compiled wrong today.
Error:
What went wrong:Execution failed for task ':app:processDebugResources'.
Android resource linking failed /Users/xxx/.gradle/caches/transforms-2/files-2.1/5d04bb4852dc27334fe36f129faf6500/res/values/values.xml:115:5-162:25: AAPT: error: resource android:attr/lStar not found.
error: failed linking references.
I triedRun with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.orgThe build failed in 16 seconds.
ANSWER
Answered 2021-Sep-02 at 19:05Are you using the @react-native-community/netinfo library? You need to refresh this library if you are using it.
After updating or uninstalling and reinstalling the netinfo library it will work.
QUESTION
Plugin [id: 'dagger.hilt.android.plugin'] was not found in any of the following sources
Asked 2022-Mar-22 at 16:46I get the following warning when I want to use @AndroidEntryPoint which is a property of hilt in my project.
1 Expected @AndroidEntryPoint to have a value. Did you forget to apply the Gradle Plugin? (dagger.hilt.android.plugin)
2
When I try to add id 'dagger.hilt.android.plugin' to the module level build.gradle file of my project, I get the following error.
1 Expected @AndroidEntryPoint to have a value. Did you forget to apply the Gradle Plugin? (dagger.hilt.android.plugin)
2org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'dagger.hilt.android.plugin'] was not found in any of the following sources:
3
I tried to add it to the build.gradle file at the Module level of the project as follows. They all give an error.
I tried to add it as a classpath to the project level build.gradle file, in this case I still get an error.
When I created the default project, a settings.gradle structure was created as follows. This is my first time using this build. My version of Android Studio Android Studio - Bumblebee | 2021.1.1 Canary 13
ANSWER
Answered 2021-Oct-10 at 08:39For adding dagger hilt
to your project. Follow these steps
Add hilt
dependencies to your module's build.gradle
. I assume you are using Kotlin
, otherwise you have to use annotationProcessor
insted of kapt
plugin.
1 Expected @AndroidEntryPoint to have a value. Did you forget to apply the Gradle Plugin? (dagger.hilt.android.plugin)
2org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'dagger.hilt.android.plugin'] was not found in any of the following sources:
3dependencies {
4 //..
5 implementation 'com.google.dagger:hilt-android:2.39.1'
6 kapt 'com.google.dagger:hilt-compiler:2.39.1'
7 //..
8 }
9
Add hilt gradle plugin
to project's build.gradle
.
1 Expected @AndroidEntryPoint to have a value. Did you forget to apply the Gradle Plugin? (dagger.hilt.android.plugin)
2org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'dagger.hilt.android.plugin'] was not found in any of the following sources:
3dependencies {
4 //..
5 implementation 'com.google.dagger:hilt-android:2.39.1'
6 kapt 'com.google.dagger:hilt-compiler:2.39.1'
7 //..
8 }
9dependencies {
10 //..
11 classpath 'com.google.dagger:hilt-android-gradle-plugin:2.39.1'
12 }
13
Apply kotlin-kapt
and hilt
plugins to module build.gradle
1 Expected @AndroidEntryPoint to have a value. Did you forget to apply the Gradle Plugin? (dagger.hilt.android.plugin)
2org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'dagger.hilt.android.plugin'] was not found in any of the following sources:
3dependencies {
4 //..
5 implementation 'com.google.dagger:hilt-android:2.39.1'
6 kapt 'com.google.dagger:hilt-compiler:2.39.1'
7 //..
8 }
9dependencies {
10 //..
11 classpath 'com.google.dagger:hilt-android-gradle-plugin:2.39.1'
12 }
13plugins {
14 id 'kotlin-kapt'
15 id 'dagger.hilt.android.plugin'
16}
17
QUESTION
Your project requires a newer version of the Kotlin Gradle plugin. (Android Studio)
Asked 2022-Mar-17 at 15:50I've just updated my flutter project packages to be null-safety compliant and now Android Studio wants me to update my project to use the latest version of Kotling Gradle Plugin. Can't see where to change this though. I have tried to change "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
into "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10"
but this has no effect.
My build.grade
-file looks like this:
1def localProperties = new Properties()
2def localPropertiesFile = rootProject.file('local.properties')
3if (localPropertiesFile.exists()) {
4 localPropertiesFile.withReader('UTF-8') { reader ->
5 localProperties.load(reader)
6 }
7}
8
9def flutterRoot = localProperties.getProperty('flutter.sdk')
10if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12}
13
14def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15if (flutterVersionCode == null) {
16 flutterVersionCode = '1'
17}
18
19def flutterVersionName = localProperties.getProperty('flutter.versionName')
20if (flutterVersionName == null) {
21 flutterVersionName = '1.0'
22}
23
24apply plugin: 'com.android.application'
25apply plugin: 'kotlin-android'
26apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27
28def keystoreProperties = new Properties()
29def keystorePropertiesFile = rootProject.file('key.properties')
30if (keystorePropertiesFile.exists()) {
31 keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32}
33
34android {
35 compileSdkVersion 31
36
37 sourceSets {
38 main.java.srcDirs += 'src/main/kotlin'
39 }
40
41 lintOptions {
42 disable 'InvalidPackage'
43 }
44
45 defaultConfig {
46 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 applicationId "*********"
48 minSdkVersion 30
49 targetSdkVersion 30
50 versionCode flutterVersionCode.toInteger()
51 versionName flutterVersionName
52 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
53 }
54
55
56
57 signingConfigs {
58 release {
59 keyAlias keystoreProperties['keyAlias']
60 keyPassword keystoreProperties['keyPassword']
61 storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
62 storePassword keystoreProperties['storePassword']
63 }
64 }
65 buildTypes {
66 release {
67 signingConfig signingConfigs.release
68 }
69 }
70
71}
72
73flutter {
74 source '../..'
75}
76
77dependencies {
78 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
79 testImplementation 'junit:junit:4.12'
80 androidTestImplementation 'androidx.test:runner:1.1.1'
81 androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
82 implementation 'com.google.firebase:firebase-analytics:17.2.2'
83}
84apply plugin: 'com.google.gms.google-services'
85
Build output:
1def localProperties = new Properties()
2def localPropertiesFile = rootProject.file('local.properties')
3if (localPropertiesFile.exists()) {
4 localPropertiesFile.withReader('UTF-8') { reader ->
5 localProperties.load(reader)
6 }
7}
8
9def flutterRoot = localProperties.getProperty('flutter.sdk')
10if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12}
13
14def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15if (flutterVersionCode == null) {
16 flutterVersionCode = '1'
17}
18
19def flutterVersionName = localProperties.getProperty('flutter.versionName')
20if (flutterVersionName == null) {
21 flutterVersionName = '1.0'
22}
23
24apply plugin: 'com.android.application'
25apply plugin: 'kotlin-android'
26apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27
28def keystoreProperties = new Properties()
29def keystorePropertiesFile = rootProject.file('key.properties')
30if (keystorePropertiesFile.exists()) {
31 keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32}
33
34android {
35 compileSdkVersion 31
36
37 sourceSets {
38 main.java.srcDirs += 'src/main/kotlin'
39 }
40
41 lintOptions {
42 disable 'InvalidPackage'
43 }
44
45 defaultConfig {
46 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 applicationId "*********"
48 minSdkVersion 30
49 targetSdkVersion 30
50 versionCode flutterVersionCode.toInteger()
51 versionName flutterVersionName
52 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
53 }
54
55
56
57 signingConfigs {
58 release {
59 keyAlias keystoreProperties['keyAlias']
60 keyPassword keystoreProperties['keyPassword']
61 storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
62 storePassword keystoreProperties['storePassword']
63 }
64 }
65 buildTypes {
66 release {
67 signingConfig signingConfigs.release
68 }
69 }
70
71}
72
73flutter {
74 source '../..'
75}
76
77dependencies {
78 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
79 testImplementation 'junit:junit:4.12'
80 androidTestImplementation 'androidx.test:runner:1.1.1'
81 androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
82 implementation 'com.google.firebase:firebase-analytics:17.2.2'
83}
84apply plugin: 'com.google.gms.google-services'
85BUILD FAILED in 8s
86[!] Your project requires a newer version of the Kotlin Gradle plugin.
87 Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update project/android/build.gradle:
88 ext.kotlin_version = '<latest-version>'
89Exception: Gradle task assembleDebug failed with exit code 1
90
ANSWER
Answered 2022-Jan-30 at 21:52change build gradle to this :
1def localProperties = new Properties()
2def localPropertiesFile = rootProject.file('local.properties')
3if (localPropertiesFile.exists()) {
4 localPropertiesFile.withReader('UTF-8') { reader ->
5 localProperties.load(reader)
6 }
7}
8
9def flutterRoot = localProperties.getProperty('flutter.sdk')
10if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12}
13
14def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15if (flutterVersionCode == null) {
16 flutterVersionCode = '1'
17}
18
19def flutterVersionName = localProperties.getProperty('flutter.versionName')
20if (flutterVersionName == null) {
21 flutterVersionName = '1.0'
22}
23
24apply plugin: 'com.android.application'
25apply plugin: 'kotlin-android'
26apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27
28def keystoreProperties = new Properties()
29def keystorePropertiesFile = rootProject.file('key.properties')
30if (keystorePropertiesFile.exists()) {
31 keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32}
33
34android {
35 compileSdkVersion 31
36
37 sourceSets {
38 main.java.srcDirs += 'src/main/kotlin'
39 }
40
41 lintOptions {
42 disable 'InvalidPackage'
43 }
44
45 defaultConfig {
46 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 applicationId "*********"
48 minSdkVersion 30
49 targetSdkVersion 30
50 versionCode flutterVersionCode.toInteger()
51 versionName flutterVersionName
52 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
53 }
54
55
56
57 signingConfigs {
58 release {
59 keyAlias keystoreProperties['keyAlias']
60 keyPassword keystoreProperties['keyPassword']
61 storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
62 storePassword keystoreProperties['storePassword']
63 }
64 }
65 buildTypes {
66 release {
67 signingConfig signingConfigs.release
68 }
69 }
70
71}
72
73flutter {
74 source '../..'
75}
76
77dependencies {
78 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
79 testImplementation 'junit:junit:4.12'
80 androidTestImplementation 'androidx.test:runner:1.1.1'
81 androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
82 implementation 'com.google.firebase:firebase-analytics:17.2.2'
83}
84apply plugin: 'com.google.gms.google-services'
85BUILD FAILED in 8s
86[!] Your project requires a newer version of the Kotlin Gradle plugin.
87 Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update project/android/build.gradle:
88 ext.kotlin_version = '<latest-version>'
89Exception: Gradle task assembleDebug failed with exit code 1
90classpath 'com.android.tools.build:gradle:4.1.0'
91
and gradle-wrapper to this :
1def localProperties = new Properties()
2def localPropertiesFile = rootProject.file('local.properties')
3if (localPropertiesFile.exists()) {
4 localPropertiesFile.withReader('UTF-8') { reader ->
5 localProperties.load(reader)
6 }
7}
8
9def flutterRoot = localProperties.getProperty('flutter.sdk')
10if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12}
13
14def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15if (flutterVersionCode == null) {
16 flutterVersionCode = '1'
17}
18
19def flutterVersionName = localProperties.getProperty('flutter.versionName')
20if (flutterVersionName == null) {
21 flutterVersionName = '1.0'
22}
23
24apply plugin: 'com.android.application'
25apply plugin: 'kotlin-android'
26apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27
28def keystoreProperties = new Properties()
29def keystorePropertiesFile = rootProject.file('key.properties')
30if (keystorePropertiesFile.exists()) {
31 keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32}
33
34android {
35 compileSdkVersion 31
36
37 sourceSets {
38 main.java.srcDirs += 'src/main/kotlin'
39 }
40
41 lintOptions {
42 disable 'InvalidPackage'
43 }
44
45 defaultConfig {
46 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 applicationId "*********"
48 minSdkVersion 30
49 targetSdkVersion 30
50 versionCode flutterVersionCode.toInteger()
51 versionName flutterVersionName
52 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
53 }
54
55
56
57 signingConfigs {
58 release {
59 keyAlias keystoreProperties['keyAlias']
60 keyPassword keystoreProperties['keyPassword']
61 storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
62 storePassword keystoreProperties['storePassword']
63 }
64 }
65 buildTypes {
66 release {
67 signingConfig signingConfigs.release
68 }
69 }
70
71}
72
73flutter {
74 source '../..'
75}
76
77dependencies {
78 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
79 testImplementation 'junit:junit:4.12'
80 androidTestImplementation 'androidx.test:runner:1.1.1'
81 androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
82 implementation 'com.google.firebase:firebase-analytics:17.2.2'
83}
84apply plugin: 'com.google.gms.google-services'
85BUILD FAILED in 8s
86[!] Your project requires a newer version of the Kotlin Gradle plugin.
87 Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update project/android/build.gradle:
88 ext.kotlin_version = '<latest-version>'
89Exception: Gradle task assembleDebug failed with exit code 1
90classpath 'com.android.tools.build:gradle:4.1.0'
91distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
92
QUESTION
IntelliJ - Invalid source release: 17
Asked 2022-Mar-17 at 13:46I've created a new Java project in IntelliJ with Gradle that uses Java 17. When running my app it has the error Cause: error: invalid source release: 17
.
My Settings
I've installed openjdk-17
through IntelliJ
and set it as my Project SDK
.
The Project language level
has been set to 17 - Sealed types, always-strict floating-point semantics
.
In Modules -> Sources
I've set the Language level
to Project default (17 - Sealed types, always strict floating-point semantics)
.
In Modules -> Dependencies
I've set the Module SDK
to Project SDK openjdk-17
.
In Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler
I've set the Project bytecode version
to 17
.
Gradle
1plugins {
2 id 'org.springframework.boot' version '2.5.6'
3 id 'io.spring.dependency-management' version '1.0.11.RELEASE'
4 id 'java'
5}
6
7group = 'com.app'
8version = '0.0.1-SNAPSHOT'
9sourceCompatibility = '17'
10
11repositories {
12 mavenCentral()
13}
14
15dependencies {
16 implementation 'org.springframework.boot:spring-boot-starter-web'
17 implementation 'org.springframework.boot:spring-boot-starter-websocket'
18 testImplementation 'org.springframework.boot:spring-boot-starter-test'
19 implementation 'com.fasterxml.jackson.core:jackson-core:2.13.0'
20 implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0'
21}
22
23test {
24 useJUnitPlatform()
25}
26
I've looked at all of the answers here but I can't seem to fix this. I must be missing something but I can't find it. I've not had any problems using Java 8 or 11.
How do I resolve this?
ANSWER
Answered 2021-Oct-24 at 14:23The message typically entails that your JAVA_HOME environment variable points to a different Java version.
Here are the steps to follow:
- Close IntelliJ IDEA
- Open a terminal window and check your JAVA_HOME variable value:
- *nix system:
echo $JAVA_HOME
- Windows system:
echo %JAVA_HOME%
- *nix system:
- The JAVA_HOME path should be pointing to a different path, then set it to the openjdk-17 path:
- *nix system:
export JAVA_HOME=/path/to/openjdk-17
- Windows system:
set JAVA_HOME=path\to\openjdk-17
- *nix system:
- Open your project again in IntelliJ IDEA
- Make sure to set both source and target compatibility versions (not only the
sourceCompatibility
)
You should be able to build your project.
EDIT: Gradle ToolchainYou may need also to instruct Gradle to use a different JVM than the one it uses itself by setting the Java plugin toolchain to your target version:
1plugins {
2 id 'org.springframework.boot' version '2.5.6'
3 id 'io.spring.dependency-management' version '1.0.11.RELEASE'
4 id 'java'
5}
6
7group = 'com.app'
8version = '0.0.1-SNAPSHOT'
9sourceCompatibility = '17'
10
11repositories {
12 mavenCentral()
13}
14
15dependencies {
16 implementation 'org.springframework.boot:spring-boot-starter-web'
17 implementation 'org.springframework.boot:spring-boot-starter-websocket'
18 testImplementation 'org.springframework.boot:spring-boot-starter-test'
19 implementation 'com.fasterxml.jackson.core:jackson-core:2.13.0'
20 implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0'
21}
22
23test {
24 useJUnitPlatform()
25}
26// build.gradle
27java {
28 toolchain {
29 languageVersion = JavaLanguageVersion.of(17)
30 }
31}
32
Community Discussions contain sources that include Stack Exchange Network
Tutorials and Learning Resources in Gradle
Tutorials and Learning Resources are not available at this moment for Gradle