-
Notifications
You must be signed in to change notification settings - Fork 4.4k
build.gradle -- add note for MyOpenWeatherMapApiKey #69
Comments
Thank you Cattalins, I also encountered this hiccup :) |
I agree Cattalins. Part of being a good coder is using comments to help clarify what the previous code means. |
That was starting to bother me and then I read this, so thank you Cattalins |
Wow, thank you for this post! This was something I also ran into that bothered me. Thanks for the information! |
I get stuck at the same situation. Thanks so much!!! cattallins |
@Cattalins Good catch and Thank you! I was searching errors using gradle as the error was not obvious. |
Thanks a lot Cattalins. That was very helpful and time saving. |
On the bright side, getting this fixed was also a learning experience and YOU get to say that you did it without this post! You're awesome! |
Yes, I know, but sadly when this get fixed, I will return to my anonymity. |
thank you Cattalins very much this helped me |
Thank you so much for your help :) |
AMEN! |
that helped so much. Should've guessed to have done that when I saw the code it generated... |
Hi I have this problem with buildTypes.each Error:(21, 0) Gradle DSL method not found: 'buildConfigField()'
And no, I am not missing a comma. |
Earlier,I quit the tutorial coz android studio wont let me run the app coz of this gradle quotes issue. |
For some reason, my gradle built only works when I simulate through a virtual phone, not my galaxy.... Which was weird because it was compatible.
|
Also this works: |
Good Catch.. |
You can also use the gradle.properties file tu define the constant MyOpenWeatherMapApiKey like this: MyOpenWeatherMapApiKey = "abcdefg0123456" And the project will sync without problem |
Thank u =) |
This link may be helpful http://stackoverflow.com/questions/33365650/cannot-resolve-symbol-c882c94be45fff9d16a1cf845fc16ec5 |
This helps me a lot .. :) |
Thanks a lot |
This helped me a lot, thanks!!! |
I should have seen this before figuring out what the problem is. It would have saved a lot of time. |
Thank you so much for this post, i have spent last 2 hrs fixing this issue. |
Thanks a lot Cattalins |
buildTypes.each { |
How does one use this code: MyOpenWeatherMapApiKey = "abcdefg0123456" it doesn't seem to work for me. |
Hi,
Please add this line in your build.gradle file
buildTypes.each {
it.buildConfigField 'String', 'OPEN_WEATHER_MAP_API_KEY', "'abcdefg0123456'"
}
And after that refer this by BuildConfig.OPEN_WEATHER_MAP_API_KEY in your
ForecastFragment class.
Think it must work.
|
Thanks a lot! |
Thanks a lot. Got stuck here, kept applying " " and it still wouldn't render correctly in the build config. You saved me a lot of time. |
There's going to be a change coming that will make this process much more clear! Sorry for the current confusion. I agree, single quotes surrounding double quotes is very confusing. |
Thank you, you saved my day! Started pondering about this a fed days ago...
|
@tal32123 and others who are looking why defining |
@SiddharthVenu The reason why you shouldn't put your API key in your project's ( Does that make sense? |
@halfjew22 But it does not recognize the variable if I put it in |
@SiddharthVenu Uh oh! Shoot me an email (mlustig@google.com) and I'll help you fix that! |
I just encountered this, thank you for posting the solution. |
@Cattalins Your name has been engraved electronic stones of android history. You will not be forgotten. |
thanks for this solution , saved me hours of frustration. |
Thank you! That saved some headache. |
Why does it (OPEN_WEATHER_MAP_API_KEY) have to be written like this? Please I need an answer to this questions |
@Josephaguele : naming OPEN_WEATHER_MAP_API_KEY like this will make no difference you can name it as you like but when you call it in your code "FetchWeatherTask" class |
@Cattalins i'm pretty sure this is not how it's done
and MyOpenWeatherMapApiKey is like calling a variable you declared in gradle.propertie
when adding your api key in your build.gradle file you risk when using github t |
I tried coding it like everyone has said, but it hasn't worked for me yet because when I try to run the sunshine app, it still shows the run time error. buildTypes.each{ Please can anyone help me out with this. And please must we have a correct and working API key before the Sunshine app will work? |
@Josephaguele this is the working code you add these lines exactly as it is in build.gradle file inside the android { } and this is my code android {
} dependencies { you only add
and you must have a working api Key for the sunshine app to work and this is my key " 3194b70c58f9e0bc45d2279c1696c587 " if you wish to use it and to must add your api key to the gradle.properties file located in C:\Users\your username.gradle in windows and in your Home directory in mac and here is the code in my gradle.properties file
if you need any help i'm here |
Thanks, On Mon, Aug 1, 2016 at 10:14 PM, Ali Makhion notifications@github.com
|
@Josephaguele it's yours 👍 |
Thanks a lot. I really appreciate. |
Hi, Please Is there any way I can get an updated explanation of Postal Code On Sat, Aug 6, 2016 at 3:19 PM, Codenal notifications@github.com wrote:
|
Thank's Cattalins |
Thank you On Sat, Oct 8, 2016 at 5:55 AM, seiya021 notifications@github.com wrote:
|
Thank you for help. |
ok, when changing the build.gradle file double check you inserted the code in the correct one. there's 2 here (Project and app), the code should be on the build.grade (app) |
Thanks ..
…On 10-Mar-2017 10:19 am, "rag-lab" ***@***.***> wrote:
ok, when changing the build.gradle file double check sure you inserted the
code in the correct one. there's 2 here (Project and app), the code should
be on the build.grade (app)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#69 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALdT-ZVdw1cMh99-C6SyaEKp2oVajlOqks5rkNZFgaJpZM4GRqq->
.
|
Thank you , that was helpful |
I am a pretty new user to Android Studio, Gradle and everything else.
I have been having some trouble to get the project starting with the build.gradle file.
ON:
It would be nice to have a note stating that your API Key should be inside single quotes AND double quotes.
LIKE:
The text was updated successfully, but these errors were encountered: