-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
Add support for ANDROID_HOME environment variable #463
Comments
Hi @ProgrammAbel i got the same error once, you have to accept the license on android sdkmanager(not on project run), once you done that, you're error will be clear now. |
Thanks for the report. The licenses are accepted on a per-computer basis, so the interaction with multiple projects is coincidental. I assume one of two things happened:
The license check at present is very simplistic - it looks for the existence of If you're still seeing this error, I'd be interested in knowing what license files (if any) currently exist in that folder (and, if there is an |
Thank you for taking the time to help me 😀 So, I've discovered a few things. I figured out that licenses are stored in I believe this error stems from the fact that I've done other Android development on this computer in the past, and the SDK folder was |
If you've got ANDROID_SDK_ROOT defined in your environment, it will use that version in preference to anything Briefcase managed. That shouldn't impact the commands that are executed; just the location of the SDK manager and ADB instance that it tries to use. I can't think of any way that would conflict with license management, but I guess anything is possible... |
|
I don't know how to put this politely... but... are you absolutely certain that your environment doesn't contain If you insist that there isn't an |
Thats... definitely interesting. Definitely looks like there's no stray Android variable. (A quick side note - while the animation is definitely pretty, a static dump of terminal content is a lot more practical from a diagnostic perspective). I guess debugging is our only choice at this point. To set a breakpoint, you edit the |
Ah, right, will do next time. Also I'll take a look and update this message if I've found anything. Out of curiosity, are you able to replicate this problem? Because I've tried to reproduce it on my MacBook but it seems to build fine. |
No, I haven't been able to reproduce at all - and the behavior you have described (and demonstrated) doesn't make any sense to me. Briefcase shouldn't be using a version in |
Hey @ProgrammAbel -- Android also respects One quick (?) way to show if you do/don't:
|
@paulproteus waitwat? It does? Well that is something that we need to fix, then... |
Confirmed using https://developer.android.com/studio/command-line/variables . That'll do it, I guess. I thought Adding support for |
Yep, that's definitely the culprit. It's set to |
Yes - this should be very approachable as a first contribution! I actually gave the details of the implementation required in my previous message; combine that with some tests, and you should be good to go! |
Going by the Wayback Machine history of this page, Google has gone back and forth on which variable they recommend. They currently recommend ANDROID_HOME, and say:
So Briefcase should do the following:
Also, ANDROID_HOME and JAVA_HOME should be added to the documentation, because they're not currently mentioned. @freakboy3742: Can you change the issue title to mention ANDROID_HOME, so it's easier to find? |
This has become more urgent now that we've upgraded to a newer Android Gradle plugin version, because as mentioned above, the new version "will check that the old and new variables are consistent". This means that people like me, who follow Google's advice and set an ANDROID_HOME variable in their shell, will now get the following error when running
|
Oh yeah...that's a good point; I ran in to the same thing trying to disable usage of GitHub's Android SDK in CI. Do you think we should just switch to only using |
For clarity, in my previous comment, ANDROID_HOME was only the variable I had in my shell environment. Briefcase currently ignores it, and adds ANDROID_SDK_ROOT pointing at its own SDK before running Gradle. Briefcase uses the SDK for other things than running Gradle (e.g. the emulator), so I think we should have our own consistency check. See this comment for suggested behavior. |
Add support to specify an Android SDK in `ANDROID_HOME` (fixes #463)
Describe the bug
After creating a project, building for Android and accepting the license, I had to delete it (because of #462). Then, when creating a new, clean project and building it for Android again, it did not prompt me to accept a license but instead gave me an error that the licenses weren't accepted.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
For the application to build successfully.
Screenshots
Environment:
The text was updated successfully, but these errors were encountered: