物联网平台移动开发sdk。在android应用的问题。 按照文档集成后,运行抛异常(仅调用SDKManager.init(this);)
异常摘录片段如下: java.lang.RuntimeException: Unable to create application com.kong.home_iot_control.MainApplication: com.alibaba.cloudapi.sdk.exception.SdkException: app key or app secret must be initialed
解决:
在gradle.properties添加如下属性 #解决打包release版本的时候运行apk闪退的问题:
android.enableResourceOptimizations=false
在debug时也报同样错误:
解决:
1、首先保证安全图片的签名跟debug时的APP签名一致
2、在debug包下添加
v1SigningEnabled true
如:
signingConfigs { debug { v1SigningEnabled true v2SigningEnabled true storeFile file('../key/release.keystore') storePassword '123' keyAlias 'release' keyPassword '123' } release { v1SigningEnabled true v2SigningEnabled true storeFile file('../key/release.keystore') storePassword '123' keyAlias 'release' keyPassword '123' }
标签:app,initialed,debug,secret,123,key,release,true From: https://www.cnblogs.com/changyiqiang/p/18029859