mozilla-mobile / shared-docs

⚠️ shared-docs moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android
https://medium.com/firefox-mobile-engineering
Mozilla Public License 2.0
34 stars 32 forks source link

Provide configuration info for building android-components #85

Closed espertus closed 5 years ago

espertus commented 5 years ago

@jonalmeida and others helped me build android-components in Android Studio.

My first mistake, which was quickly found, was that I opened, rather than imported, the project after cloning it.

My second mistake, which took a while to discover, was that building in Android Studio required setting the environment variable JAVA_HOME. Since I use OS X with the default (bash) shell, this entailed creating (or adding to) .bash_profile:

export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"

Note that setting the variable is not needed for building at the command line.

jonalmeida commented 5 years ago

Thanks for filing this issue @espertus !

mcomella commented 5 years ago

@jonalmeida I'm afraid the issue will get lost in this repo: should we cross-file to the a-c repo so the a-c team can prioritize and work on it?

Alternatively, you're the best person to work on this @espertus because you have the context on where the docs should have been that would have helped you and what they should have said so if you have time to open a PR, that would be great too! :)

espertus commented 5 years ago

I volunteered to. Jon was the one who suggested I file a bug. I agree with the policy that whoever asked for help passes along the help.

On Tue, Sep 10, 2019, 3:20 PM Michael Comella notifications@github.com wrote:

@jonalmeida https://github.com/jonalmeida I'm afraid the issue will get lost in this repo: should we cross-file to the a-c repo so the a-c team can prioritize and work on it?

Alternatively, you're the best person to work on this @espertus https://github.com/espertus because you have the context on where the docs should have been that would have helped you and what they should have said so if you have time to open a PR, that would be great too! :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mozilla-mobile/shared-docs/issues/85?email_source=notifications&email_token=AAFBMQDGD6C7I3KBQ6WXM2TQJAMUHA5CNFSM4IVMVXQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6MVOBY#issuecomment-530142983, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFBMQHGZZDS37ZN7N6V6ZLQJAMUHANCNFSM4IVMVXQA .

jonalmeida commented 5 years ago

This can happen for any of our Android Studio projects so I recommended it go here, but if you assign it to me, I'll put a PR for it this week or next.

espertus commented 5 years ago

An alternative would be to make the gradle file more robust. It looks like flutter went through something similar. https://github.com/flutter/flutter/commit/cefd3c3837e85f96943fdafc9cf238faf00438f0

I'm willing to take this as a starter project (or to hand it over to someone more experienced).

jonalmeida commented 5 years ago

An alternative would be to make the gradle file more robust. It looks like flutter went through something similar. flutter/flutter@cefd3c3

This would be an android-components bug in that case, but I'm not sure about it being a starter issue. :)

espertus commented 5 years ago

Well, I could add code that, if JAVA_HOME isn't set checks the default locations for java installations by Android Studio on different OSs and gives a meaningful message if none are found. Let me know if I should try doing that or just create documentation. (I think the meaningful message would be useful in any case.)

espertus commented 5 years ago

This was fixed in android-components: https://github.com/mozilla-mobile/android-components/pull/4446