I'm struggling with a Gradle: : java.lang.NullPointerException message each time I restart Android Studio. The solution is to remove all facets from the Modules section, add them once again and rebuild the project. The problem is I have to do this each time I launch Android Studio along with my project. How do I solve this problem?
The project was imported from an Eclipse project, and Gradle is configured probably fine (I'm using a local distribution and have set path to its directory).
Other questions did not seem to address the reoccurence of this problem.
Android Studio is an early access preview, and bugs are to be expected. Best chance to solve the problem is to file an issue with an exact description.
Related
I am using Android Studio 3.2.1. This error, where the R class is highlighted in red, says Cannot Resolve R, but the app builds and runs just fine, there are no errors in compilation, it just shows R as unresolved reference in the IDE.
This problem only happens in one project that uses Kotlin, and all the other projects open and work without any problems.
I went through most solutions in stackoverflow and that didn't solve the problem.
I'm using ubuntu and it works on other windows pc. Could there be a problem in ubuntu.
These are the solutions that I have tried
clean project
rebuild project
make project
invalidate cache and restart
sync project with gradle files
updating sdk files
updating dependency
recloning the project
checked all my xml files
Kotlin plugin was updated
snapshot
xml snapshot
The issue still persists. Please let me know if any other details are required.
Thanks.
Just try reinstalling it
Hope it works :)
this problem with the android studio itself try to clear cache and restart from file --> invalidate the cache and restart if still not working reinstall the android studio and open the project from the beginning
I recently installed Android Studio on my Desktop running Ubuntu 17.10. However, when I open any Android Studio Project or even create a new Project, while editing XML files, it wrongly displays an "unknown attribute" error. Normally, I wouldn't care, but this causes Android Studio to not give any suggestions for attributes which I need.
What I've tried:
Invalidating cache
Deleting the .iml file and rebuilding project
Rebuilding and cleaning project several times
Deleting gradle's cache
Updating Android Studio (Current Release is Android Studio 3.1)
Here is a screenshot of what's happening
Try doing a gradle sync. It should resolve the problem
I´ve tryed all the solutions but the only thing that worked for me was 4gus71n's answer.
Deleting the C:\Users.AndroidStudio3.2\system\caches folder solved my problem.
Link to his answer: https://stackoverflow.com/a/53160674/6568421
Use project's SDK not Android's SDK. You can edit SDK Location in local.properties file
I had faced similar issues and all the above also did not worked for me.
If all else failed, do a clean install of android studio. You need to do a clean installation because if you just uninstall and install again, some of the files still remains in your system. It did not work for me when i just uninstall and install android studio. The clean install worked for me and I believe it should solve most of the problems.
I faced this error probably because i installed an entire android project but I am not very sure what is the exact error that caused this problem.
For clean installation, you can look at this links for windows and mac
How to completely uninstall Android Studio from windows(v10)?
How to completely uninstall Android Studio on Mac?
I opened up Android Studio today and for the first time I saw this error:
Error:Cannot find JAR 'core-3.1.1.jar' required by module 'gradle-jetty' using classpath or distribution directory '/Applications/Android Studio.app/Contents/gradle/gradle-2.14.1'
I have tried, restarted both my Mac and Android Studio but yet I still get this error. Can anyone help me?
I had the same problem, follow the answered detailed here to uninstall, and then just re-install. Before importing any existing projects just create a dummy project to ensure that everything finishes installing correctly.
Then simply just tell your antivirus that the project folder for android studio is excluded from the virus searches.
It turns out my antivirus had removed the file.
An uninstall and fresh install of Android Studio was able to solve my problem.
I have the same problem. Yeah, my Antivirus deleted the file too but it's seem uninstall and re-install Android Studio didn't work for me.
After re-install Android Studio, I can work normal with 1 project but when i try to open other project even create a new one, the 'core-3.1.1 jar' error show up again.
Just remove ./gradle folder compeletely.
Let Android Studio install Gradle from new or do it yourself.
I'm having an issue importing my PhoneGap project into Eclipse. I imported my project using the existed android code option but when I import, I am receiving hundreds of errors. My build will not run because of this. I believe it is trying to call in Cordova Library that isn't found but I have included it in my project. Can anyone assist me with this problem?
It seems like Eclipse doesn't even recognize your projet as an Android projet.
Check if your projet use Android SDK.
I had the some similar issues with Eclipse, then I moved to Intellij IDEA and that mostly solved all my problems.
Since last android studio (1.1.0) update I have one issue with Jsoup(1.8.1) Gradle and it compilation.
When I import jsoup.jar in the projects I receive a message that said
To fix this problem. I have tried:
-I try click on "Add now..." but dont fix the issue.
-Clean project.
-Rebuild project.
-Close and open Android Studio.
Nothing have worked.
Any ideas?
Thanks.
Update 1: I have updated to android-studio Beta(1.2) and now works fine. But i want use android-studio Stable version.
I had the exact same problem. On Mac OS X 10.10.3, upgading to version 1.2.2 of Android Studio solved this problem for me. I used option-return key press while hovering over the class name I wanted to reference and that caused Android Studio to add the appropriate import. Auto-completion seems to work as well in the IDE.