Skip to content
New issue

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

Github action / workflow failed because of Android local path #99

Open
vsay01 opened this issue Mar 10, 2021 · 5 comments
Open

Github action / workflow failed because of Android local path #99

vsay01 opened this issue Mar 10, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@vsay01
Copy link

vsay01 commented Mar 10, 2021

Hi,

I am creating an Android plugin that generate android related file. My repository was generated from this and it contains github workflows.

After I added android codes template, it complains about unresolved reference, so I added path to Android Studio Content.

In my gradle.properties file, I added

StudioCompilePath = /Applications/Android Studio.app/Contents

StudioRunPath=/Applications/Android Studio.app/Contents

Then in my build.gradle.kts file inside intellij, I called:

intellij.localPath = if (project.hasProperty("StudioRunPath")) properties("StudioRunPath") else properties("StudioRunPath")

When I Run ./gradlew check locally, it works fine. But it failed when it run on Github action with following error related to the path.


Welcome to Gradle 6.8.3!

Here are the highlights of this release:
 - Faster Kotlin DSL script compilation
 - Vendor selection for Java toolchains
 - Convenient execution of tasks in composite builds
 - Consistent dependency resolution

For more details see https://docs.gradle.org/6.8.3/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
[gradle-intellij-plugin :MVP Setup] Both `localPath` and `version` specified, second would be ignored

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':test'.
> Could not resolve all dependencies for configuration ':testRuntimeClasspath'.
   > Specified localPath '/Applications/Android Studio.app/Contents' doesn't exist or is not a directory

* 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 1m 2s
Error: Process completed with exit code 1.

Do I expect to add local path if I added android related codes or is there any other way to resolve this without using the local path?

@hsz
Copy link
Member

hsz commented Mar 29, 2021

@vsay01 Looking at your intellij.localPath = if ... code – both condition branches result with the same value: properties("StudioRunPath").

@vsay01
Copy link
Author

vsay01 commented Mar 31, 2021

I think that condition can be removed, and just assign properties("StudioRunPath") to intellij.localPath.

The thing is that since this is plugin for Android Studio, if I don't give studio run path to local path, it will complain about android references not resolved such as Activity, Context, ... etc.

If I give the path intellij.localPath = properties("StudioRunPath"), the plugin in generated fine. but github action failed because the path is not found.

Any suggestion to get github action for this template resolved while maintain android path?

@hsz
Copy link
Member

hsz commented Apr 6, 2021

Sorry for the delay, Vortana.
Ok, I got your point.

To provide AS for GitHub Actions, you can introduce an additional workflow step before building/testing the plugging that will download AS to the specific directory within the GHA container and provide that path as intellij.localPath.

@vsay01
Copy link
Author

vsay01 commented Apr 7, 2021

Thanks for the response @hsz .

Do you know any resources / documentations on how I can add Android Studio to the GitHub container?

@hsz hsz self-assigned this Jun 7, 2021
@hsz hsz added the enhancement New feature or request label Jun 7, 2021
@hsz hsz added this to the 1.0 milestone Jul 5, 2021
@hsz hsz removed this from the 1.0.0 milestone Oct 14, 2021
@ChrisCarini
Copy link

@vsay01 - I'm the author of ChrisCarini/intellij-platform-plugin-verifier-action GitHub Action which downloads various IDEs and runs the JetBrains/intellij-plugin-verifier against them. The GitHub action is a single-file bash script - if you'd like, you should be able to reverse-engineer it to figure out how to download AS in your CI executions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants