Tôi đang cố gắng tích hợp Nhắn tin thiết bị Amazon với Android Studio. Đầu tiên tôi theo sau (integrating-your-app-with-adm). Khi tôi gọiNhắn tin thiết bị Amazon Stub! Android Studio
ADM adm = new ADM(getActivity());
if (adm.isSupported()) {
// ...
}
Có đầu ra này trên logcat:
E/AndroidRuntime (24.472): java.lang.RuntimeException: Stub!
E/AndroidRuntime (24.472):. Tại com.amazon.device.messaging.ADM (Unknown Source)
Vì vậy, tôi đi theo Amazon (Integrating Amazon Libraries with Android Studio) với kết quả tương tự.
Sau đó, tôi đã thử this và this mà không thành công.
My AndroidManifest.xml trông như thế này:
...
<uses-permission android:name="de.mypackage.permission.RECEIVE_ADM_MESSAGE" />
<uses-permission android:name="com.amazon.device.messaging.permission.RECEIVE" />
<permission android:name=".permission.RECEIVE_ADM_MESSAGE" android:protectionLevel="signature" />
...
<application
android:name=".MyPackageApplication"
android:allowBackup="true"
android:allowClearUserData="true"
android:hardwareAccelerated="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
...
<service android:name=".service.ADMNotificationService" android:exported="false" />
<amazon:enable-feature android:name="com.amazon.device.messaging" android:required="true" />
<receiver android:name=".service.ADMNotificationService$MessageAlertReceiver"
android:permission="com.amazon.device.messaging.permission.SEND">
<intent-filter>
<action android:name="com.amazon.device.messaging.intent.REGISTRATION" />
<action android:name="com.amazon.device.messaging.intent.RECEIVE" />
<category android:name="de.mypackage"/>
</intent-filter>
</receiver>
...
</application>
Các build.gradle địa phương trông như thế này:
...
dependencies {
...
provided files('libs/amazon-device-messaging-1.0.1.jar')
...
}
bạn có thể có một ý tưởng?
Bạn có chạy ứng dụng trên thiết bị Kindle không? –
Có! kindle cháy hdx. – Kartenspieler
bạn có thể đính kèm tệp build.gradle đầy đủ hoặc ít nhất là phần flavor/buildConfig và phần phụ thuộc đầy đủ không? –