Gradle project sync failed after upgrade to Android Studio 2.2.2 - android

Basic functionality (eg. editing,debugging)will not work properly. Error:Unexpected lock protocol found in lock file. Expected 3, found 0
I recently updated my android studio on stable channel and since then all my old project files have this issue when i open them
on the gradle console -> Messages
Error:Unexpeced lock protocol found in lock file . Expected 3,found 0.
Please help me resolve this issue

Finally found the fix :
You just need to go to File -> Project Structure or jus press Ctrl+Alt+Shift+S
and then on the top left click Project Make sure that your Android Plugin Version is the same as you Android Studio Version .. This should fix it
additionally
You can also create a new Project and check under Project view initially you'll be in Android .. change the view to ... Project - > gradle (Note .. not .gradle only gradle ) ->wrapper ->gradle-wrapper properties.. open this file and you can see the last line ie ..
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
make sure you have the same gradle version in your old files as well
Check out this Youtube Video i made regarding this issue
https://youtu.be/-Ngn4YvbKtw

Related

Error MSB4044 - Getting this error when building Xamarin android project

Error MSB4044: The "ResolveLibraryProjectImports" task was not given a value for the required parameter "DesignTimeBuild"- From visual studio for Mac
Tried cleaning the project and and removed all the obj files.
Any help appreciated.
Thank you
Clean your Project and Build individual Components like right click on your common/Droid/iOs individually and click build,instead of doing build all,see if this works
1.) Check in your Build - Configuration manager that iOS project is not selected while Droid project is being build.
Or
2.) Check the packages version that you have installed are compatible, i.e Xamarin.Forms package version should be compatible with Droid other packages and version should be same for your PCL project.
Hope this may solve your issue.
when I replaced the file with another in the Android.coomon.targets, this error was fixed and the project got build successfully.

Gradle execution fails: Unknown command-line option '--daemon'

I use latest Android Studio (0.8.2). On my other PC the same code is successfully builded.
It means that build scripts are correct.
So I assume that it is something with Gradle configuration, but I double rechecked all configs:
I completely removed .gradle folder under C:\Windows\Users{MyUser}.gradle to delete old configurations;
gradle.properties file doesn`t have any uncommented options
What do I miss?
NOTE! I have not specified '--daemon' option. Or I only think so:( I can`t find it in Gradle default and project specific settings
Also I created absolutely new project in the studio. It didn`t help - the same error(
The answer is very simple. It seems that new version of Android studio imported all setting from previous one. Some of old options added additional options to compiler
Android Studio always uses a Gradle daemon. It connects to the daemon via the Gradle Tooling API, and perhaps the latter doesn't understand --daemon (because it's redundant).

Android Studio gradle errors

When i go to :
File > Project Structure
I have the following 5 errors:
Library 'appcompat-v7-19.0.1' is not used
Library 'Gradle: 19.0.1' is not used
Library 'Gradle: support-v4-19.0.1' is not used
Library 'Gradle: 4.2.42' is not used
Library 'play-services-4.2.42' is not used
I can fix the problem with the icon on the right, add to dependencies and i add to the selected module, it works but if i exit Android Studio and i run it again, the errors appears again.
Those errors are spurious and you can ignore them; that they appear at all is bug https://code.google.com/p/android/issues/detail?id=60958. Having said that, unless you're running a very old version of Android Studio, they shouldn't be appearing.

Android Studio 0.2.9 and New Project

I am using android studio for app development and i am using it from its 1st release, i keep updating it whenever a patch is available.Recently I updated my android studio to latest version , that is 0.2.9 and now i am facing problem while creating new project.
every time i am getting this exception msg box
The following dependencies were not resolvable. See your build.gradle file for details.
- com.android.support:appcompat-v7:18.0.0
and i am clueless about what went wrong !!
p.s : previous projects are working fine
seeking suggestions on it :)
Make sure you download the Android Support Repository under Extras using the SDK Manager
The in your project module look for the second build.gradle file uncomment the dependencies section that is pointed in your case, the file provides some instruction on what you have to do.
With that in place save, build and test, happy coding!

Could not fetch model of type 'IdeaProject' using Gradle installation

I've downloaded and installed Android Studio with all the required dependencies such as JDK 1.7 and Gradle 1.6. I am able to import the projects and modules quite comfortably in Studio, but when I try to create a new project I am getting errors like this:
Since this is the new born IDE I couldn't find much details on this, except for this and this. Any help would be greatly appreciated.
After to pass much time trying to resolve this, i reached a solution :
Are you using "Windows Version" of AS ?
Please follow these steps :
1 - Install the last version of JDK with respective JAVA_HOME variable.
2 - Download and Install Gradle1.6 with respective GRADLE_HOME variable,
http://www.gradle.org/docs/current/userguide/userguide_single.html#installation.
2 - Delete these folders:
C:\Users\youruser\.AndroidStudioPreview
C:\Users\youruser\.android
C:\Users\youruser\.gradle
3 - Reopen Android Studio
Now probably it will works
There are a lot of bugs in "Early Access Preview"....
The error dialog mentions Gradle 1.4
Android Studio requires the Gradle plugin 0.4 which requires Gradle 1.6
I tried the environment variable and folder location stuff suggested, also made sure I had the latest version of Gradle, but that made no improvement. Then I ran Android Studio using an admin account, at which point all the errors disappeared. If you are able to, I suggest you do the same.
This was on a Windows 7 box.
For me, this problem was caused by my local.properties file showing a different path to the Android SDK. I do development on both Mac OS X and Windows and the properties file was showing my Mac OS X SDK path. Turns out, this file shouldnt even be checked into source control. Ooops!
The fix for me was on the Known Issues page here: http://tools.android.com/knownissues
I changed
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
to:
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
Reopened Android Studio and voila!
The best solution I found is to check-out some empty project, then import it rather than use the "New project" utility.
I fixed the problem by downloading a fresh copy of AndroidStudio. During one of the updates something went wrong so I delete all config files and freshly downloaded the file from the Internet and then it worked fine for me.
(I'm on a Mac)
If you are still receiving this error when creating a new project, then try opening the project (after error) and removing the following from your build.gradle file in your module.
dependencies {
compile 'com.android.support:support-v4:13.0.+'
}
I resolved this by installing some extras from Android SDK what I did not think I needed: Google Repository and Google Play services. In addition of Android Support Repository.
When manually running gradle you get more meaningful error messages.

Categories

Resources