I get this error in IDEA, but I don't want to use an Android SDK. I've been able to build and run just fine before, and one day I just opened my project like I usually do, and I started getting this error.
I'm working on a game with libgdx, and I've taken out all android dependencies (in the settings and build files). It has worked just fine before, how do I stop this error from happening?
Also, I can do ./gradlew desktop:build and ./gradlew desktop:run and everything works fine. So I'm guessing it's an IDEA thing...
Edit: In the suggested duplicate, the solution is to add a reference to the Android SDK. I don't want to use the Android SDK, so I can't use the solution on the suggested duplicate.
So I figured it out.
This was an IDEA problem, not a gradlew or LibGDX problem.
If someone wants to use LibGDX but without the Android SDK you need to do the following:
Remove 'android' from settings.gradle
Remove the android macro in the build.gradle
If you get the 'Android Pre Dex' error when trying to run in IDEA, you need to remove all Android references. It was under Project Structure -> Modules, one of the Modules will have an Android reference. Delete it, and you should be good to go!
Related
I downloaded ARCore project and edited the project to run on older devices than Android 7.0 by following some online tutorial that simply editing the manifest file minsdkversion. Then I decompiled the code and signed it with my own debug keys. But all I see is a project without gradle and I am confused with everything at this point.Here is a screenshot of my whole project and gradle settings.
And when I try to run the project, I get this.
So my question is, where is Gradle file? Has anyone tried it and run into this kind of issues?
Do know for grale, but the error you get is the TestRunner, that runs the unit tests, this is not the main application launcher.
I just updated AS since a while and Gradle seems to be broken.
Create a empty LibGDX gradle project with the latest LibGDX setup.
Add dependency to core in build.gradle. Nothing happens, used to get a popup with something like "Sync now" I believe.
Clean project does not seem to do anything. Bottom left says nothing about a recent (un)successful clean.
Rebuild project does not seem to do anything.
Adding jibberish sdfdfsdfsffsd;;;sfes;efs to the gradle file does not change anything. My program still runs, no errors in build.gradle and clean still does not do anything.
Never really had problems with AS and Gradle, it just worked out of the box. Now it seems to be broken but I cannot seem to find anything on the subject. A reinstall might fix things but fixing it without a reinstall would be nice.
Edit
I somehow managed to trigger the gradle sync by closing/opening AS and opening my project again. But now it won't even recognize the LibGDX framework anymore.
Edit
Somehow it seems related with unchecking Android in the LibGDX setup tool. This was no problem in the past for me but once I tried to create a project with the android module enabled it seems to work. My guess is the LibGDX tool messes up somewhere with generating the gradle files but it's still very strange behavior. Perhaps someone could attempt to start a project without the android module and tell me if he is running into the same issues. Note that at first import the default LibGDX program runs fine but importing dependencies through Gradle and restarting AS is causing issues here.
I've looked near and far for an answer.
My libgdx project works great, it compiles and it runs. Android, desktop and IOS (on my mac).
But Netbeans (8.1) shows all my android imports as errors and says "Package Android does not exist" even though it compiles fine.
My project is created with the Libgdx wizard and there for uses gradle.
How do I fix this?
Edit:
I added a workaround! I add the following to my build.gradle file
dependencies {
compile files('libs/android.jar');
}
Reload the project and there! It finds everything!
Then I comment that line out without reloading the project and then the compile works :)
i'm using netbeans for java, and was seeing the same error
for me, after disabling the maven plugin, shutting down, deleting the cache, and restarting, an error dialog popped up saying junit 3.8.2 had been removed and offering to automatically "fix" it. and that resolved the issue
this has the downside that i wont be able to open older versions in netbeans (without jumping thru these hoops every time), making bisects prohibitive
I'm very close to giving up with Android development. I don't currently have an Android phone so I'm trying to use emulators. In Eclipse, after fixing 500000 bugs/errors I finally managed to get an emulator to launch - but it kept getting stuck on the Android loading screen (even after like 45 mins) so somebody recommended me to use Android Studio.
I downloaded this on my PC, and when I tried to run a blank activity I got this error:
When I tried to actually play around with the activity, I got a rendering error:
I saw some stuff online that said to use a downgraded Android version for the error to go away - however, I only have 2 versions as you can see and none of them are working.
I tried downloading/installing Android Studio on my laptop too and got the exact same problems. What is going on? I have spent 2 days trying to run a blank activity now and am really on the verge of just giving up. Any ideas?
EDIT: Trying out Jorge Casariego's suggestion but cannot find Open Modules when I right click
Looks like it happens because you are updated Android build tools to "24.0.0 rc1" but not update gradle build plugin to 1.3.0-beta1 version.
Make sure that you have in yourProjectFolder/build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0-beta1' // or 1.2.3
}
And in yourProjectFolder/mainModuleName/build.gradle you have
android {
...
buildToolsVersion "24.0.0 rc1" // or 23.0.1
...
}
or as a variant use last stable versions of build tools
To downgrade your SDK, you need to download a different SDK version. To do this, you need to run the SDK Manager which is the 4th image from the right:
This will allow you to download different versions of Android, allowing you to get API 19/20/21, which should fix your issue.
I get this rendering problem all the time and I've been developing for almost 2 years now, with over 10 months on android studio. These rendering problems are only for the activity preview, which usually isn't very helpful at all anyway. If you don't have an Android device, my best suggestion would be to download the GenyMotion emulator. It is 1000x better than the built in emulator, and even has a plugin for android studio that allows you to run it from within the IDE. If you need to check how a layout works, I would recommend just running the app in the emulator, as you will get a much better idea of how things look anyway, rather than trying to approximate it with the layout previewer.
Edited 6/10/18:
The packaged emulator has been updated extensively and now performs much better. For that reason, I've removed the link to the 3rd party tool. I realize my intention at the time was to be helpful, but having a link to a 3rd party tool in a stackoverflow question seems inappropriate, especially given the reason for highlighting it is outdated.
To resolve this issue follow the following steps :
Go to your app folder under Navigation section.
Right Click -> Open Module Settings
Set Compile with SDK Version as API 22 or below (Lollipop)
Set Build version as 21.1.2
Clean + Build your Project
to use the new M preview, you'll need to also use Android Studio 1.3 Preview (from the canary channel).
I have this problem too. Because I named my App the wrong thing. It has a "-" character in the app name. Ex: Web-ViewDemo. It causes a wrong location, so android studio can't do anything totally right 100%.
In short, try to rename your app!
I previously had a working android project when I was using IntelliJ IDEA 14. I could run the project by pressing the play button, and it would install and start the application on my device.
I recently updated to 14.1. The code still appears to compile fine, I can see that it generates an APK and I can view it in the output folder (out/production/myapp/myapp.apk), but now I get an error when I attempt to run the project:
Error:No main class for module: app
I've tried creating two new projects, one based on the Android->Application Module template and another based on the Android->Gradle: Application Module template, and both have the same issue - they spit out the error above with the default configuration.
I assume that this must work on other users boxes, particularly because I haven't found anything online or any bug reports about it, but I guess there is a very minute possibility that I'm the first one to find this.
Is this an issue with IntelliJ IDEA 14.1 or just my box? Any ideas on how to fix it or where to start would be greatly appreciated.
I was having similar issue.
Do you have haxe plugin installed? Try to uninstall and try after that and it should work.