Setting up the project with Bazel #5643
Replies: 2 comments 18 replies
-
I successfully synced the Bazel project(in Android Studio: Ladybug), but I encountered the following issues:
To resolve this, I specified the path to the Android SDK in the
"Syntax highlighting has been temporarily turned off in file X because of an internal error." I attempted to resolve this by invalidating caches and repairing the IDE, but the issue persists.
Error Log
java.lang.NoSuchMethodError: 'void com.android.tools.idea.run.blaze.BlazeAndroidConfigurationExecutor.<init>(com.android.tools.idea.run.ConsoleProvider, com.android.tools.idea.run.ApplicationIdProvider, com.intellij.execution.runners.ExecutionEnvironment, com.android.tools.idea.run.DeviceFutures, com.android.tools.idea.run.blaze.BlazeLaunchTasksProvider, com.android.tools.idea.run.LaunchOptions, com.android.tools.idea.run.ApkProvider, com.android.tools.idea.editors.liveedit.LiveEditService)'
at com.google.idea.blaze.android.run.runner.BlazeAndroidRunConfigurationRunner.getRunProfileState(BlazeAndroidRunConfigurationRunner.java:184)
at com.google.idea.blaze.base.run.BlazeCommandRunConfiguration.getState(BlazeCommandRunConfiguration.java:553)
at com.intellij.execution.runners.ExecutionEnvironment.getState(ExecutionEnvironment.java:224)
at com.intellij.execution.runners.AsyncProgramRunner.execute(GenericProgramRunner.kt:51)
at com.intellij.execution.impl.ExecutionManagerImpl.executeConfiguration(ExecutionManagerImpl.kt:819)
at com.intellij.execution.impl.ExecutionManagerImpl$executeConfiguration$1$2.invoke(ExecutionManagerImpl.kt:752)
at com.intellij.execution.impl.ExecutionManagerImpl$executeConfiguration$1$2.invoke(ExecutionManagerImpl.kt:748)
at com.intellij.execution.impl.ExecutionManagerImpl.executeConfiguration$lambda$13$lambda$12(ExecutionManagerImpl.kt:748)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$safeTransferToEdt$7(NonBlockingReadActionImpl.java:717)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:229)
at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread$lambda$1(AnyThreadWriteThreadingSupport.kt:184)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread(AnyThreadWriteThreadingSupport.kt:183)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:836)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:424)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithImplicitRead(AnyThreadWriteThreadingSupport.kt:122)
at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1162)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:78)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:119)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:696)
at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$16(IdeEventQueue.kt:590)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithoutImplicitRead(AnyThreadWriteThreadingSupport.kt:117)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:590)
at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:73)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:357)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:356)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:356)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:351)
at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke$lambda$0(IdeEventQueue.kt:1035)
at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:910)
at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1036)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1036)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$10(IdeEventQueue.kt:351)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:397)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source) |
Beta Was this translation helpful? Give feedback.
-
facing this issue @adhiamboperes, as per installation guide I am using (Android Studio Bumblebee | 2021.1.1 Patch 3)
|
Beta Was this translation helpful? Give feedback.
-
Operating System
MacOs 15.2
Android Studio Version
JellyFish
RAM size
16GB
Free disk space
24GB
Which step are you stuck on?
This is a general log of the issues I encountered while setting up the project with the Bazel Plugin and how I fixed them.
Error Log
Approaches already used to resolve the issue
For
ERROR 1:
, I installed API 34 by selecting Android Studio > Settings > Language & Frameworks > Android SDK > Android API 34 > Apply > OkERROR 2:
was caused when I tried to use the deploy icon (green arrow) in Android Studio to deploy on an emulator running on API 34. For Bazel, this button triggers incremental builds(as opposed to building the apk from scratch). This is prohibited in API 34. I solved this by switching to an emulator using API 29.Additional information
Here is how I actually set up the project to work with Bazel on Android Studio.
Used a newer version of AS. I have Giraffe installed, but please feel free to update up to LadyBug(Yaay!).
On the welcome screen, I selected plugins and installed the Bazel for Android Studio plugin, and restarted AS.
On next open, I clicked the options button next to the new project/open project to find the "Import Bazel Project" option.
For Workspace, I clicked (...) to open file manager and selected
/opensource/oppia-android
as the location since this is where we have our project'sWORKSPACE
file.On next, to Select Project View, I selected the option to Generate from BUILD file, and selected (...) to open file manager again. In the same project root,
/opensource/oppia-android
, I scrolled down and selected the BUILD.bazel file.On pressing next, the below file was generated:

In the above file, under "targets: # If source code isn't resolving, add additional targets that compile it here" I added the following:
//:oppia
Beta Was this translation helpful? Give feedback.
All reactions