I have my facebook application id on my gradle properties with :
FACEBOOK_APPLICATION_ID="XXXXXXXXXXXXXXX"
and I set in my defaultConfig :
manifestPlaceholders = [facebookAppId: FACEBOOK_APPLICATION_ID]
then, I want to use this in my manifest with :
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="${facebookAppId}" />
but it doesn't work. The only things working are to set my faceboook id in a string :
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
or to put this directly with :
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="\ XXXXXXXXXXXXXX" />
but I must set my facebook id in my gradle properties. What is the right way to do this ?
Thanks.
I am new on Gradle, but if I understood your questions I would suggest using something like that:
buildTypes {
debug {
// ...
}
release {
// ...
resValue "string", "facebook_application_id", "XXXXXXXXXXXXXXXXX"
}
}
Then, at your release build, for this example, you can use it as
android:value="@string/facebook_application_id"
Or even
R.string.facebook_application_id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With