Many function is unresolved after Android Studio Chipmunk(11.0.12) Update - android

There is no problem with all codes before the update.
But After the update, many functions are unresolved.
My Android Studio version.
error code1
error code2
error code3
All error contents are Unresolved reference:~~.
my dependencies 1
my dependencies 2
There are my dependencies.
There is an error in the code, but the build works fine.
What's the problem?

Your compiler is unable to generate project files. Change the room dependencies(if being used) to '2.4.2' and upgrade your gradle to 7.0+
Also go to Android Studio-> preferences-> Build, version...-> Build tools-> Gradle and change the Gradle JDK to 11.

Related

Error when updating to Gradle 3.3.2 in Android Studio: Cannot resolve symbol R

If I update Gradle by changing
dependencies {
classpath 'com.android.tools.build:gradle:3.x.x'
}
from version 3.2.1 to version 3.3.2 I get the Cannot resolve symbol R error on all activities but the project actually builds without errors. Don't know what might be causing this. I realized on the Android view of the project files, under app/generatedJava/ there are many packages with version 3.2.1, but when updated none of them are there, except for a BuildConfig.java class under my.app.package.
I've already tried all the Build -> Clean, Build -> Rebuild, File -> Invalidate caches, File -> Sync Project with Gradle Files, etc. methods which would solve the problem and still not finding the R class.
With version 3.2.1 this doesn't happen though.
As Vivek stated in the comments, the solution is to upgrade Android Studio as well. I upgraded to version 3.3 and it finally solved the problem for me.

gradle refuse to sync even after downloading from their site

I tried to sync my gradle in android studio and it showed me this error even after I tried to sync it locally, still the same error:
Error:BUG!
exception in phase 'class generation' in source unit
'ijinit0_8gov8jl8pmdtxuu0gk1mcw4af' unsupported Target MODULE
What Gradle and Java versions are you using?
Try downgrading them & delete the build and .gradle folders in your project directory

Downgrade Gradle from 3.3 to 2.14.1

Long story short: My android phone keeps disconnecting from ADB. I was told to update android studio, did that. I open my project in Intellij and try to run on android and I get an error:
BUILD FAILED
Total time: 48.986 secs
Error: /Users/me/Desktop/comp/Development/comp-ionic/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> java.lang.NullPointerException (no error message)
My first thought is that my gradle is the wrong version. For this specific app, I need to use gradle version 2.14.1.
When I type gradle -v I'm getting version 3.3.
Is there a way to delete/downgrade gradle from 3.3 to 2.14.1?
Or is this another problem?
If you're using the gradle wrapper, then there'll be a folder in your project named "gradle" with a subfolder named "wrapper", inside that, there are 2 files:
- gradle-wrapper.jar
- gradle-wrapper.properties
Open "gradle-wrapper.properties" and change the place where it says "3.3" to "2.14.1". Then sync gradle, and it will automatically download 2.14.1.
If you're using the new 2.3 Android Studio, you HAVE to use gradle wrapper 3.3, as its the minimum supported gradle wrapper version. If so, then you'll have to download Android Studio 2.2, or fix whatever issue you have in your project that needs gradle wrapper version 2.14.1.
To get more information about whatever the issue is, try running this:
./gradlew clean assemble -stacktrace
That will clean your project, try and compile it, and if/when it fails, it will show you a stacktrace of the error.
What you should do is to change the gradle build tools version to the one that matches your gradle version. According to here you can set the gradle to 2.14.1 by changing build tools to lower than 1.0.0.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'// For gradle 2.2.1 - 2.3
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Notice: if you keep checking the mentioned link you'll see Higher is better for gradle.
For me, Android Studio > File > Invalidate Caches / Restart did the trick.
I got the same problem when upgrading to Android Studio 2.3.1. There is something funky about Gradle 3.3 (It fails by "java.lang.NullPointerException: null value in entry: destinationDir=null at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33)").
Good news: seems like the current most recent version (3.5) works.
Go to File|Project Structure|Project, and use these versions:
Gradle version=3.5
Android Plugin version=2.3.1
I update the Android Studio version to 3.3 Canary 4, then update the gradle plugin, and the project stops working.
I do not know how to restore my AS to the previous state, nighter the gradle plugin.
But just with this command, the project now works, for me: gradlew clean assemble -stacktrace, in terminal tab in AS.

Generated class list does not exist {module root}\build\intermediates\data-binding-info\release\_generated.txt

I am trying to get data binding set up in my Android project, and I am getting an error whenever I try to build. The top of the stack trace is as follows:
java.lang.RuntimeException: failure, see logs for details. Generated class list does not exist C:\git\android-lm\androidCore\build\intermediates\data-binding-info\debug\\_generated .txt
at android.databinding.tool.util.L.printMessage(L.java:100)
at android.databinding.tool.util.L.e(L.java:87)
at android.databinding.tool.util.Preconditions.check(Preconditions.java:25)
at android.databinding.tool.DataBindingBuilder.readGeneratedClasses(DataBindingBuilder.java:130)
at android.databinding.tool.DataBindingBuilder.getJarExcludeList(DataBindingBuilder.java:118)
at com.android.build.gradle.internal.LibraryTaskManager$16.getExcludeList(LibraryTaskManager.java:550)
at com.android.build.gradle.internal.tasks.LibraryJarTransform.transform(LibraryJarTransform.java:154)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:151)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:148)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:147)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(A nnotationProcessingTaskFactory.java:243)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(Annota tionProcessingTaskFactory.java:219)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(Ann otationProcessingTaskFactory.java:230)
Environment:
Windows 8.1
Android Studio 1.4.1 (also tried in 1.3)
Gradle plugin for Android 1.5.0-beta1
Gradle 2.4
Build tools 23.0.2
Target SDK version 23, min version 21 (also tried targeting 22)
Android Library project depending on a variety of java and other android libraries
Dagger, dbFlow with apt code generation.
I have removed all code from my project that actually uses types from the data binding libraries - just the act of enabling data binding in my build.gradle causes this error. I have tried clean and rebuild, clearing my .gradle folder, clearing all .\build folders, restarting android studio but to no avail. The error occurs both from the command line and from within AS.
Any help greatly appreciated.
Most likely, you have this block:
dataBinding {
enabled = true
}
in a module's build.gradle when there are nothing in that module that triggers databinding.

Import a project to Android studio faced problems

I want reading an open source project so I select k9mail for start. The recommendation was run and reading this code in Android Studio. I import k9mail project to AS 1.2.1.1 version. I download gradle 2.4 version and added this in environment variable. When I want to run this application, but I receive some errors that I describe below:
1) When I click Run (Alt+Shift+F10), select Android Application, select my module (there is k9mail) and select USB Device, then I see a warning:
No JDK specified for module 'k-9-master'.
2) When I click on Run (Shift+F10), I faced this error in messages tab:
Gradle DSL method not found: 'android()'
Possible causes:
A)The project 'k-9-master' may be using a version of Gradle that does not contain the method.Open Gradle wrapper file
B)The build file may be missing a Gradle plugin. Apply Gradle plugin
When I updated gradle to 2.4, I changed classpath 'com.android.tools.build:gradle:1.2.3' to 'classpath 'com.android.tools.build:gradle:2.4'' from build.gradle of k9mail, but my problems were not solved.
I googled but I can't find solutions for my problems.
No jdk specified for the module.
For that you have to specify the jdk path through Project Structure.
You may also verify by looking at local.properties
For gradle related issues you just kindly update your gradle build and SDKs to latest versions.
This will minimize your gradle issues.

Categories

Resources