我正在尝试使用Azure Notifications Hub在我的Android应用中实现推送通知。我已按照here的说明进行操作,但当我到达Adding Azure Notification Hubs libraries
的步骤时,我陷入困境。首先,他们提供的名为notification-hubs-0.4.jar
的链接上的“文件”选项卡上没有文件,所以我假设我想要的是notification-hubs-android-sdk-0.4.jar
。所以我下载了它并将其包含在我的assets \ libs文件夹中。然后我按照说明将所需的行添加到我的build.gradle文件中,但是我一直收到错误说明
任务'执行失败':app:processDebugResources'进程'命令'C:\ pathtothefile ... \ aapt.exe''以非零退出值1完成。
我的build.gradle文件看起来像这样......
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.myapplicationid.android"
minSdkVersion 10
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-project.txt'
}
}
}
dependencies {
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.microsoft.azure:azure-notifications-handler:1.0.1@aar'
compile files('src/main/assets/libs/android-maps-extensions.jar')
compile files('src/main/assets/libs/android-viewbadger.jar')
}
repositories {
maven {
url "http://dl.bintray.com/microsoftazuremobile/SDK"
}
}
我在这里做错了吗?有人可以指出我的错误吗?
答案 0 :(得分:2)
我们也会正确更新文档,但是当我们这样做时,将编译'com.microsoft.azure:notification-hubs-android-sdk:0.4@aar'添加到依赖项中,看看是否有效。