-1
我想下面的教程,讓我的API密鑰安全Gardle失敗的基礎上同步
http://www.techjini.com/blog/securing-api-key-and-secret-key-in-android/
但是,當我點擊「立即同步」,我得到以下錯誤
Error:org.gradle.api.GradleException: Crashlytics Developer Tools error.
Error:com.crashlytics.tools.android.exception.PluginException: Crashlytics Developer Tools error.
Error:java.lang.IllegalArgumentException: Crashlytics found an invalid API key: "xxxxxMYFABRICKEYxxxxx".
gradle.properties
####################
#Fabric
FabricKey=my fabric key
####################
Gradle file
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
def FABRIC_KEY = '"' + FabricKey + '"' ?: '"Error occurs..."'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
//... other info
manifestPlaceholders = [
FABRIC_KEY : FABRIC_KEY
]
}
}
AndroidManifest.xml中
<meta-data
android:name="io.fabric.ApiKey"
android:value="${FABRIC_KEY}" />
'$ {...}'不是'{$ ...}'請使用官方文檔不是一些有問題的質量教程 – Selvin
但我仍然得到相同的錯誤 – VVB
* Gardle *很奇怪... – Vucko