Cannot find snapshot for id: -4123461672748341163-AndroidStudio - android-studio

Android Studio error while rebuilding the project.
any suggestions how to fix this?

Look in the sdk Manager what is your highest Android sdk Build-tools version, & copy this version number in ur project's build.gradle file, in the android/buildToolsVersion property.
Change Gradle Version -
/gradle/wrapper/gradle-wrapper.properties
Edit the distributionUrl line and set it too:
distributionUrl=http://services.gradle.org/distributions/gradle-1.8-all.zip
Rebuild your project.

Related

ModelCache.safeGet(androidProjectResult.androidProject::getNdkVersion, "") must not be null

When I Updated the Android Studio to the Bumblebee 2021.1.1 I got this error:
ModelCache.safeGet(androidProjectResult.androidProject::getNdkVersion, "") must not be null
I have already added ndk.dir to local.properties but I still have the error.
sdk.dir=/path/to/sdk
ndk.dir=/path/to/ndk
Add ndk path in android.ndkPath
Or
Add ndkVersion '23.0.7599858' (If you use this approach then in some case you have to add version in other library module if they use ndk)
You can also add this using File-> Project Structure
The value for ndk.dir should no longer be set in your app's local.properties file, and support for this ndk.dir setting will be removed in a future version. The Android Gradle Plugin sets the NDK version by default, but if you need a specific version of the NDK, you can set android.ndkVersion in build.gradle.
Remove ndk.dir=/path/to/ndk from the local.properties.
go to build.gradle under android section add ndkVersion='required ndk version'
ex:
android {
ndkVersion '23.1.7779620'
}
Reference : Android office doc's
Google has provide this fix in Android Studio Bumblebee | 2021.1.1 Patch 2 (Issue link)
So, updating my Android Studio to Bumblebee patch-2 solved this error.
Now I need not to add the ndk paths as suggested in other answers.
Google Android Studio changelog
ndk.dir=/path/Android/Sdk/ndk
sdk.dir=/path/Android/Sdk
Try to define like this
Follow these two steps to solve the issue
Go to SDK Manager>SDK Tools> NDK > Uninstall all
Go to the ndk directory and see if it's empty, If it is not, delete the files
Install a new copy of ndk from SDK manager
in your local.properties gives your path as
sdk.dir=D\:\\AndroidFiles
ndk.dir=D\:\\AndroidFiles\\ndk\\23.0.7599858

How i can build old Android project in Android Studio

i have to build this project but getting error because it is so old.
here is the project git hub link
i am using latest android studio version
Try the following:
Change gradle version in build.gradle , change the version in the following line in the file: classpath 'com.android.tools.build:gradle:2.2.3'.
In the file gradle/wrapper/gradle-wrapper.properties, update the gradle version in this line: distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip . Sync the project again, it should work. If it doesn't restart android studio again. It should build successfully afterward.
PS: See what gradle version you use according to your android studio version.

I need to solve this problem about android studio

As you can see here is my problem with android studio I have been looking for solutions 3 days now but I didn't find any
Minimum supported Gradle version is 6.1.1 current version is 5.2.1
Please fix the project's gradle settings.
Fix gradle wrapper and re-import project
Open gradle wrapper properties
Gradle settings
Go to File > Project Structure > Project and change your Gradle Version there.

This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer

This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer.
but my android studio version is 3.2.1 and there is no new update from Google
Try to edit your project build.gradle file and set the android build gradle plugin to classpath 'com.android.tools.build:gradle:3.2.1' within the dependency section.
See also the documentation of the android grade plugin
It's a bit late, But easy and effective.
Click on About Android Studio,
Check the current version,
Open build.gradle of Project and put it in front of the class path. e.g Your studio version is 3.5.2, then your classpath should look like this
classpath 'com.android.tools.build:gradle:3.5.2'
You would need to lower your gradle version and android plugin version, or you can download latest version from beta or canary update channels.
To enable updates from other channels go to Help -> Check for Updates -> Congifure automatic updates and in that dialog select channel you want. After selecting check for update again and it will show you latest version.
This issue is caused due to use of newer version of gradle in the project.
There are two options to resolve this:
Option 1:
Change gradle/wrapper/gradle-wrapper.properties file
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
Change project level gradle build.gradle file
classpath("com.android.tools.build:gradle:3.3.2")
Option 2:
Update your Android Studio to newer version. (Highly recommended)
In IntelliJ IDEA this is an open bug: https://youtrack.jetbrains.com/issue/IDEA-252823
As a workaround, you can change the build tools version as other people advise.
My project was failing with this dependency:
com.android.tools.build:gradle:7.0.0-alpha03
Now it's working with this:
com.android.tools.build:gradle:4.0.2
As a side note, you should change that dependency in build.gradle in some projects or in dependencies.kt in newer projects.
That was the most updated version that worked.
After an update the Android Studio does not show the layout's design for some reason. I tried newer versions as well, but it did not work. So I decided to downgrade my IDE.
When I opened my project, I got the same error. The solution was the following:
Open the Project Structure.
Select the Project field.
Use the appropriate Android Plugin Version. You can copy it from a new project's structure.
Change the Gradle version too what you need.
OK.
Find the gradle-wrapper.properties file and open it.
Change the distributionUrl to that gradle version url what you saved in the Project Structure.
Or if you don't mind, then you can update your AS.
Had the same Issue when i decided to install another version of Android Studio, what worked for me was:
Creating a new project with the current version of Android Studio just to go check the classpath version at the project level build.gradle inside the dependencies section, at the time it was this:
classpath 'com.android.tools.build:gradle:3.5.0-rc01'
Copied that line and replaced it on the project i was working on.
in project's build.gradle file comment classpath com.android.tools.build:gradle:. File → Project Structure select Android Gradle Plugin Version to match Android Studio version
You can now update your android studio to 3.4 stable version. Updates for stable version are now available. cheers!!!
i just change gradle version classpath 'com.android.tools.build:gradle:3.5.3' to
classpath 'com.android.tools.build:gradle:3.3.2' and now working.
I encountered with this error and just decrease gradle version and android plugin version to 5.1.1 and 3.4.2.
Close VPN worked for me! It suprised me.
this issue occur for me after downgrade Java JDK, after upgrade JDK my problem resolved.
Open android studio then go to help menu > check for update > Update your Android Studio to newer version.
If u r here because of Jetpack Compose, I had the same problem, and solved it by using the Arctic Fox Canary build of Android studio: you can download it at this link: https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2020.3.1.12/android-studio-2020.3.1.12-mac.zip
This issue arises due to updates, You can resolve this by downgrading the gradle used from
com.android.tools.build:gradle:3.2.1 to a previous gradle like com.android.tools.build:gradle:3.0.0 or anything older than the current one
This usually happens when you're opening someone else's project after unzipping it. And the person has used an updated android Studio.
The way to solve it is
1.Go to Help and about to see your android studio version
2.Go to File>Project Structure> and set your Android Gradle Plugin version to your android studio version
3.Change the Gradle version to the one you usually use.(optional)
Build the project and it should run without any errors
This seems like incompatible gradle plugin vs gradle binary versions. You can find the releases here: Gradle Plugin release and compatiblity
Upgrade your grade plugin and grade binary to compatible versions and the app should start building.

Missing generated folders in Android Studio

I'm using Android Annotations in my project and I followed the instructions in this blog post http://www.jayway.com/2014/02/21/androidannotations-setup-in-android-studio/
Everything worked fine.
Today I updated Android Studio to latest version (build of 5th june). This requires an update of gradle build tools from 19.0.3 to 19.1.0. And i configured this in my build.gradle.
Annotaion processing still works. The generated files are located in build/source/apt. But this folder isn't visible any more in project explorer. And starting the build complains about the configuration.
But the project seems to run correctly.
This behavior is very annoying. Do I have to change anything in Android Studio? Has anyone a solution or is this just a bug in Android Studio?
The author of android-apt has already updated his plugin to support Gradle's new version, just change this line in your build.gradle
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2+'
To
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.3'
The Android Studio Team changed the behavior of the IDE "for better IDE integration". Therefore the output directory of the apt-plugin v 1.2 will not be recognized as generated sources folder any more.
the plugin author knows about it and will provide a fix
https://bitbucket.org/hvisser/android-apt/issue/13/compatibility-with-011-android-plugin

Resources