Android Studio - package java.awt.image does not exist - java

I have a problem running my project on Android Studio. I am working on an Android project that has a native Java library inside it. It was running fine all the time. But suddenly when I open Android Studio, I find this error:
There is also an error in the .gradle of the project:
It says that URI is not registered.
When Android Studio is started, I find this message:
It seems that there is something wrong in Java configuration, but I can't find out what is the problem?

It was running fine all the time
Not on Android, it wasn't.
It seems that there is something wrong in Java configuration
No. You are using classes that are not part of the Android SDK.

The java Swing and AWT API are not part of the Android SDK and thus aren't including with it. You must find an Android equivalent image library to use in your app. There are few good ones around just depends on what functionality you need to have available to you in you app. Try searching Picasso and or Volley. Picasso is very popular and well known. it has a lot of feature including networking functionality for loading images from the web. The Volley library isn't an image library but an networking library that contains some predefined classes for loading images over the internet.

So this just happened to me. I'm not 100% on the details of how I got it working again, but its roughly this (on my Mac):
Quit Android Studio
I went to ~/Library/Application%20Support/ and deleted the AndroidStudio3.2 directory
I relaunched Android Studio and I got some warning dialog about plugins not existing.
Chose the button that is something about reinstalling or fixing (or whatever isn't deleting or ignoring)
Another dialog comes up. There are a bunch of plugins that are in red. Deselect all the red ones. Then reselect all those ones that were previously red.
Android Studio asks you something and if you want to restart Android Studio. Pick the thing that includes restarting.
And once Android Studio restarts, chose to rebuild your project, and then it worked.
Good Luck and I hope this works for you too.

Related

Eclipse Programs to Android Studio

Is there any way I can call .java files from eclipse to programs in android studio and have that code be run from android studio? I cannot have the code directly copied into android studio as it brings up multiple issues. So I am wondering if there is some way I can call the .java from Eclipse, get the result from the method within that Eclipse program, and pass that result to android studio.
Any help would be greatly appreciated!
Very simply, no you can't "just call" code from another IDE.
You could export the Eclipse code to a JAR, import as a library into Android Studio, then try to work around that, but that sounds like a lot of work.
In regards to your previous questions, plus your comment.
it was working in eclipse, but when I literally copy and paste that exact same code into android studio, I am getting network issues when I run it.
Android has a UI Thread that does not like to handle Network requests like your bare single-threaded Eclipse project.
You need a separate thread. Without any libraries, there is AsyncTask, and the Android documentation covers this.
Though, you may find OkHttp to be better documented, useful, and less confusing than AsyncTasks. Volley is another, though works fine, is not very well documented.
See more discussion at Comparison of Android networking libraries: OkHTTP, Retrofit, and Volley
No, This is not possible way to do. Android studio and eclipse are different Applications and you cannot pass the Result to each other.
You can import the project or copy the files for a new Project.

is there a way to open a LibGDX project without the SDK?

i want to open a LibGDX project but it makes me put the location of the SDK. i have the SDK but it gives me bugs (look at this post i did, maybe you can help also there bugs in eclipse after installing LibGDX) and it is uncomftorable to use. so is there a way to use my phone without giving it the location of the SDK?
btw i'm working with eclipse.

Hot code swap in Android Studio with libgdx

I am using Android Studio (IntelliJ) to program Android apps and am facing a problem with hot code swapping and libgdx.
When I run the desktop application in demo mode everything works fine. If I try to change a bit (e.g. the color of an element) nothing is refreshed in the application. Even if I select Run->Reload changed changes a new gradle build is started (takes very long) and then says couldn't find any changes.
I have imported the same sample application in eclipse. There I can just change something in the code and it is immediately shown in the running app.
Anyone else experiencing this issue? Why is this not possible in IntelliJ?
Unfortunately, hot swap debugging does not appear to work when using the Gradle template.
It is actually possible as specified here, you need to disable the Android Support plugin if you want hot code swap to work with Gradle and libGDX.

Making apk from jar using microemulator

Well i `ve made an app using java me and as graphics i used lwuit library which i added into the midlet`s jar. On Nokia it runs smooth and i wanted to port it to android. So i found out about microemulator http://microemu.blogspot.ro/2008/11/running-java-me-applications-on-android.html and i followed those steps and i got the apk. However when i run it into the Android Emulator it closes at start. I don`t know what may be the problem because i was able to convert the demo jar app into apk and it ran succesfuly.
Any ideas on what should i do?
I suggest you port your application to Codename One which should be pretty simple. It has proper Android support which will make your application look and act native on Android.

Android AndEngine: java.lang.IllegalArgumentException: No EGLConfig found

I'm doing a REALLY simple app, a basic hello world to test AndEngine and I am currently having some problems when running it:
I set my emulator properties as RealMayo suggests in his videos and it should work but I get this error instead
07-23 13:10:23.014: E/AndroidRuntime(1485): java.lang.IllegalArgumentException: No EGLConfig found!
Anyone has encountered the same situation, or may know how to solve it?
I am almost tempted to not us AndEngine at all... as a simple app has been really difficult to run.
NOTE: I have found some posts but they are at least 3 months old and the use of emulators has been fixed not long ago.
Anyways Thank you! :)
make sure your AVD is at least Android version 4.0.3
see this thread http://www.andengine.org/forums/gles2/api-level-t8230.html
just to add a small addition to the answer above (answer #1): make sure along creating an AVD with API level 15 (Android 4.0.3), that imported AndEngine library's project target is also built with Android 4.0.3. To validate: right click on AndEngine library in eclipse project, choose "properties", in the left pane of opened window click on "Android" label; in right pane verify that "Android 4.0.3" checkbox is checked. If "Android 4.0.3" option is not listed there, just import it with Android SDK Manager.
The comment from Ravikumar11 about GPU helped me get this resolved.
Additionally, I had to:
Update the SDK with all options for my current API (17) and the general tools (binary downloads that are not API-specific)
As eclipse suggests after SDK update, run Check for Updates in eclipse and a bunch of stuff gets loaded subsequently
From there, I was able to run my AndEngine app in the emulator

Categories