我正在尝试使用 Android SDK 将 AdMob sdk 添加到我的 android 项目中。这就是所做的。
- 我将 admob jar 文件添加到 lib 文件夹中。
- 添加为模块
- 然后将依赖项添加到我的 build.gradle。
下面是 build.gradle 文件的样子
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:13.0.+'
}
dependencies{
compile files('libs/android-support-v4.jar','libs/GoogleAdMobAdsSdk-6.4.1')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
下面是错误。
Gradle 'StoriesIndian' project refresh failed:
Could not fetch model of type 'IdeaProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
Build file 'C:\Users\lokesh\Desktop\MyStoryProject\StoriesIndianProject\StoriesIndian\build.gradle' line: 11
A problem occurred evaluating project ':StoriesIndian'.
A problem occurred evaluating project ':StoriesIndian'.
No signature of method: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.compile() is applicable for argument types: (org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection) values: [file collection]
Possible solutions: module(java.lang.Object
)
请帮助,如何使它工作以及在哪里包含模块 java.lang.object。谢谢