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?
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
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
Related
I can use Android Studio at beginning when I first installed it. But the below issue showed up when I set SDK environment to the SDE zip folder. I can't open Android Studio at all afterwards and this issue shows up every time.
https://code.google.com/p/android/issues
Error:
Internal error. Please refer to https://code.google.com/p/android/issues
Stacktrace:
java.util.concurrent.CompletionException: com.intellij.diagnostic.PluginException: Fatal error initializing 'com.android.tools.idea.AndroidInitialConfigurator' [Plugin: org.jetbrains.android]
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1739)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)
at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
I've tried to add 'disable.android.first.run=true' to idea.properties.
I also tried'netsh winsock reset' in the terminal under Administor.
These two ways all failed. It can open at the beginning. Just after setting the SDK environment.
I'm using Android Studio 2020.3.1 Patch 4(at 01-19-2022), Gradle 7.0.2. Java 11 Kotlin 1.6.10, mac Pro 16 m1 arm64(2021)
I'm new in macOS, jumped from Ubuntu, and found issues. I'm working with different projects and all time when I'm trying to switch to another one, I have the next error:
Gradle could not start your build.
Could not create service of type ResourceSnapshotterCacheService using
GradleUserHomeServices.createResourceSnapshotterCacheService(). Timeout waiting to lock file hash cache
It sometimes happens when I'm trying to run or sync the same project.
Solution as find ~/.gradle -type f -name "*.lock" -delete not useful because I run it all time when I complete changes on sdk project and test it on another one. Relevant solutions like kill not useful too
I hope, somebody has a solution for that. Thank you :)
Error text:
Gradle could not start your build.
Could not create service of type ResourceSnapshotterCacheService using GradleUserHomeServices.createResourceSnapshotterCacheService().
Timeout waiting to lock file hash cache (/Users/{user}/.gradle/caches/7.0.2/fileHashes). It is currently in use by another Gradle instance.
Owner PID: 73387
Our PID: 73419
Owner Operation:
Our operation:
Lock file: /Users/{user}/.gradle/caches/7.0.2/fileHashes/fileHashes.lock
I'm new to NativeScript and took over a project recently upgraded from NativeScript 4 to 6. Here is my environment detials:
Windows 10
Node v16.6.1
NativeScript 8.0.2
Android Studio 11 (with al
the recommended updates to date)
VS Code 1.58.2
I can create a new Native script project with "tns create" and build/run it in the simulator just fine. However, when I try to run the project the build throws the following error:
java.lang.RuntimeException: Class not found android.support.v4.view.ViewPager.OnPageChangeListener
at org.nativescript.staticbindinggenerator.Generator.getClass(Generator.java:551)
at org.nativescript.staticbindinggenerator.Generator.getInterfacesFromCache(Generator.java:534)
at org.nativescript.staticbindinggenerator.Generator.writeBinding(Generator.java:283)
at org.nativescript.staticbindinggenerator.Generator.generateBinding(Generator.java:171)
at org.nativescript.staticbindinggenerator.Generator.processRows(Generator.java:234)
at org.nativescript.staticbindinggenerator.Generator.generateBindings(Generator.java:121)
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:97)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:55)
Here is the run command I'm using: "tns run android --emulator"
I have tried tons of things and searches but no luck resolving this issue.
So I had an idea and searched with a different search engine than I normally use. I did find some ideas which helped me resolved the issue.
I had previously searched in VSCode for variations on "android.support.v4.view.ViewPager.OnPageChangeListener", but only found the log file with the error. Then I learned you have to change the filter options of the find in file search otherwise the files you are looking for can be excluded from the search results. I also used Baregrep to confirm I was getting everything.
I fixed the issue by replacing all occurrences of:
android.support.v4.view.ViewPager with androidx.viewpager.widget.ViewPager
Also you may need to install widgets:npm i tns-core-modules-widgets
Since the files where I made the changes were all non-project files (many of them in the node_modules directory) there is probably something else that involves updating Node or NativeScript that may solve this as well.
If someone else figures that out, I'll be watching this thread for updates, and thanks in advance!
Fissh
I am trying to implement firebase with xamarin.android but after downloading some nugat packages I started getting different errors and the latest one is as below:
Severity Code Description Project File Line Suppression State
Error The "XamarinBuildAndroidAarProguardConfigs" task failed unexpectedly.
System.IO.InvalidDataException: Central Directory corrupt. ---> System.IO.IOException: An attempt was made to move the file pointer before the beginning of the file.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.SeekCore(Int64 offset, SeekOrigin origin)
at System.IO.FileStream.Seek(Int64 offset, SeekOrigin origin)
at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
--- End of inner exception stack trace ---
at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen)
at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding)
at Xamarin.Build.Download.XamarinBuildAndroidAarProguardConfigs.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() FireBaseSolution
android target framework : 25
Some of installed references :
Xamarin.Android.Support.v4
Xamarin.Android.Support.v7.AppCompat
Xamarin.GooglePlayServices.Base
Xamarin.Firebase.Messaging
Please guide me how to resolve it.
Thanks
For me the solution was in downgrading version nuget package "Xamarin.Build.Download" to version 4.4
Answering on an old question, but this may help others if they ended up in the same situation as me (not being allowed to modify the version of Xamarin.Build.Download), here's how I fixed it:
I deleted the folders for C:\Users(username)\AppData\Local\Xamarin and C:\Users(username)\AppData\Local\XamarinBuildDownloadCache and rebuilt my solution.
What I found was that evening using the NuGet cache clearing tool in Visual Studio, these directories remained untouched.
I can only surmise that this issue can also be caused by file corruption (I might have had a faulty network connection), and the DownloadCahe blocked attempting to get the "clean" files.
On MacOS I had to wipe all folders concerning Xamarin in "~/Library/Caches". Afterwards it would build fine.
I get this message all the time on my error log:
Could not create the view: Could not initialize class com.ibm.icu.impl.JavaTimeZone.
This situation its bad: each time when I try to open a class I get this message.
What should I do to solve this problem?
see this buddy:What does "Could not initialize class com.ibm.icu.impl.JavaTimeZone" mean?
It could be not related to android, but to your Eclipse version and current platform.
In case it is relevant, the blog post "Could not initialize class com.ibm.icu.impl.JavaTimeZone Error" (by Derek Helbert) could be helpful.
(But only for Eclipse 3.6 on MacOs)
If you are having a serious pain trying to run Eclipse Helios in Mac OS x 10.5.8 and keep getting errors such as the following:
java.lang.NoClassDefFoundError
--or--
An internal error occurred during: "Could not initialize class com.ibm.icu.impl.JavaTimeZone error".
Here is an easy solution:
Edit eclipse.ini with your favorite text editor and add a line at the end "-Dcom.ibm.icu.util.TimeZone.DefaultTimeZoneType=ICU".
It's inside Eclipse.app/Contents/MacOS/eclipse.ini.
Another solution is the following:
Decompress the com.ibm.icu_4.0.1.v20090822.jar file in the eclipse/plugins folder to any directory you like.
If you cannot find the exact version, just decompress the IBM ICU JAR that's shipped with your version of Eclipse.
In that directory, open the file com/ibm/icu/ICUConfig.properties
Replace
com.ibm.icu.util.TimeZone.DefaultTimeZoneType = JDK
with
com.ibm.icu.util.TimeZone.DefaultTimeZoneType = ICU
Recompress the com.ibm.icu_4.0.1.v20090822.jar file in the eclipse/plugins folder with the modified file
However, it has been pointed out that editing the jar makes it unsigned.
Ran into the same problem with Ubuntu 12.04 and fixed it with:
apt-get --reinstall install tzdata-java