1

我是 android 新手,我想在我的应用中添加付款选项。所以,我使用了 instamojo。我在 gradle 文件中包含 instamojo 库。但是 gradle 文件抛出错误。

错误:

Error:Failed to resolve: in.juspay:godel:0.6.11.0823

我的毕业文件:

 dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:23.2.0'
    compile 'de.hdodenhof:circleimageview:1.2.1'
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile 'com.android.support:recyclerview-v7:23.2.0'
    compile 'com.loopj.android:android-async-http:1.4.7'
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
    compile('com.googlecode.json-simple:json-simple:1.1.1') {
        exclude group: 'org.hamcrest', module: 'hamcrest-core'
    }
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.google.gms:google-services:3.0.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    compile 'com.google.android.gms:play-services-location:8.4.0'
    compile 'com.instamojo:android-sdk:1.2.4'
}

如果我在单独的应用程序中运行 instamojo sdk 意味着工作完美。如果我与我的应用程序集成意味着超过 gradle 错误。

求大神帮忙解决。

提前致谢。

4

2 回答 2

1

错误:无法解决:in.juspay:godel:0.6.11.0823

从这里这里

你应该有一个allprojects块,其中包含一些这样的行

// Add to build.gradle

repositories {
  jcenter()  // <-- should already be there

  mavenCentral()
  maven {
    url "https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/"
  }
}

而在app/build.gradle

dependencies {
  // compile 'in.juspay:godel:0.6.12.0823' // maybe need this?
  compile 'com.instamojo:android-sdk:1.2.4'

  // your other dependencies
  ...
  ...
}

此外,这条线不需要在那里。compile 'com.google.gms:google-services:3.0.0' 它应该在classpathbuildscript dependencies中。

并且'com.android.support:design:23.1.1'应该23.2.0用来匹配其他Android支持版本。


关于“清单合并失败”,您可以搜索以找到类似的内容,然后从删除此行开始,因为它与其他依赖项是多余的。

compile 'com.android.support:support-v4:23.2.0'
于 2016-11-15T14:33:16.873 回答
1

// 添加到 build.gradle

repositories {
  jcenter()  // <-- should already be there

  mavenCentral()
  maven {
    url "https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/"
  }
}

然后将其添加到您的清单文件中

<meta-data android:name="instamojo.orderauth.url"
            android:value="ur website name/access_token.php"
            />
于 2019-01-05T18:19:06.110 回答