Error in android studio while creating a new project - java

I got this error message while I tried to create a new project in Android studio :
Failed to import Gradle project: Error unmarshaling return header;
nested exception is: java.net.SocketException: Connection reset

Go to Gradle
Download last version
Open grandle location within Android Studio (in my case is: C:\Program Files (x86)\Android\android-studio\plugins\gradle"
Important: backup your existing Android Studio gradle lib folder (in case things go wrong, as some of the commenters have pointed out)
Open download file from 2.
Override lib folder within Android Studio with lib folder within downloaded file.

I was the same error, I resolved it with this solution :
Open the SDK manager
Make sure that the "Extras/Android Support Repository" (not just Android Support Library) is installed or updated.
Source: http://tools.android.com/recent/androidstudio020released
I hope this help you

Fix described here workes for me. -Dexternal.system.in.process=true setting is needed in VM options of Android Studio.

Related

Can't install Dropbox plugin for Android Studio

I'm trying to add the latest (v5.1.1) Dropbox plugin to my Android Studio install (Bumblebee 2021.1.1) on Win10. I downloaded the .jar file from releases/v5.1.1 folder to an empty folder, then tried to install it using this method: from the Studio main menu I chose Plugins, selected the gear icon followed by Install Plugin From Disk, browsed to the .jar file location, selected it then pressed OK. I got an error message: "Fail to load plugin from file dropbox-sdk-java-5.1.1.jar". I tried installing the -5.1.1-javadoc.jar file using the same method, with the same result. I don't need the sources, I just want to use the SDK. Any ideas? TIA!
First, I think you meant "Android Studio" instead of "Visual Studio"?
If so, it sounds like you're attempting to install the Dropbox Java SDK as a plugin to Android Studio itself. The Dropbox Java SDK is not an Android Studio plugin though. It is a package for connecting to the Dropbox API from your Java app.
To install the Dropbox package in your app, you should use Maven or Gradle, as instructed here.
The Dropbox Java SDK also comes with an example Android app that uses the Dropbox package.
Thanks, Greg; your answer pointed me in the right direction. I had already added an 'implementation' directive to my Gradle file as per the directions on GitHub. However, I took the instruction to add the directive by editing my "project's build.gradle" too literally; I added it to the Project build.gradle file instead of adding it to the Module build.gradle. Problem solved!

Android Studio Cannot find JAR 'org.eclipse.jgit-4.5.3.201708160445-r.jar'

this error show when I open project on android studio, I already search of solution but not solve the error:
Cannot find JAR 'org.eclipse.jgit-4.5.3.201708160445-r.jar' required by module 'gradle-version-control' using classpath or distribution directory 'C:\Users\***\.gradle\wrapper\dists\gradle-4.4-all\9br9xq1tocpiv8o6njlyu5op1\gradle-4.4'
I had this error too and mistakenly found the answer. If you follow your path in the error you will find the source of the problem.
As it turns out Android Studio is supposed to update Gradle at the same time but it seems for both of us it didn't.
You will need to:
Find the latest verison and download the "complete" Gradle zip.
Extract to the location of your error.
Delete the files in there from previous download.
Launch Android Studio, then proceed to File -> Project Structure -> Project and update the Gradle version number.

Android Studio aapt.exe missing error message after importing cordova project

Error:Execution failed for task ':CordovaLib:processDebugResources'.
aapt is missing on 'C:\Users\rv498\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe'
Hello, I have done importing cordova project to Android Studio before with no problems. My android studio is the latest stable version because I reinstalled it today (3/17/17). Please help thanks.
BTW, the reason I started to import to Android Studio from Cordova is because I was starting get message about gradle wrapper missing from cordova CLI. I suspect this is SDK Manager issue and I went there but after few attempts, nothing really progressed.
-I had same issue so i opened C:\Users\Sheriff\AppData\Local\Android\sdk\build-tools\24.0.2
-i saw aapt2.exe then i changed it to aapt.exe
-Closed my project on the android studio then opened it back it was working perfectly.
Quick solution
check if aapt.exe is in fact missing C:\Users\rv498\AppData\Local\Android\Sdk\build-tools\25.0.2\
it's there? echeck perms, check %PATH%
it is not there? find where it is. Copy it to the location above
of check why it looks for it in that place. Is there's any config file that got the above path? If so, edit it.
aapt.exe file moved to the latest sdk build tools folder
I just found aapt.exe file in my latest Android-SDK folder (Android_SDK\build-tools\28.0.3)
You can check your latest sdk build-tools folder
or
You can search on total Android SDK folder by file name

Android - Eclipse project making and R file error

I'm having issue with Eclipse and I work in android. This issue happens when I create a new project and when I click finish, It auto generates the project without R file and The project creating window doesn't closes and I have to close it. I have many old projects which work fine(Until now) and the issue is only coming when I make a new project. I also get a error in Styles.xml file saying that "Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'". When I press CTRL+RightClick onto R file then it takes me to a window which says "Source Not Found". If you have any solution for this, Please post your answer under this question. Thank you!
EDIT: Appcompat error was solved later.
To solve missing R in generated java files, make sure that Android SDK Tools and Android SDK Build-tools are installed and updated in SDK Manager. Then, make sure Eclipse is updated. After this, clean your project and rebuild.
To solve No resource found "...AppCompat...", make sure Android Support Library is installed and updated in SDK Manager. Then, the AppCompat library can be found at:
android-sdk/extras/android/support/v7/appcompat
You need to reference this AppCompat library in your Android project.
Import the library into Eclipse. To do so:
Right click on your Android project. Select properties. Click 'add...' at the bottom to add a library. Select the support library. Finally, Clean and rebuild your project.

Gradle Android Build Project Error: Could not find meta-data resource

Brand new install of the Android SDK, and Android Studio. Brand new project, literally no changes to any file in the project. Working AVD, running 4.4.3 (or something similar). I get the following error:
Gradle 'Gigviz' project refresh failed.
Error:Could not find meta-data resource 'META-INF/services/javax.xml.datatype.DatatypeFactory' for service 'javax.xml.datatype.DatatypeFactory'.
The best reason I can think of for this error is that I'm missing some component of the javax.xml.datatype.DatatypeFactory dependency. Has anyone encountered this error before?
I'm on OS X Yosemite, latest version of Android Studio.
Download this : http://www.java2s.com/Code/Jar/j/Downloadjavaxxml134jar.htm
Put it inside your JDK folder, in your program files. Something like this :
C:\Program Files\Java\jdk1.8.0_31\lib\missioncontrol\plugins
And see what happens.
Found this on Gradle's forums, same error cause by a duplicate set of jars, inside the JDK's lib/endorsed folder. Usually when I get any build errors with META-INF in them, it is because a duplicate files somewhere. Also make sure you are using Java 1.7 or lower.

Categories