-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[8.0.0] Android environment variables: ANDROID_HOME vs ANDROID_SDK_ROOT - cosmetic display issue #670
Comments
PR #656, which was raised to resolve #617
Yes. The explanation is that cordova-android/bin/templates/cordova/lib/check_reqs.js Lines 225 to 230 in b4de6f5
I resolved #617 without changing how this part works in order to support non-deprecated Android SDK behavior without blocking the major release. The correct solution would be for |
Wouldn't this also mean that if something is actually broken with the env variables the error message to the user would be misleading when we mess with the variables? (Not sure if this can or does actually happen - just thinking out loud.) |
I think so. I hope someone will get a chance to fix it. |
This causes problems for me. The symptom is:
In the generated cordova.gradle, the It's very counter intuitive that a deprecated value would take precedence over the non-deprecated value. At the very least, the error message should be improved, as it will lead people down the path of uninstalling and reinstalling the build tools, which isn't the issue at all. Maybe:
|
https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html |
Please fix the issue |
Hi my old project would build successfully. Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable. Tho my ANDROID_HOME is set and my old project is building successfully i dont know how to get around with it can you help me? |
Definitely not in an unrelated, old issue. |
I have the same proble building with cordova, came out of no where |
I have the same problem..had anyone found a solution? |
Can someone clarify the actual problem? Is it that In my environments I have both |
I read this is just a display issue. They were working on it. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I hope I found a solution. And Its working for me. And declared environment variables. Gradle now -Download last version of Gradle (https://gradle.org/releases) -Create a folder and unzip files (I use C:\Program Files (x86)\gradle) -Copy the path with the bin directory included (C:\Program Files (x86)\gradle\bin) -Set the path C:\Program Files (x86)\gradle\bin (in my exemple) to "Path Environment Variables" Variable name "Path" and variable value "C:\Program Files (x86)\gradle\bin" for both: User Variable table and System Variables table You may need to reopen the "Prompt commad line" To test, type gradle in prompt. This procedure works fine. |
You are all posting in an issue that states that there is no problem, and that this is just a cosmetic problem without actual negative effects. So if you say "same issue", you are saying that you also see a cosmetic problem that doesn't require to be fixed. If you have an actual problem of something not working, do not post here but create a new issue where you include all the relevant information. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@luccadumas -- have you tried setting the ANDROID_SDK_ROOT env variable and removing the ANDROID_HOME variable? @janpio , I'm not sure it's really "just cosmetic" -- builds that used to work now fail. Also, I'm not sure if the root cause is the same in all of the cases listed above. For me, iirc, the issue was that I had a working build one day, and the next day I didn't, even though I didn't change my code. I suspect I did a clean install and new minor versions of packages were updated. Please see my earlier comment (#670 (comment)) with a more detailed description of what I found. As I see it, it looks like the deprecation of an old ENV variable was implemented in an odd way and it is causing unnecessary churn (this thread, for example). However, I only spent enough time in the gradle code to understand why it wasn't working, so I could be wrong. |
No it is not - but I created this issue, and is it specifically about the cosmetic problem. As I posted above, if something is actually broken for you, open a new issue and include all the information it asks for. |
I have the same problem, anybody found the solution already? |
Same problem here (unbuntu 19.04). It is certainly not "cosmetic" as I cannot run or build when using "cordova run android". I do think it a little sad that no one seems interested in fixing a cosmetic error that is causing untold lost hours chasing ghosts. However, no ghost here. Real issue and dead in the water. |
Environment Variable For Windows ANDROID_SDK_ROOT JAVA_HOME PATH PATH PATH PATH PATH |
Environment Variable For LINUX/MAC
|
I just updated the title to make it 100% clear that this issue is about a display issue. In case of anything beyond a display issue we would like to kindly ask that someone raise a new issue so that we can keep our issues clearly focused, trackable, and actionable. Please do feel free to reference this issue from a new issue as I think this would be relevant, GitHub will show the references here. We have already marked this issue as a bug, so it is on our todo list. P.S. I further updated the title to indicate that we see this as a cosmetic display issue. We would like to kindly ask that people raise a new issue if they see this kind of behavior as anything other than a cosmetic display issue. And we would kindly ask people to simply use GitHub Reactions as described in [1] if they think we should fix this issue. I did change some hidden comments from "spam" to "resolved" as I personally did not see any attempt to actually spam us. [1] https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/ |
hello any idea about this problem? I work under the macOS: cordova build cordova The .bash_profile is as follows, And no matter how the environment is , the problem is stil right here. |
@75341704 This issue is a cosmetic issue, not a functional issue, as stated several times before. If something is functionally not working for you, please raise a new issue and fill out the form completely. @janpio is it possible to lock this thread so only contributors can comment? If so, perhaps it is time to so... |
mv /Library/Java/JavaVirtualMachines/jdk-11.0 ~/otherfolder The environment detection may have some problem. |
I am facing a weird issue. macOS Cataline |
Your comment is unrelated to the ticket at hand. To quickly answer your question though, I believe macs use I am locking this thread due to the number of unrelated comments. As stated before, this issue describes a cosmetic issue. If you do have a functional issue, then you should raise a new ticket and fill out the form appropriately. |
This commit does the following: - Makes ANDROID_SDK_ROOT the primary variable to look for the Android SDK location. - Makes ANDROID_HOME the fallback variable, if ANDROID_SDK_ROOT is not present/valid. Gradle updates: Note that the following gradle updates were required, otherwise the android gradle plugin did not honour the ANDROID_SDK_ROOT variable. - Updates the framework's android studio's gradle plugin from version 3.3.0 to 3.5.3. Not only this is required for android's gradle to obey ANDROID_SDK_ROOT, it is now in sync with the Android test project/ - Updates the Androidx test project to use gralde plugin from version 3.3.0 to 3.5.3, to match Android Test & framework. - Consequentially, this required to also upgrade AndroidX test project to use Gradle 6.1, which also matches both the Android test project & framework These changes above fixes apache#949 Additionally, since we update the environment variables dynamically, the environment variable printout produced misleading information. The environment variable printout will now print out the variable as defined by the user (before the tooling messes with them). An additional log is printed that tells the user exactly what Cordova is going to use for the Android SDK path. This should fix apache#670
This commit does the following: - Makes ANDROID_SDK_ROOT the primary variable to look for the Android SDK location. - Makes ANDROID_HOME the fallback variable, if ANDROID_SDK_ROOT is not present/valid. Gradle updates: Note that the following gradle updates were required, otherwise the android gradle plugin did not honour the ANDROID_SDK_ROOT variable. - Updates the framework's android studio's gradle plugin from version 3.3.0 to 3.5.3. Not only this is required for android's gradle to obey ANDROID_SDK_ROOT, it is now in sync with the Android test project/ - Updates the Androidx test project to use gralde plugin from version 3.3.0 to 3.5.3, to match Android Test & framework. - Consequentially, this required to also upgrade AndroidX test project to use Gradle 6.1, which also matches both the Android test project & framework These changes above fixes apache#949 Additionally, since we update the environment variables dynamically, the environment variable printout produced misleading information. The environment variable printout will now print out the variable as defined by the user (before the tooling messes with them). An additional log is printed that tells the user exactly what Cordova is going to use for the Android SDK path. This should fix apache#670
This commit does the following: - Makes ANDROID_SDK_ROOT the primary variable to look for the Android SDK location. - Makes ANDROID_HOME the fallback variable, if ANDROID_SDK_ROOT is not present/valid. Gradle updates: Note that the following gradle updates were required, otherwise the android gradle plugin did not honour the ANDROID_SDK_ROOT variable. - Updates the framework's android studio's gradle plugin from version 3.3.0 to 3.5.3. Not only this is required for android's gradle to obey ANDROID_SDK_ROOT, it is now in sync with the Android test project/ - Updates the Androidx test project to use gralde plugin from version 3.3.0 to 3.5.3, to match Android Test & framework. - Consequentially, this required to also upgrade AndroidX test project to use Gradle 6.1, which also matches both the Android test project & framework These changes above fixes apache#949 Additionally, since we update the environment variables dynamically, the environment variable printout produced misleading information. The environment variable printout will now print out the variable as defined by the user (before the tooling messes with them). An additional log is printed that tells the user exactly what Cordova is going to use for the Android SDK path. This should fix apache#670
This commit does the following: - Makes ANDROID_SDK_ROOT the primary variable to look for the Android SDK location. - Makes ANDROID_HOME the fallback variable, if ANDROID_SDK_ROOT is not present/valid. Gradle updates: Note that the following gradle updates were required, otherwise the android gradle plugin did not honour the ANDROID_SDK_ROOT variable. - Updates the framework's android studio's gradle plugin from version 3.3.0 to 3.5.3. Not only this is required for android's gradle to obey ANDROID_SDK_ROOT, it is now in sync with the Android test project/ - Updates the Androidx test project to use gralde plugin from version 3.3.0 to 3.5.3, to match Android Test & framework. - Consequentially, this required to also upgrade AndroidX test project to use Gradle 6.1, which also matches both the Android test project & framework These changes above fixes apache#949 Additionally, since we update the environment variables dynamically, the environment variable printout produced misleading information. The environment variable printout will now print out the variable as defined by the user (before the tooling messes with them). An additional log is printed that tells the user exactly what Cordova is going to use for the Android SDK path. This should fix apache#670
This commit does the following: - Makes ANDROID_SDK_ROOT the primary variable to look for the Android SDK location. - Makes ANDROID_HOME the fallback variable, if ANDROID_SDK_ROOT is not present/valid. Gradle updates: Note that the following gradle updates were required, otherwise the android gradle plugin did not honour the ANDROID_SDK_ROOT variable. - Updates the framework's android studio's gradle plugin from version 3.3.0 to 3.5.3. Not only this is required for android's gradle to obey ANDROID_SDK_ROOT, it is now in sync with the Android test project/ - Updates the Androidx test project to use gralde plugin from version 3.3.0 to 3.5.3, to match Android Test & framework. - Consequentially, this required to also upgrade AndroidX test project to use Gradle 6.1, which also matches both the Android test project & framework These changes above fixes apache#949 Additionally, since we update the environment variables dynamically, the environment variable printout produced misleading information. The environment variable printout will now print out the variable as defined by the user (before the tooling messes with them). An additional log is printed that tells the user exactly what Cordova is going to use for the Android SDK path. This should fix apache#670
This commit does the following: - Makes ANDROID_SDK_ROOT the primary variable to look for the Android SDK location. - Makes ANDROID_HOME the fallback variable, if ANDROID_SDK_ROOT is not present/valid. Gradle updates: Note that the following gradle updates were required, otherwise the android gradle plugin did not honour the ANDROID_SDK_ROOT variable. - Updates the framework's android studio's gradle plugin from version 3.3.0 to 3.5.3. Not only this is required for android's gradle to obey ANDROID_SDK_ROOT, it is now in sync with the Android test project/ - Updates the Androidx test project to use gralde plugin from version 3.3.0 to 3.5.3, to match Android Test & framework. - Consequentially, this required to also upgrade AndroidX test project to use Gradle 6.1, which also matches both the Android test project & framework These changes above fixes #949 Additionally, since we update the environment variables dynamically, the environment variable printout produced misleading information. The environment variable printout will now print out the variable as defined by the user (before the tooling messes with them). An additional log is printed that tells the user exactly what Cordova is going to use for the Android SDK path. This should fix #670
Hey @brodybits (as I remember you pushed a PR in this area), check out the output of running
cordova build android
on a brand new machine where I just installed Android Studio:Strange that this set
ANDROID_HOME
, and notANDROID_SDK_ROOT
, isn't it?The text was updated successfully, but these errors were encountered: