EDIT : Initially it looked insurmountable and I have overlooked. The actual problem is a facile victory. What really happened is somehow, unintentionally I've created (or) it has created fragment_feed.xml(v14)
file along with original fragment_feed.xml
file after upgrading to 3.1.0. But, the Button Id's were not present in (v14)fragment_feed.xml
which were actually present in original fragment_feed.xml
file anb I have declared them in my FeedFragment.java
file but FeedFragment.java
is considering only (v14)fragment_feed.xml
while compiling. I have added button Id's in the (v14)fragment_feed.xml
file. Then it worked absolutely fine.
编辑:最初它看起来不可逾越,我忽略了。实际问题是一个轻松的胜利。真正发生的事情是,无意中我创建(或)创建了fragment_feed.xml(v14)文件以及升级到3.1.0后的原始fragment_feed.xml文件。但是,(v14)fragment_feed.xml中没有Button Id,它们实际上存在于原始fragment_feed.xml文件中,而我已在FeedFragment.java文件中声明它们,但FeedFragment.java仅考虑(v14)fragment_feed.xml而编译。我在(v14)fragment_feed.xml文件中添加了按钮Id。然后它工作得很好。
So, check if there are any v14
kinda xml
files existing and check if there is anything missing that's been declared in .java
file.
因此,检查是否存在任何v14 kinda xml文件,并检查是否有任何遗漏已在.java文件中声明。
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException:
Compilation failed; see the compiler error output for details.
at
org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute
(JdkJavaCompiler.java:50)
at
org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute
(JdkJavaCompiler.java:35)
at
org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.
delegateAndHandleErrors(NormalizingJavaCompiler.java:98)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.
execute(NormalizingJavaCompiler.java:51)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute
(NormalizingJavaCompiler.java:37)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute
(CleaningJavaCompilerSupport.java:35)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute
(CleaningJavaCompilerSupport.java:25)
at
org.gradle.api.internal.tasks.compile.incremental.
IncrementalCompilationFinalizer.execute
(IncrementalCompilationFinalizer.java:39)
at org.gradle.api.internal.tasks.compile.incremental.
IncrementalCompilationFinalizer.execute
(IncrementalCompilationFinalizer.java:24)
at
org.gradle.api.tasks.compile.JavaCompile.performCompilation
(JavaCompile.java:207)
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:133)
at
com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile
(AndroidJavaCompile.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl
.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at
org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute
(IncrementalTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute
(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute
(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run
(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor
$RunnableBuildOperationWorker.execute
(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor
$RunnableBuildOperationWorker.execute
(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute
(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run
(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter
.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter
.executeActions(ExecuteActionsTaskExecuter.java:92)
... 32 more
This is the stacktrace. I have tried everything, nothing worked. I even downloaded new Android studio and imported the project, still it is showing the same error. From the above stacktrace, you can look from caused by: line.
这是堆栈跟踪。我尝试了一切,没有任何效果。我甚至下载了新的Android工作室并导入了该项目,但它仍然显示相同的错误。从上面的堆栈跟踪中,您可以从以下原因看:line。
Please help me. It is not accepting any new code. old code is working fine. Old code means, the code existed before updating the android studio. I have been facing this issue from 3 days.This error occurred after migrating to 3.1.0 from 3.0.1.
请帮帮我。它不接受任何新代码。旧代码工作正常。旧代码意味着,在更新android studio之前存在代码。我从3天开始就遇到了这个问题。从3.0.1迁移到3.1.0后发生了这个错误。
Project level gradle
项目级别的gradle
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.2.0'
}
}
allprojects {
repositories {
google()
maven {
url "https://maven.google.com"
}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App level gradle
应用级别gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.authent.authentication"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-auth:12.0.0'
implementation 'com.google.android.gms:play-services-auth:12.0.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.facebook.android:facebook-login:4.31.0'
implementation 'com.google.firebase:firebase-database:12.0.0'
implementation 'com.google.firebase:firebase-storage:12.0.0'
implementation 'com.github.bumptech.glide:glide:4.6.1'
implementation 'com.android.support:support-v4:27.1.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
implementation 'com.google.firebase:firebase-firestore:12.0.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
implementation 'id.zelory:compressor:2.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'
Gradle wrapper propertice
Gradle包装属性
#Thu Mar 29 16:24:24 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-
all.zip
1 个解决方案
#1
0
Initially it looked insurmountable and I have overlooked. The actual problem is a facile victory. What really happened is somehow, unintentionally I've created (or) it has created fragment_feed.xml(v14)
file along with original fragment_feed.xml
file after upgrading to 3.1.0. But, the Button Id's were not present in (v14)fragment_feed.xml
which were actually present in original fragment_feed.xml
file anb I have declared them in my FeedFragment.java
file but FeedFragment.java
is considering only (v14)fragment_feed.xml
while compiling. I have added button Id's in the (v14)fragment_feed.xml
file. Then it worked absolutely fine.
最初它看起来不可逾越,我忽略了。实际问题是一个轻松的胜利。真正发生的事情是,无意中我创建(或)创建了fragment_feed.xml(v14)文件以及升级到3.1.0后的原始fragment_feed.xml文件。但是,(v14)fragment_feed.xml中没有Button Id,它们实际上存在于原始fragment_feed.xml文件中,而我已在FeedFragment.java文件中声明它们,但FeedFragment.java仅考虑(v14)fragment_feed.xml而编译。我在(v14)fragment_feed.xml文件中添加了按钮Id。然后它工作得很好。
So, check if there are any v14
kinda xml
files existing and check if there is anything missing that's been declared in .java
file.
因此,检查是否存在任何v14 kinda xml文件,并检查是否有任何遗漏已在.java文件中声明。
#1
0
Initially it looked insurmountable and I have overlooked. The actual problem is a facile victory. What really happened is somehow, unintentionally I've created (or) it has created fragment_feed.xml(v14)
file along with original fragment_feed.xml
file after upgrading to 3.1.0. But, the Button Id's were not present in (v14)fragment_feed.xml
which were actually present in original fragment_feed.xml
file anb I have declared them in my FeedFragment.java
file but FeedFragment.java
is considering only (v14)fragment_feed.xml
while compiling. I have added button Id's in the (v14)fragment_feed.xml
file. Then it worked absolutely fine.
最初它看起来不可逾越,我忽略了。实际问题是一个轻松的胜利。真正发生的事情是,无意中我创建(或)创建了fragment_feed.xml(v14)文件以及升级到3.1.0后的原始fragment_feed.xml文件。但是,(v14)fragment_feed.xml中没有Button Id,它们实际上存在于原始fragment_feed.xml文件中,而我已在FeedFragment.java文件中声明它们,但FeedFragment.java仅考虑(v14)fragment_feed.xml而编译。我在(v14)fragment_feed.xml文件中添加了按钮Id。然后它工作得很好。
So, check if there are any v14
kinda xml
files existing and check if there is anything missing that's been declared in .java
file.
因此,检查是否存在任何v14 kinda xml文件,并检查是否有任何遗漏已在.java文件中声明。