Shopify /移动购买-SDK-机器人

时间:2017-11-03 12:59:20

标签: java android shopify

我正在尝试整合com.shopify.mobilebuysdk:buy3:3.1.1 但它会继续崩溃并出现以下错误 -

java.lang.NoSuchMethodError:无静态方法com_shopify_buy3_GraphClient $$ Lambda $ 1_lambda $ new $ 0(Ljava / lang / Runnable;)Ljava / lang / Thread;在课堂Lcom / shopify / buy3 / GraphClient;或其超级课程(&com; shopify.buy3.GraphClient'的声明出现在/data/app/in.transformative.iyura-2/base.apk)

Build.gradle文件如下 -

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 24
buildToolsVersion '25.0.0'
defaultConfig {
    applicationId "*******"
    minSdkVersion 19
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner"
    jackOptions {
        enabled true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
     }
  }
 }

 dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  androidTestCompile('com.android.support.test.espresso:espresso-
core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:24.2.0'
compile 'com.shopify.mobilebuysdk:buy3:3.1.1'
testCompile 'junit:junit:4.12'
}

每次都在下一行崩溃 -

graphClient.queryGraph(query).enqueue(new GraphCall.Callback<Storefront.QueryRoot>()

我已经搜索了互联网,没有找到任何帮助。

1 个答案:

答案 0 :(得分:0)

我认为问题可能出在子模块更新中,您可以尝试以下操作。

git clone git@github.com:Shopify/mobile-buy-sdk-android.git
cd mobile-buy-sdk-android
git submodule update

在执行上述步骤时,如果出现权限拒绝错误,则必须将ssh-rsa密钥上传到github网站。请按照以下命令获取ssh-rsa密钥。

cd ~/.ssh && ssh-keygen
cat id_rsa.pub