java - 找不到参数的方法 applicationId()?
问题描述
我试图修复这个错误,但我不知道我的主要问题是什么。
如果有解决方案,我得到的错误是关于添加依赖项或我的依赖项的版本,请帮助:
我的毕业文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app.gradle 文件是:
应用插件:'com.android.application'
android { compileSdkVersion 28 buildToolsVersion '28.0.3' defaultConfig applicationId "me.ismashot.ibtassim" minSdkVersion 15 targetSdkVersion 28 versionCode 59 versionName '4.6' multiDexEnabled true } dexOptions { jumboMode true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } lintOptions { checkReleaseBuilds false // Or, if you prefer, you can continue to check for errors in release builds, // but continue the build even when errors are found: abortOnError false } productFlavors { } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.mcxiaoke.volley:library:1.0.19' implementation 'com.github.chrisbanes.photoview:library:1.2.3' implementation 'com.facebook.android:facebook-android-sdk:4.35.0' implementation 'com.pkmmte.view:circularimageview:1.1' implementation 'com.melnykov:floatingactionbutton:1.3.0' implementation 'com.squareup.okhttp:okhttp:2.5.0' implementation 'com.github.bumptech.glide:glide:3.7.0' implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support:animated-vector-drawable:28.0.0' implementation 'com.android.support:mediarouter-v7:28.0.0' implementation 'com.android.support:customtabs:28.0.0' implementation 'com.android.support:design:28.0.0' implementation 'com.android.support:recyclerview-v7:28.0.0' implementation 'com.android.support:cardview-v7:28.0.0' implementation 'com.balysv:material-ripple:1.0.2' implementation 'com.squareup.picasso:picasso:2.5.2' implementation 'com.google.firebase:firebase-core:16.0.3' implementation 'com.google.firebase:firebase-ads:15.0.1' implementation 'com.google.firebase:firebase-messaging:17.3.0' implementation 'com.google.firebase:firebase-analytics:16.0.3' implementation 'com.google.android.gms:play-services-gcm:15.0.1' implementation 'com.google.android.gms:play-services-ads:15.0.1' implementation files('libs/YouTubeAndroidPlayerApi.jar') } apply plugin: 'com.google.gms.google-services'
有人帮我和我的应用程序人员一起解决这个问题吗?
解决方案
将缺少的内容添加{
到您的defaultConfig
:
android {
...
defaultConfig {
applicationId "me.ismashot.ibtassim"
...
}
...
}
编辑:
为了修复,请Failed to resolve: play-services-basement
确保在所有块中都带上google()
存储库:jcenter()
repositories
repositories {
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
jcenter()
}
推荐阅读
- javascript - 在 html div 中显示函数的结果
- google-analytics - 谷歌标签管理器、Cookiebot 和谷歌分析:在标签中从“页面视图”切换到“窗口加载”跟踪类型的后果是什么?
- asp.net-core - 在 Razor 视图中填充 selectlistitem 时同步等待 NULL 引用异常
- java - 读取超过 9 万条记录的 excel 文件时出现内存不足异常
- mysql - 如何在mysql中使用union合并同一张表
- mysql - MYSQL 按日期分组并计算第一个日期
- python - 如何更改图例中的行数?
- php - 我想将数组 [1,2,3,4,5,6,7,8,9,10,11] 制作成数组 [1,2,3,4,5,6,7,8,9,1 ,0,1,1] 仅使用此算法
- vim - 长按键'j'后vim光标保持滚动
- android - 科尔多瓦插件火力库编译问题