1
你好,我很新的android和android studio .i構建一些測試應用程序和一些應用程序。當我嘗試導入讓AdMob移動廣告SDK在這個視頻 (Link to mobile ads garage video)它給了我一個錯誤進口移動廣告sdk時出現Gradle同步錯誤
Image of error in messages view
當我在點擊安裝庫和同步工程的消息選項查看我的光標變成指針和Android工作室stucks.after一段時間後,它正常,不要安裝任何東西。
我啓用了谷歌的AdMob通過檢查內部文件>項目結構>廣告
這裏是應用模塊的我的build.gradle文件AdMob的選項。
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.bilalep.swiftbrowser"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
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.android.support:appcompat-v7:25.0.1'
compile 'com.google.android.gms:play-services-ads:+'
testCompile 'junit:junit:4.12'
}
希望它有助於下我的問題。
不要使用加編譯庫。使用實際的版本號。只要閱讀文檔,這比任何視頻更正確。 https://developers.google.com/android/guides/setup –
終於讓我的問題得到解決。儘管它顯示爲已安裝,但從** Android Studio SDK Manager **安裝播放服務並不成功。我從獨立的sdk管理器安裝了谷歌播放服務,谷歌存儲庫,suppot存儲庫,並將下載的文件從/ Program Files/Android/Android-sdk/extras/folder複製到我的/ AppData/Android/Sdk文件夾。 –