AkshayChordiya / News

A sample News 🗞 app built using Modern Android Development [Architecture Components, Coroutines, Retrofit, Room, Kotlin, Dagger]
MIT License
848 stars 166 forks source link

Getting "An annotation argument must be a compile-time constant" #15

Closed sumanth-culli closed 6 years ago

sumanth-culli commented 6 years ago

I'm getting the above error at @GET("articles?source=google-news&apiKey=" + BuildConfig.NEWS_API_KEY) in NewsSourceService.kt

AkshayChordiya commented 6 years ago

Did you add the NEWS_API_KEY in the gradle.properties?

sumanth-culli commented 6 years ago

Yes

Created gradle.properties file here /Users/home/Downloads/android-arch-news-sample-master/gradle.properties

Added this line NEWS_API_KEY="12345678" (Example)

AkshayChordiya commented 6 years ago

Okay. Something is weird. Is this issue happening when you clone this project or on a newer project which you made? Also make sure there is no error shown for BuildConfig and it's imported.

sumanth-culli commented 6 years ago

Apologies. Added NEWS_API_KEY=12345678 instead of NEWS_API_KEY="12345678" Missed " Nice app. Thanks.

AkshayChordiya commented 6 years ago

Sure. No problem.