从aws运行示例代码时,android PubSub同步失败

时间:2019-04-25 00:52:55

标签: android android-gradle

我正在尝试从亚马逊网络服务运行示例应用程序(Android pub-sub应用程序),但是遇到“同步失败”问题,并且无法运行该应用程序。

[错误显示]:    “无法解决:com受影响的模块:AndroidPubSub”

My android studio version is 3.4  and dependencies is
 dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }

i changed dependencies to 3.4.0 , also cannot fix the sync failed issue.

my current gradles files under  "C:\Users\"username"\.gradle\wrapper\dists" link are 
 "gradle-4.6-all"  and " gradle-5.1.1-all "

may i know how should i fix this "sync failed" issue ?
Thank you very much.

below is the sync failed error.

C:/Android/workspace/AndroidPubSub  
build.gradle    
Failed to resolve: com
Affected Modules: <a href="openFile:C:/Android/workspace/AndroidPubSub/build.gradle">AndroidPubSub</a>  
Sync Failed 5 s 228 ms      

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,并在AndroidPubSubWebsocket示例中找到了答案。您只需要将依赖项更改为:

dependencies {
    def aws_version = "2.13.+"
    implementation "com.amazonaws:aws-android-sdk-iot:$aws_version"
    implementation ('com.amazonaws:aws-android-sdk-iot:$aws_version@aar') { transitive = true}
    implementation "com.amazonaws:aws-android-sdk-mobile-client:$aws_version"
    implementation "com.android.support:support-compat:28.0.0"
}