当Android studio gradle尝试构建我的应用程序时,我遇到了以下例外情况。
行:3
评估项目“:app”时出现问题。方法无签名:build\u 9zxr20k2zkn73ctdrehcrmd74。android()适用于参数类型:(build\u 9zxr20k2zkn73ctdrehcrmd74$\u run\u closure1)值:[build\u 9zxr20k2zkn73ctdrehcrmd74$\u run_closure1@2ecd80]
组织。格拉德尔。应用程序编程接口。GradleScriptException:评估项目“:app”时出现问题。原因:groovy。lang.MissingMethodException:没有方法的签名:build\u 9zxr20k2zkn73ctdrehcrmd74。android()适用于参数类型:(build\u 9zxr20k2zkn73ctdrehcrmd74$\u run\u closure1)值:[build\u 9zxr20k2zkn73ctdrehcrmd74$\u run_closure1@2ecd80]在build\u 9zxr20k2zkn73ctdrehcrmd74。跑
以下是构建。gradle文件
建筑gradle(项目)
apply plugin: 'com.android.application'
android {
compileSdkVersion 31
defaultConfig {
applicationId "net.estebanrodriguez.anecdotals"
minSdkVersion 22
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
javaCompileOptions.annotationProcessorOptions.includeCompileClasspath true
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
//material design components
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.core:core:1.7.0-rc01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.media:media:1.4.3'
implementation 'androidx.fragment:fragment:1.4.0-alpha10'
implementation 'androidx.appcompat:appcompat:1.4.0-beta01'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
//Firebase
implementation 'com.google.firebase:firebase-auth:21.0.1'
implementation 'com.google.firebase:firebase-firestore:23.0.4'
//Android Architecture Components
def room_version = '2.0.0-beta01'
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
// optional - RxJava support for Room
implementation "androidx.room:room-rxjava2:$room_version"
// Test helpers
testImplementation "androidx.room:room-testing:$room_version"
def lifecycle_version = '2.0.0-beta01'
// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation 'androidx.multidex:multidex:2.0.1'
//Timber
implementation 'com.jakewharton.timber:timber:4.7.1'
//Dagger 2
implementation 'com.google.dagger:dagger-android:2.35.1'
implementation 'com.google.dagger:dagger-android-support:2.20'
// if you use the support libraries
annotationProcessor 'com.google.auto.value:auto-value:1.5.2'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.20'
annotationProcessor 'com.google.dagger:dagger-compiler:2.21'
//RxJava
implementation 'io.reactivex.rxjava2:rxandroid:2.2.6'
// Because RxAndroid releases are few and far between, it is recommended you also
// explicitly depend on RxJava's latest version for bug fixes and new features.
// (see https://github.com/ReactiveX/RxJava/releases for latest 2.x.x version)
implementation 'io.reactivex.rxjava2:rxjava:2.2.6'
}
apply plugin: 'com.google.gms.google-services'
建筑gradle(模块)
apply plugin: 'com.android.application'
android {
compileSdkVersion 31
defaultConfig {
applicationId "net.estebanrodriguez.anecdotals"
minSdkVersion 22
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
javaCompileOptions.annotationProcessorOptions.includeCompileClasspath true
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
//material design components
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.core:core:1.7.0-rc01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.media:media:1.4.3'
implementation 'androidx.fragment:fragment:1.4.0-alpha10'
implementation 'androidx.appcompat:appcompat:1.4.0-beta01'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
//Firebase
implementation 'com.google.firebase:firebase-auth:21.0.1'
implementation 'com.google.firebase:firebase-firestore:23.0.4'
//Android Architecture Components
def room_version = '2.0.0-beta01'
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
// optional - RxJava support for Room
implementation "androidx.room:room-rxjava2:$room_version"
// Test helpers
testImplementation "androidx.room:room-testing:$room_version"
def lifecycle_version = '2.0.0-beta01'
// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation 'androidx.multidex:multidex:2.0.1'
//Timber
implementation 'com.jakewharton.timber:timber:4.7.1'
//Dagger 2
implementation 'com.google.dagger:dagger-android:2.35.1'
implementation 'com.google.dagger:dagger-android-support:2.20'
// if you use the support libraries
annotationProcessor 'com.google.auto.value:auto-value:1.5.2'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.20'
annotationProcessor 'com.google.dagger:dagger-compiler:2.21'
//RxJava
implementation 'io.reactivex.rxjava2:rxandroid:2.2.6'
// Because RxAndroid releases are few and far between, it is recommended you also
// explicitly depend on RxJava's latest version for bug fixes and new features.
// (see https://github.com/ReactiveX/RxJava/releases for latest 2.x.x version)
implementation 'io.reactivex.rxjava2:rxjava:2.2.6'
}
apply plugin: 'com.google.gms.google-services'
可能会删除项目目录中以开头的目录
像<代码>。渐变
和。想法可以奏效。同时删除app
目录中的build
文件夹。
我试图在Jenkins groovy脚本中执行以下命令。 我的错误就在下面 00:00:00.652FATAL:方法没有签名:hudson.model.FreeStyleBuild.call()适用于参数类型:(java.lang.字符串)值:[主构建]00:00:00.652可能的解决方案:等待(),保存(),any(),等待(long),每个(groovy.lang.闭包),any(groov
/*HHH000388:不成功:创建表USER_REGISTRATION_DB(用户-否整数不为空,地址varchar(60),年龄varchar(255),出生日期date_of_birding datetime不为空,电子邮件varchar(40),第一名varchar(30),最后一名varchar(255),移动varchar(255)不为空,密码varchar(30),用户名varcha
试图在intellij想法中构建Android项目,并获得以下错误:构建文件'C:\用户...\app\build.gradle'line: 91 配置项目: app时出现问题。 groovy.lang.MisSingmethod odExcture:没有方法的签名:org.gradle.api.internal.file.DefaultFileProperty tyFactory$Default
我遵循一个关于将工件发布到Nexus的教程,并以一个简单的Java应用程序为例。提供了一个Gradle文件,用于更改。最后,它看起来是这样的: 当我使用命令时,我收到以下错误: Gradle版本:Gradle 7.4.2 我做错了什么?
Build.Gardle 插件{ } CompileSdkVersion 31 BuildToolsVersion 30.0.3 版本名“1.0” TestInstrumentationRunner“Android x.test.runner.AndroidJunutRunner”} } 编译器选项{ SourceCompatability javaVersion.version_1_8 targ
代码如下。IDE对代码很好,但gradle拒绝构建,他说: TextAdapter不是抽象的,并且不重写适配器公共类中的抽象方法onBindViewHolder(TextAdapter.SimpleTextholder,int)TextAdapter extends RecycerView.Adapter{