Today I downloaded the new stable version of Android Studio 2.2.
I want to using c++ debugging in my Android Studio Project.
When I start a new project, with the Include C++ Support selected within the wizard, I am able to create a hello-jniString program which debugs exactly as expected; both java and c++ breakpoints are hit..
However when open an existing project, click the project in the project panel and click "Link to C++ project". It seems to link and compiles changes well ... however, when I try to debug only Java breakpoints are hit :(
Any help into this would be greatly appreciated .. completely baffled at the fact that no real support/documentation exists for debugging ndk and that c++ ndk integration is so all over the place when Android seems so mature ..
I had slightly different case (debugging jni of library module, built by cmake), but you may try this.
Run > Edit Configuration > select 'Debugger' tab
add symbol directory of your debug symbol placed.
in my case, that was LIB_MODULE/.externalNativeBuild
I can debug c++ now but still finding how to turn off optimization option.
Good luck!
Following up on this incase someone comes by this,
I had to migrate Android/Application mk files to CMakeLists.txt.
Linked to c++ project within android studio, and 9 months later ... at last ... debugging capabilities
I am running on OSX 10.9. I have downloaded Play 2.2.1 and want to use IntelliJ 12.0.4. for development.
I set it up by running play in the directory of the project followed by idea with-sources=yes followed by a compile.
I can run the project from the terminal and from IntelliJ without any problems. All the changes I make to the files are reflected in the browser when the project is recompiled.
What troubles me is that IntelliJ cannot resolve the views which makes its auto-complete function useless. The error is "Cannot resolve method ok(?)/Cannot resolve symbol index".
I have read a great deal of material on the matter but to no avail. I would be grateful if anyone points out a step I am missing.
I have had this problem on occasion; unfortunately I can't reproduce it now with any of my Play 2.2 projects, but I remember having to do this to get the views to resolve:
Go to the Module Settings for your project in IntelliJ (select the top-level, hit F4)
Choose the Modules item in the Project Structure window that appears
Select the <projectname> item (as opposed to the <projectname>-build) item
Add the compiler's output views directory to the Source Folders items;
I'm in Scala so for me it's target/scala-2.10/classes/views
I'm sure it'll be something fairly similar in Java - probably target/classes/views?
I personally find the IntelliJ UI for this to be very non-intuitive; you might need to take the target directory and/or one of its subdirectories out of the Excluded Folders first
After applying that change, IntelliJ should see those view files as just-another source file, so auto-complete should work for them.
Also it might be that the Intellij you are using is not the Ultimate Edition.
The community edition does not support Play Framework versions lower than 2.4.x
look for 'play' here: https://www.jetbrains.com/idea/features/editions_comparison_matrix.html
I know this question has been asked before and I have seen a plethora of solutions out there, yet none seem to work for me. I was able to build my apk without issues until this error started cropping up. I have tried cleaning my project, removing it from the workspace and reimporting it, removing "Java Builder" from my Builders for the project, building the project manually, reordering my java build path. I have no visible compiler issues and no problems exist in my workspace.
I did experience this issue before and solved it once by removing the project form my workspace and re-importing it and another time I solved it by removing "Java Builder" from my java build path. None seem to work this time. I currently have most of the settings set back to default (i.e. java build is checked again).
I am running windows 7 (64 bit) and using jdk1.6.0_21 via Eclipse 3.6.
Any suggestions would be greatly appreciated as I have lost loads of development time troubleshooting this already.
[Update] My locale is English & I have tried removing the debug.keystore, United States as related to issue 834
Please follow these steps; this might help you out:
Right-click your app project and go to Properties
Select Android from left-hand side list
Uncheck the "Is Library" checkbox
If your app project relies on library projects which are in your workspace, those of course need to have the "Is Library" box checked.
deleting the R.Java file in /Gen folder did the trick for me
I tried all the above solutions. but it didn't work.
The solution was to restart eclipse !!!!!!!
hope this will help someone :)
In my case this problem started after eclipse updated the plugin with the v4.0 API release. I fixed it by going to the main preferences for Eclipse and under Android->Build uncheck 'Skip packaging and dexing until export or launch'
Note: if you eclipse gives you the Unknown Command 'crunch' error then follow this post
I've tried to gather the best of other peoples answers into a step by step list of things to try in order:
Check the project is not set as a library:
Go to Project->Properties
Select Android from left-hand side list
Uncheck the "Is Library" checkbox
Clean and rebuild the project - this should delete and recreate the entire gen folder, including the R.java file mentioned in some peoples answers
Check eclipse and all the Android plugins are up to date
Close the project, exit Eclipse, reopen eclipse, reopen the project.
Go to Java Build Path > Projects and check for any incorrect project dependencies
Go to the main preferences for Eclipse and under Android->Build uncheck 'Skip packaging and dexing until export or launch'
Check JAVA_HOME is set correctly. Follow the steps in this article
If you complete the above list, and still haven't solved the issue, please leave a comment, or if you find something else that works, feel free to edit the answer and add your thing in.
Delete the project from your workspace & import again.
This worked for me.
Can't believe similar issue has been there since 2008.
http://code.google.com/p/android/issues/detail?id=834.
i'm no expert, but eclipse on Windows, doing android apps, refuses to create the default.properties file (in the app root directory). I've just copied one from another app and it works fine. Simple contents, for Android 2.2 project it just says (ignoring comments):
target=android-8
fwiw
I was having the same issue as the OP except that all these suggestions did not work. I found a solution for me.
Make sure that "Skip packaging and dexing until export or launch." is selected.
Go to Window -> Preferences -> Android -> Build. Just make sure that option is selected and apply.
I know this does not make a lot of sense, but having it unselected was giving me this error and with it selected it goes away and the apk is installed.
I am using the auto generated ant build script from android and ONLY using it as my build process in eclipse. I am not using any other build methods.
I figured it out. I was referencing JavaSE-1.5 and using JDK 1.6. I changed it to use 1.6 and that appears to fix it.
Seems like through my research that is an overloaded error message that covers a lot of error cases.
I just fixed this by reselecting a default JRE for the execution environment (JRE6 for JavaSE-1.6 in my case). It got unchecked for some reason.
This fixed my problem. I kept getting the console error in eclipse "Could not find com_android_vending_licensing.apk" and even though it didnt seem to effect the way my app ran, it was annoying. So going into the com_android_vending_licensing project properties and unchecking the "is library" option, building the project to produce the needed apk and then going back into the com_android_vending_licensing project properties and re checking the "is library" check box fixed the problem.
Run Eclipse as "Administrator" and then import the project.
None of these things worked for me. I'm trying to access native code through the jni, first with NDK samples. What I found was the build won't run if jarlist.cache is not present in the project bin directory. If I copy one from another project to that location (may need to refresh to see the folder in Eclipse), build works every time.
Clean the project and it will do. Sometimes it happens unknowingly but keep trying to solve using diff methods.
I had somehow done a Run configuration as a Java application instead of a Android.
the problem for me was I was trying to use IBM RAD which appears to not work properly for this, I installed Eclipse and now have a different error but I should be able to get past it
On my machine (Windows7, 64bit) I could fix this by setting my execution environment to a 32bit variant of the jdk (I used 1.6.0_23). And I tried a lot of things before...
SHA1's answer did it for me: after updating to the latest sdk/adt, my project refused to build an apk; unchecking the option resolved the issue.
I don't know if the update checked this, or if it was checked before but the new adt screwed things up, but things work again now :)
In my case this worked :
Delete R.Java file in /Gen folder
+
Delete all "R.Android" imports that Eclipse added to some of my java classes !!!
and rebuild the project.
remove -- R.java -- Clean the project and run again.. this worked for me ..
Find the project's folder in your system, enter it's Properties via context menu and deselect "Read only" option. Worked in my case.
This seems to be the source of the problem in many cases, moreover some solutions up there base on copying/rewriting the files in the project what makes them non-read-only.
This is caused by JAVA_HOME not being set correctly. It can be easily resolved by following the steps in this article.
Mine was caused by this problem (incompatibility between ADT and SDK), and was fixed thus:
Eclipse > Help
Install New Software
Add 'https://dl-ssl.google.com/android/eclipse/' to 'Work With'
section and press enter
After developer tools appears on the list, check it and click Next
Restart eclipse once download is finished
I my case, I had to switch from API 21 to API 19, clean and build and everything was fine again. I am using a Mac and apparently API 21 is not fully supported on Yosemite.
I'm following this tutorial about using Google engine API to create web application.
When I add any file with .jsp suffix into my war folder the project will not compile any more.
What can be the reason ? If you need more information please just leave some comment. Thank you.
Can it be that I it cannot compile because I did not download "Eclipse for Java EE developers" but only "Eclipse for Java developers" ?
I'm not sure. I see <Java EE> in the title bar in your Eclipse screenshot which is typical for Eclipse for Java EE developers. So you have likely the right version. If you are able to do File > New > Dynamic Web Project then you definitely have the Java EE version or at least the one with WTP. More detail can be found in Help > About Eclipse.
the error in Markers tab is "Your project must be configured to use a JDK in order to use JSPs"
You need to install the JDK. Go to the Java SE download home page and click the leftmost one of the four big buttons. Done that, go in Eclipse to Windows > Preferences > Java > Installed JREs, select the existing JRE, click Edit and let the JRE home path point to the JDK folder.
It it asking you if you want to run even though it found errors in the project. First, what are the errors and can you fix them easily? Eclipse gives pretty good error messages. If the errors are from validation, turn them off in the project settings, then try running the project again.
Otherwise, double check that you are using the exact code from the tutorial. Copy the code from Google and save it into a separate file. Then select your file, and the new file, right-click on the two files and use Eclipe's file-compare to show you if you missed anything.
[edit]
You could install the EE version to a different directory. Different versions of Eclipse do play nice with each other, they're just huge. Do not import your project into the EE workspace. It will come across as a plain Java project and you need a Web project. Create a new Web/JSP project and then copy the files over.
I'm a Java noob (but have been programming for 25+ years, and have worked with OO languages from day 1).
All of a sudden I started getting this error:
Your active platform is: JDK_1.6, but the corresponding property "platforms.JDK_1.6.home" is not found in the project's properties files.
Not sure what caused this condition, and not sure what Java's asking me to do. I'm working in the NetBeans IDE. The last thing I attempted to do is add some binary (image) resources to my project.
In my case the JDK setup in Netbeans was fine. It was just one of those strange Netbeans issues that come out of nowhere.
My fix was:
Clear the Netbeans Cache i.e. delete the folder:
C:\Users\\AppData\Local\NetBeans\Cache\
It means you haven't told netbeans where your Java 1.6 installation is. Go into settings, add the JDK (JDK->Add->New), and select the directory above 'bin' for your JDK16.
This error can occur at two scenarios:
Right click your netbean project -> Properties -> Libraries
After select Libraries , right panel on top you can see "Java Platform" combo box. This Jave Platform is missing for your project. You need to add using Manage Platforms bottom beside Jave Platform combo box.
Even thought scenario (1) is correct it can happen. Because your project has reference to another netbean project in your Libraries. This reference project is missing Jave Platform.
I have Linux in my office and Mac in Home and this problem is frequently when I share projects in github, I solve it removing the build directory and doing clean and build.
Right click on project - Properties - Libraries - Select the correct jdk version from the Java Platform combobox.
NetBeans bug
If your project depends on other projects, open and clean build all of them(that fixed it for me).
Most likely cache-related stuff. Clean up NB cache as suggested by someone before
You should remove the files under private folder in the nbproperties folders.
for me any recommended way early didn't helped, but changing in project Properties -> Source/Binary format to JDK 7, Save than change back to JDK 8 fixed this error