Class org gradle internal compiler java classnamecollector

Скучный бложик тестировщика

Об Android, о тестировании, мысли, рекомендации, инструкции.

9 июля 2021 г.

Проект не собирается гредлом

После очередного обновления системы (pacman -Suy в данном случае) у меня перестал собираться проект из командной строки:

➜ clicker git:(master) ✗ ./gradlew assembleAndroidTest assembleDebug
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use —status for details
> Task :app:processDebugMainManifest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ‘:app:processDebugMainManifest’.
> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not «opens java.io» to unnamed module @101d84f6

Запуск с флагом печати стектрейса сказал следующее:

Caused by: java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x1cb57a7a) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x1cb57a7a

При этом сборка проекта средствами самой Android Studio не сломалась. Всё дело в том, что при запуске из командной строки гредл использует общесистемную джаву, а Студия ту, которая прописана у неё в настройках. То есть всё, что требуется — сказать Гредлу для этого проекта использоать ту же версию, что и Студия.

Читайте также:  Python pivot table пример

Открываем gradle.properties проекта и вставляем то значение, которое у Студии для параметра org.gradle.java.home. У меня это выглядит так:

org.gradle.java.home=/opt/android-studio/jre

Всё, проблема решена: BUILD SUCCESSFUL in 27s

Разумеется, можно использовать переменную окружения JAVA_HOME и gradle её считывает. Но так вот получилось, что у меня в этой переменной Java 16, потому что причины. И как раз из-за этого не работала сборка проекта.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle 7.0 has problems with annotation processors and java 16 #16641

Gradle 7.0 has problems with annotation processors and java 16 #16641

Comments

When building a Micronaut application with Gradle 7.0 it fails with java.lang.IllegalAccessError

Expected Behavior

Current Behavior

Execution failed for task ':compileJava'. > java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x77b92754) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x77b92754 

Steps to Reproduce

Your Environment

The text was updated successfully, but these errors were encountered:

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run example app on Mac #5452

Cannot run example app on Mac #5452

Comments

Steps to Reproduce

I am trying to execute example app in IntelliJ IDEA with Flutter plugin on Android Emulator. I get Following error:

Launching lib/main.dart on Android SDK built for x86 in debug mode. Running Gradle task 'assembleDebug'. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x54c67b91) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x54c67b91 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 6s Exception: Gradle task assembleDebug failed with exit code 1 

When I run this assembleDebug with IntelliJ to see what is the problem, it looks ok:

Executing task 'assembleDebug'. > Task :app:compileFlutterBuildDebug UP-TO-DATE > Task :app:packLibsflutterBuildDebug UP-TO-DATE > Task :app:preBuild UP-TO-DATE > Task :app:preDebugBuild UP-TO-DATE > Task :app:compileDebugAidl NO-SOURCE > Task :app:compileDebugRenderscript NO-SOURCE > Task :app:generateDebugBuildConfig UP-TO-DATE > Task :app:checkDebugAarMetadata UP-TO-DATE > Task :app:cleanMergeDebugAssets > Task :app:mergeDebugShaders UP-TO-DATE > Task :app:compileDebugShaders NO-SOURCE > Task :app:generateDebugAssets UP-TO-DATE > Task :app:mergeDebugAssets > Task :app:copyFlutterAssetsDebug > Task :app:generateDebugResValues UP-TO-DATE > Task :app:generateDebugResources UP-TO-DATE > Task :app:mergeDebugResources UP-TO-DATE > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE > Task :app:extractDeepLinksDebug UP-TO-DATE > Task :app:processDebugMainManifest UP-TO-DATE > Task :app:processDebugManifest UP-TO-DATE > Task :app:processDebugManifestForPackage UP-TO-DATE > Task :app:processDebugResources UP-TO-DATE > Task :app:compileDebugKotlin UP-TO-DATE > Task :app:javaPreCompileDebug UP-TO-DATE > Task :app:compileDebugJavaWithJavac UP-TO-DATE > Task :app:compileDebugSources UP-TO-DATE > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE > Task :app:compressDebugAssets UP-TO-DATE > Task :app:processDebugJavaRes NO-SOURCE > Task :app:mergeDebugJavaResource UP-TO-DATE > Task :app:checkDebugDuplicateClasses UP-TO-DATE > Task :app:dexBuilderDebug UP-TO-DATE > Task :app:desugarDebugFileDependencies UP-TO-DATE > Task :app:mergeExtDexDebug UP-TO-DATE > Task :app:mergeDexDebug UP-TO-DATE > Task :app:mergeDebugJniLibFolders UP-TO-DATE > Task :app:mergeDebugNativeLibs UP-TO-DATE > Task :app:stripDebugDebugSymbols UP-TO-DATE > Task :app:validateSigningDebug UP-TO-DATE > Task :app:packageDebug UP-TO-DATE > Task :app:assembleDebug Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings BUILD SUCCESSFUL in 4s 32 actionable tasks: 4 executed, 28 up-to-date Task execution finished 'assembleDebug'. 

If I run the app from a terminal flutter run -d emulator-5554 I get following error:

Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering". Launching lib/main.dart on Android SDK built for x86 in debug mode. Exception in thread "main" java.io.FileNotFoundException: /wrapper/dists/gradle-6.7-all/cuy9mc7upwgwgeb72wkcrupxe/gradle-6.7-all.zip.lck (No such file or directory) at java.base/java.io.RandomAccessFile.open0(Native Method) at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:347) at java.base/java.io.RandomAccessFile.(RandomAccessFile.java:261) at java.base/java.io.RandomAccessFile.(RandomAccessFile.java:216) at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:49) at org.gradle.wrapper.Install.createDist(Install.java:48) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) Running Gradle task 'assembleDebug'. Running Gradle task 'assembleDebug'. Done 948ms [!] Gradle threw an error while downloading artifacts from the network. Retrying to download. Exception in thread "main" java.io.FileNotFoundException: /wrapper/dists/gradle-6.7-all/cuy9mc7upwgwgeb72wkcrupxe/gradle-6.7-all.zip.lck (No such file or directory) at java.base/java.io.RandomAccessFile.open0(Native Method) at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:347) at java.base/java.io.RandomAccessFile.(RandomAccessFile.java:261) at java.base/java.io.RandomAccessFile.(RandomAccessFile.java:216) at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:49) at org.gradle.wrapper.Install.createDist(Install.java:48) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) Running Gradle task 'assembleDebug'. Running Gradle task 'assembleDebug'. Done 921ms [!] Gradle threw an error while downloading artifacts from the network. Retrying to download. Exception: Gradle task assembleDebug failed with exit code 1 

Version info

Please paste the output of running flutter doctor -v here (available from the command
line or from Tools > Flutter > Flutter Doctor ). It will provide the version of the
Flutter framework as well as of the IntelliJ plugin.

[✓] Flutter (Channel stable, 2.0.5, on Mac OS X 10.15.7 19H524 darwin-x64, locale en-PL) • Flutter version 2.0.5 at /Users/pawel_labaj/Library/flutter • Framework revision adc687823a (13 days ago), 2021-04-16 09:40:20 -0700 • Engine revision b09f014e96 • Dart version 2.12.3 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/pawel_labaj/Library/Android/sdk • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = /Users/pawel_labaj/Library/Android/sdk • Java binary at: /Library/Java/JavaVirtualMachines/jdk-15.0.1.jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 15.0.1+9-18) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.1.1, Build version 12A7605b • CocoaPods version 1.10.1 [!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions). [✓] IntelliJ IDEA Ultimate Edition (version 2021.1) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin version 55.1.5 • Dart plugin version 211.7233 [✓] Connected device (2 available) • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.7 19H524 darwin-x64 

The text was updated successfully, but these errors were encountered:

Источник

Оцените статью