Android Studio Google Precondition - java

About two weeks ago i started doing some small apps in Android Studio.
Im pretty new to this environment so im having this problem.
Last night i was working on my app, everything was running so i saved and turned off my pc.
Today i opened Android studio and the message:
Unable to load class 'com.google.common.base.Preconditions'.
And i dont know how to solve it , i already tried this things:
Do a clean install of Android Studio
Clean Project & Build project (Tried it but no solution)
Check "Offline mode" (It was already checked off)
Invalidate Cache/Restart (Done it but no solution)
Erase "gradle" folder from my "Android" folder, but no "Automatic" download happened when i reopened so i had to reinstall the application
Ive already saw a lot of posts from differente forums but im not getting any solution
Thanks to all

Try deleting the .gradle directories both in your home directory and in your project's directory and see if it works. I believe that, since Android Studio will be forced to re-download all the files for the current version of gradle, it might solve your problem.

Related

Android java class/symbol not found despite being placed in the same directory

I have encountered issues in my android studio regarding java classes/symbols not found, despite these classes and symbols being placed in the same directory, or under the same parent directory. I am making use of the DJI's mobile SDK for android.
Example of errors:
Cannot resolve symbol 'DJISampleApplication'
For illustration, here are 2 screenshots
First example. Clicking on "import class" causes android studio to create a brand new class instead of linking it to the existing one.
second example
However, oddly, when I go under "Build >> Make Project" , or "Run" to deploy on a real android device, the app can be installed, and there are no errors (only warnings).
Things I have tried:
Uninstalling and re-installing android studio
copying the whole project from the original files in again
Trying on another computer, which works. However, as i am only assigned this pc, i have to get this to work here as well.
Thank you in advance !
Your best bet is to invalidate caches and restart. Solves 99% of problems like this for me.
You can also try to reimport the project using the gradle tool window ...
Click the reload button here ...

Error occurred in my android studio Project.....can't find the solution on google

I have made a simple app. It was running fine. I had never used git. So, I watched a simple tutorial on youtube and installed the git and have made an account on Github. And also have added the account on the android studio and made the initial commit. Just after that, an error is showing in (ExampleInstrumentedTest.java)... and when I try to run the app. it builds without error but fails to install in my android device.
I searched for the solution on google. And find that disabling the instant run can solve this. but in the latest version of the android studio. instant run feature is not used.here is the screenshot and here is the screenshot for dependencies
Edit: now I have found out that it is running on other android devices but not on my android device. I think this problem arose after I unrooted my android device.
Just close the project and import it same.Its work for me.
File > New > Import Project > your project
Go to Build >Clean Project followed by Rebuild Project.
If it works then ok, otherwise uncommit git changes and then rebuild Project. It will work.
It was not installing the app on my device since I had unrooted my phone. So, I rooted the phone again and now the problem is solved.

failed to load properties file for project Android studio already installed

I have already installed android studio and is working great. Then I downloaded Eclipse Neon tar.gz file from the official website and ran the installer. When it prompted me to choose which installation i gave Android development and the installation process finished.
Soon after it finished, the ide opened in a given workspace. Then the error came as no ddms found. I closed eclipse and opened android studio to check if its working fine or not. Its working fine and the last project loaded without any error. S
So I closed it and opened eclipse again. But before closing it i opened android emulator from android studio. I left it there so that i can use it for eclipse.
When i opened Eclipse again, it told me that no avd found. I closed it and stared creating a new Android application project. From File->New->Android Application Project In the last screen when i clicked finish, Errors came in the problems tab and a error report was generated by the eclipse.
The problem is that no matter how many times i click finish the wizard wont close. I can only cancel the wizard.
This is the error came failed to load properties file for project for my project
I searched it and found many links. One solution was to delete debug keystore,
Other was
eclipse Failed to load properties file for project
Other was to Deleting the existing ADT Bundle and Extract the new ADT Bundle.
My worry is the I already have android studio installed in my system. I that going to be a problem?
And also when i checked for paths of SDK location its correct. Both Android Studio and Eclipse are sharing the same.
So what should i do. Pleeeez help

What is the proper way to move android studio project from one computer to another

Hi guys I have created an android studio 2.1 project on my laptop sometime ago and have gotten pretty far with it. I now have a desktop PC that I would LOVE to put my project onto and continue development on. Everything builds just fine on the laptop but when i copy over the entire project over to my desktop it keeps giving me an error for the dex file being over 64k which is clearly not the case on my laptop. I believe im moving the project over to the desktop wrong. I tried many different ways but always get errors when doing so, the closes I got was when I went on my desktop and opened just the gradle.build file in android studio and let it load the project from there. But as stated earlier I get the "dex file exceeds 64k methods". Any help is appreciated.
dex error
create the git repository account and clone it from git repository on other system .
use the multidexEnabled option as true in build.gradle to avoid the multidexing issues

All of a sudden. Can't build my project(Game) & sync with Gradle (Libgdx)

So, i've been developing several Games for Android.
And im currently working on an update for my latest game.
I shut down my computer normally yesterday, no problems & no errors...
... Today when i logged into Windows & opened my project in Android studio i get this strabge error:
Gradle 'projectname' project refresh failed
Error:Cause: org/apache/commons/io/FileUtils
I don't know whats causing this error...
I can open my old project(game created with libgdx) and it works just fine.
But when i open my recent one it wont compile & gradle wont sync.
Even if i create a new project it will give me the same error.
Google Doesn't say anything about this :(....
what i've done to try fixing:
Reinstalled Android Studio
Removed all Java Version. JDK + JDE.
Updated All SDK, Raspitory, Google Play services, etc..
As my old project was created exactly in the same way & works, i find this very frustrating. The only things that is different from my new project is that my old game is created in an older version of Libgdx, older Version of Android Studio etc...
What's strange is that it all worked just fine yesterday!
Anyone?
i'm desperate. Put so much time into this project!
Try removing downloaded gradle dependencies for org.apache.commons.io from your system and rebuild the project. The downloaded dependencies can be found in .m2 folder (In linux it will be a hidden folder in home directory)

Categories