jfrog / jfrog-idea-plugin

JFrog IntelliJ IDEA plugin
https://jfrog.github.io/jfrog-idea-plugin/
Apache License 2.0
199 stars 34 forks source link

Plugin fails to load the data in multi-module android project #319

Open vipulasri opened 1 year ago

vipulasri commented 1 year ago

Describe the bug JFrog plugin fails to load the data in for all modules in multi-module android project

To Reproduce

  1. Open a multi-module android project
  2. Open JFrog plugin panel
  3. Observe it takes lot of time to scan, consumes a lot of memory and fails to load the data as well.

Expected behavior Plugin loads the data in a multi-module android project efficiently.

Screenshots

Screenshot 2023-03-14 at 4 31 08 PM

Versions JFrog IDEA plugin version: 2.1.1 Operating system: Mac OS 13.2.1 Android Studio version: Android Studio Electric Eel | 2022.1.1 Patch 1

Logcat [ERROR] Xray Scan failed: IOException: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':vacation:generateDepTrees'. > Java heap space * 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 4m 59s java.io.IOException: Couldn't build Gradle dependency tree in workspace '/Users/vasri/AndroidStudioProjects/twn-android-app/vacation': IOException: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':vacation:generateDepTrees'. > Java heap space * 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 4m 59s at com.jfrog.ide.common.gradle.GradleDriver.generateDependenciesGraphAsJson(GradleDriver.java:93) at com.jfrog.ide.common.gradle.GradleTreeBuilder.buildTree(GradleTreeBuilder.java:51) at com.jfrog.ide.idea.scan.GradleScanner.buildTree(GradleScanner.java:106) at com.jfrog.ide.idea.scan.ScannerBase.scanAndUpdate(ScannerBase.java:143) at com.jfrog.ide.idea.scan.ScannerBase$1.run(ScannerBase.java:251) at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442) at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:493) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.io.IOException: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':vacation:generateDepTrees'. > Java heap space * 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 4m 59s at com.jfrog.ide.common.gradle.GradleDriver.runCommand(GradleDriver.java:107) at com.jfrog.ide.common.gradle.GradleDriver.generateDependenciesGraphAsJson(GradleDriver.java:81) ... 24 more

asafgabai commented 1 year ago

@vipulasri Thank you for bringing this issue to our attention. It looks like the error occurs during the dependency tree-building process performed by the plugin. This process uses the gradle-dep-tree Gradle plugin, which is maintained by our team.

I'm currently working on refactoring this Gradle plugin and implementing some changes on the IntelliJ plugin side to address the issue. I'll keep you informed of any updates regarding the progress of these changes and when they are released.

asafgabai commented 1 year ago

@vipulasri The fix for the high memory consumption has been implemented and is now part of version 2.2.6. Please let us know if you encounter any further issues or have any additional feedback.

vipulasri commented 1 year ago

@asafgabai thanks for the update.

Unfortunately, I am unable to use the plugin now. It shows a message regarding unsupported JCEF runtime.

Screenshot 2023-07-04 at 11 13 11 AM

Versions: JFrog IDEA plugin version: 2.2.6 Operating system: Mac OS 13.4.1 Android Studio version: Android Studio Flamingo | 2022.2.1 Patch 2

Could this be because of latest Android Studio version?

asafgabai commented 1 year ago

@vipulasri The default boot runtime in Android Studio does not include JCEF, which is required for our plugin to function correctly. Please follow the instructions in the message to change it to a runtime that includes JCEF. Note that when installing a new version of Android Studio, the boot runtime may be reverted to one without JCEF, requiring you to change it again.

vipulasri commented 11 months ago

@asafgabai After explicitly using the JCEF runtime, the modules are getting stuck in the "Finalizing" state and not recovering from it, even after restarting the scanning multiple times.

asafgabai commented 11 months ago

@vipulasri I successfully reproduced the issue on projects with huge dependency trees, particularly Android projects. I'm actively investigating and will provide updates here as I make progress.

asafgabai commented 11 months ago

@vipulasri I opened a pull request for fixing this issue. I'll update here when it's merged and released.

asafgabai commented 11 months ago

@vipulasri The fix is released as part of version 2.6.3. Your feedback on it will be very appreciated.

vipulasri commented 11 months ago

@asafgabai Thank you for the update and support. I tried the newest version and it's properly working. It would be great if it's possible to optimise the plugin's scanning in terms of speed as a future improvement.