I'm a newbie in Android Development. And I have this one tini-tiny problem which I'm not able to fix it. Every time I run configurations, and browse the Project name, the Project selection is empty and I cant click on any on it except the "Cancel" Button. Then I can't really launch my project. How does one fix this?
Right click on your package in the Package Explorer, click Properties, and see if you're using any libraries. Make sure that the "Is Library" box is not ticked on your project.
In my particular case I had a Maven Project Loaded into Eclipse Mars, and when I tried to run a specific main class, the project itself didn't appear in the Project List under:
Configurations -> Java Application -> Project -> Browse...
What I did was just to convert the Project to have Facets... in the Project Properties:
Main Menu -> Project -> Properties -> Project Facets
Once I did it, just selected Java and the version I needed and it started working.
In the Java Perspective choose the Run menu and go to Run Configurations
Select the item in the list titled "Android Application" and press the plus/add button.
On the next page, choose the Browse button and choose the Android App that you'd like to run.
I had the same problem and found I hadn't put the project name in Project textbox, in the first tab.
Related
I was programming a fabric minecraft mod in intellij and when I ran the code it said :
Could not find or load main class net.fabricmc.devlaunchinjector.Main
When I compiled the code and tried it in minecraft it worked, but in intellij i couldn't run it.
I was messing around with the files, to see if I can fix it and I found a solution :
Go to "Run Configuration", press the arrow to see the options and tap "Edit
Configurations"
Go to "Minecraft Client" and press the button next to
"net.fabricmc.devlaunchinjector.Main"
search trough your external libraries and find "net.fabricmc.devlauncherinjector.Main"
(it must be right under net.fabricmc-api...) select it, and after that you should see
the "Edit Configurations" window. Press "OK"
If this doesn't work, right click the file and select "Copy Full Path". Then go to
"Edit Configurations" window and paste it where it says
"net.fabricmc.devlauncherinjector.Main"
If the 2 option doesn't work either, close the project, copy the mod folder, and paste
it somewhere else(eg. Desktop, New Folder). And then open your IDE, go to open project
and select the copied folder. Press the "Build.gradle" file and select open as project
and "Trust" .It should now work. If it doesn't , unfortunately I don't know how to fix
it.
thecoopsyt's answer worked for me.
Go to Gradle tab > Reload All Gradle Projects
Wait a few mins for it to check and update your dependencies.
After this I was able to return to testing my project in Intellij... had to fully compile and test before this fix.
In Intellij gradle if
this doesn't work you can put
downloadAssets runClient into a gradle config and it will start a client and download the net.fabricmc.devlauncherinjector.Main
this allows you to use gradles built in Minecraft Client
I am using Eclipse (Version: Kepler Service Release 1). When I have a file open, I can right-click, select Source, and select Organize Imports. However, when I click the project or a folder within the project, this option does not show up. The only option that shows up on the Source menu is Format. Ctrl-Shift-O also does not work.
My project is in the buildpath and the project compiles. And, another developer on my team with the same configuration sees the same behavior.
Thanks in advance for your suggestions.
You should use Package Explorer for that. If it is not visible, open it from Window -> Show View -> Package Explorer.
Then you can either perform Ctrl+Shift+O on the project, or via right click -> Source -> Organize Imports. You can do this on packages, as well.
I created new libgdx project and i want to run desktop application in Android Studio. Is there something to do with run configurations? In Eclipse i can just choose Run as Java Application.
Ok, i did it. Here is the solution https://github.com/libgdx/libgdx/wiki/Gradle-and-Intellij-IDEA#running-your-project
Run -> Edit Configurations..., click the plus (+) button and select Application.
Set the Name to Desktop.
Set the field Use classpath of module to desktop, then click on the button of the Main class field and select the DesktopLauncher class.
Set the Working directory to your android/assets/ (or your_project_path/core/assets/) folder!
Click Apply and then OK.
You have now created a run configuration for your desktop project. You can now select the configuration and run it.
Right click on the main method (or anywhere in the main class) and select Run.
I followed the following tutorial http://developer.android.com/guide/developing/projects/projects-eclipse.html
and I have 2 projects : the starter project and the library project. Most of the source code is located into the library project
When I debug the android application and when I place a breakpoint into the java, the breakpoint work but it jump in the class file located in Library project folder (of the starter project).
I would like to stop in the java code, so I don't have to switch between the source and the compiled code and so modify the source. Is it possible ?
regards
Here is what worked for me:
(After having clicked debug at least once before)
Open the debug view in eclipse (use the menu at the top: Window -> Show View -> Debug)
Right click one of the activities in the debug window "Edit source lookup"
Click "Add"
Select "Java Project"
Check the box for the Android Library project
Press OK
In my case, the solution was:
Open the debug view in eclipse (use the menu at the top: Window -> Show View -> Debug)
Right click one of the activities in the debug window "Edit source lookup"
Check the "Search for duplicate source files on the path"
jhnclvr's aswer lead me to this dialog
I am trying to run my project, but Eclipse is saying I have errors. But there are no errors, just a red cross where the project name is. I have tried deleting the R.java and generating a new one, but that didn't work.
Take a look at
Window → Show View → Problems
or
Window → Show View → Error Log
Based on the error you showed ('footballforum' is missing required Java project: 'ApiDemos'), I would check your build path. Right-click the footballforum project and choose Build Path > Configure Build Path. Make sure ApiDemos is on the projects tab of the build path options.
This happens from time to time in Eclipse. In the "Project" menu there's a "Clean" option, that usually takes care of the problem.
Go to project>clean and select the project which display error from check box and click ok , it will clear the error for you.
Click the tab which display build automatically in the project menu
And if this also does not work than restart the eclipse and try again it will work.
For me, this happens with Maven and Eclipse/STS whenever I update my IDE or import an existing Maven project. Go to the "Problems tab" (Window -> Show View -> Problems) and see what it says. Recently, the problems tab showed Project configuration is not up-to-date ... and suggested that I use Maven to update my project configuration, and this solved the "red X" problem. To do this, in the "Project Explorer" view, trigger the context menu and select Maven -> Update Project, as seen in this screenshot:
If you see the error in problem panel it will say : Description Resource Path Location Type
Project configuration is not up-to-date with pom.xml. Select: Maven->Update Project... from the project context menu or use Quick Fix.
Solution : Right click on project > select : Maven->Update Project
Error gone.
Right Click on Project -> Build Path -> Configure Build Path. Check if Maven Dependencies is there in list, if not then update maven project by
Right Click on Project -> Maven -> Update Project
I had a red X on a folder, but not on any of the files inside it. The only thing that fixed it was clicking and dragging some of the files from the problem folder into another folder, and then performing Maven -> Update Project. I could then drag the files back without the red X returning.
Ensure you have Project | Build Automatically flagged. I ran into this issue too and turning that on fixed the problem.
I just removed all the private libraries in JavaBuildPath and added the jars again.. It worked
I came across the same issue while working on a selenium project(maven). The Project folder and pom.xml were showing red cross symbol. This was coming as i had the test datasheet open. I could remove the error by just closing the datasheet and the never faced the issue again
In my Spring Boot application, I right-clicked on my Application class -> run as -> Java Application -> Proceed(All errors will be cleared)