Reputation: 2334
Every time I try to update Android Studio it downloads and then this pops up:
Internal error. Please report to http://code.google.com/p/android/issues
java.io.IOException: Cannot restart application: Can't obtain static newInstance method for class com.sun.jna.Structure
at com.intellij.util.Restarter.scheduleRestart(Restarter.java:76)
at com.intellij.idea.Main.installPatch(Main.java:184)
at com.intellij.idea.Main.main(Main.java:73)
Caused by: java.lang.UnsatisfiedLinkError: Can't obtain static newInstance method for class com.sun.jna.Structure
at com.sun.jna.Native.initIDs(Native Method)
at com.sun.jna.Native.<clinit>(Native.java:135)
at com.intellij.util.Restarter.restartOnWindows(Restarter.java:106)
at com.intellij.util.Restarter.scheduleRestart(Restarter.java:67)
... 2 more
2014-11-06 14:31:23 [Patch] Original patch exists: C:\Users\Aidan\AppData\Local\Temp\jetbrains.patch.jar.androidstudio
2014-11-06 14:31:23 [Patch] Restarted cmd: [C:\Users\Aidan\AppData\Local\Temp\VistaLauncher8848951449880199676.exe, C:\Program Files\Java\jdk1.8.0_11\jre\bin\java, -Xmx500m, -classpath, C:\Users\Aidan\AppData\Local\Temp\jetbrains.patch.jar.androidstudio_copy;C:\Users\Aidan\AppData\Local\Temp\log4j.jar.AndroidStudio_copy, -Djava.io.tmpdir=C:\Users\Aidan\AppData\Local\Temp\, -Didea.updater.log=C:\Users\Aidan\.AndroidStudioBeta\system\log, -Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel, com.intellij.updater.Runner, install, D:\Android Studio]
2014-11-06 14:31:23 Exception: java.io.IOException: Cannot restart application: Can't obtain static newInstance method for class com.sun.jna.Structure
I always end up downloading the update from the site, deleting the original, then extracting the new version alongside the sdk folder. Is there any way to fix this?
Upvotes: 0
Views: 8174
Reputation: 327
I found the solution
First, you should delete 2 folders C:\Users\USER_NAME\.android, C:\Users\USER_NAME\.AndroidStudio And delete all files in C:\Users\USER_NAME\AppData\Local\Temp
Second, remove and re-install Android Studio
this way works perfectly
Upvotes: 1
Reputation: 2334
Problem solved. Sort of..
Adding the line -Djna.nosys=true
to the studio.vmoptions file in the /bin folder fixed my problem and I am now updated. I found the solution from here: https://code.google.com/p/android/issues/detail?id=78656
Upvotes: 0