我正在尝试使用Dji网站上的说明运行dji Mobile-Sdk-Android:https://github.com/dji-sdk/Mobile-SDK-Android:https://developer.dji.com/mobile-sdk/documentation/quick-start/index.html#android-sample-app
我已经注册了一个开发者账号,创建了一个应用程序,并将API密钥添加到以下字段中
<meta-data android:name="com.dji.sdk.API_KEY" android:value="" />
在AndroidManifest.xml文件中。我将应用程序导出为.apk文件,并将其安装在一加6T上,但当我启动应用程序时,收到以下错误消息:"Sdk注册失败。请检查从服务器收到的捆绑包ID和您的网络connectivity.The元数据无效,请重新连接到服务器并尝试。“
我确保应用程序页面中的捆绑包ID与Android studio中的包名称匹配,并且当我运行应用程序时,我可以连接到互联网,但它仍然无法工作。
以前有没有其他人遇到过这种情况?
发布于 2018-12-07 19:08:18
请确保您第一次连接到互联网。
发布于 2018-12-11 15:26:06
这对我来说很管用。以下是一些建议:
发布于 2020-10-09 18:28:18
有两个地方,您应该在其中输入您自己的包名:
在清单中:
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.yyy">在应用程序build.gradle中!
defaultConfig {
applicationId "com.xxx.yyy"此外,如上所述,请确保您在DJI开发者网站上插入了您生成的App密钥。
(感谢SChalice) https://forum.dji.com/forum.php?mod=viewthread&tid=173866&page=1#pid1791780
注意:为了提醒这一点,我总是在"onRegister“回调中插入以下代码:
public void onRegister(DJIError djiError) {
if (djiError == DJISDKError.REGISTRATION_SUCCESS) {
// startConnectionToProduct
} else {
if (djiError == DJISDKError.INVALID_METADATA) {
// https://forum.dji.com/forum.php?mod=viewthread&tid=173866&page=1#pid1791780
Log.e(TAG, "onRegister():\n" +
"DJISDKError.INVALID_METADATA -> ensure com.xxx.yyy is coherent in the following places:\n" +
"In build.gradle:\n" +
" android{defaultConfig{applicationId \"com.xxx.yyy\"\n" +
"In AndroidManifest.xml:\n" +
" <manifest xmlns:android='http://schemas.android.com/apk/res/android'\n" +
" package=\"com.xxx.yyy\"");
} else // treat any other error
}
}https://stackoverflow.com/questions/53556099
复制相似问题