After realizing why Eclipse did not want to open XMl files in its Layout designer, I hope we'll be able to solve this issue here.
Anyway, after I create the project in InteliJ IDEA, exports it in Eclipse format, opens it in Eclipse, I realize that Eclipse Layout Designer does not recognize such XML file and the Layout Designer cannot load its content into right pane of the designer. This is how the Designer looks like after I try to load InteliJ-created XML file.
Indeed, I can load Android layout elements after setting Designer to correct Android OS version (dropdown list, elements appear in left pane of the designer), but the very content of the XML file gets never loaded in the right pane of the Designer.
After examining the STRUCTURE of a project created in Eclipse and a project created in IntelliJ, I realized that Eclipse DOES NOT generate Java files in /gen directory nor it imports correct Android library once I import IntelliJ-created project. Look at the image.
The upper project is created in Eclipse and it has both Android R files and Android library imported.
The project below is created in IntelliJ, exported to Eclipse format and then imported into Eclipse workspace. It does not have either Android R files or Android library imported.
Another problem is that I cannot force rebuild the Intellij-created project or even clean it in Eclipse because it isn't in the list of projects. Like Eclipse does not see it as an Android project at all.
The final issue is: when I manually set Android OS version in Layout Designer, then try to grab&drop Android element into the right pane of the Designer, I get the message (error) "Missing project resources". Look at the image.
Please help!
I've not used IntelliJ IDEA for Android development. But from what I can guess I think there is an encoding mismatch. The text files are typically encoded in UTF-8. But some editors have a different default encoding like: ISO-8859-1. This could be confusing IntelliJ parser.
If the encoding is OK, check whether IntelliJ is trying to validate the xml file against Android schema. If it can't find the schema then the IDE should report the error on the logs. You can either turn off validation or show the schema path to IntelliJ.
If you don't mind me asking, why do you want to use IntelliJ instead of Eclipse?
Related
I don't know if it is the place to ask this question, but i thinks it's more relevant to ask it here than in http://android.stackexchange.com.
The android studio project explorer always is like image below:
But in one of my new projects it became like below:
It's a bit confusing i could not find manifest and other xmls easily.
You are switching between Android project view and Project files view.
There is a menu on top of the tree view to change it.
Example screenshots:
Package view:
Android project view:
Project files view:
Android Studio creates the default structure for your project and
opens the development environment. If your app supports more than one
form factor, Android Studio creates a module folder with complete
source files for each of them .
You should check Projects Overview .You can change its structure by selecting above picture .
I'm trying to import PocketSphinx into a project using Android Studio 1.5.
This page details how to install and use the library. However I stumble at the following step:
In Android Studio you need to place jar file in app/libs folder and jni .so files into app/src/main/jniLibs folder.
My project directory tree does not contain these directories and I have been unable to create them myself. This is my directory tree:
That webpage also provides a sample android studio project, which works just fine, but I think it is designed for an older version of android studio because the directory structure is totally different to any app I've seen before (While I do have some years of coding experience in other areas, I only started developing android apps in the last 2 or 3 months).
This is what it's directory tree looks like:
(I haven't expanded the entire tree this time)
One last thing: I tried to import the library (as available for download here) by using "File -> New -> Import Module" But doing this breaks the project (and it can't be fixed by simply clicking "undo"). The error message I get is:
V:\Documents\ButterflyMilk\SpeechRecDemo\pocketsphinx-android-master\build.gradle
Error:(7, 0) Could not find property 'sdkDir' on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated#606a97f.
Open File
and at the top of the code view it now permanently says:
Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly.
Thanks in advance for any help and advice you can offer! I will also quickly note again that the sample program provided works just fine, and I've managed to tweak it and play around with it. However I still need to be able to import the library into a separate project. Thanks again
My project directory tree does not contain these directories and I have been unable to create them myself. This is my directory tree:
This is "Android" view.
This is what it's directory tree looks like
This is "Project" view. You can switch between views with a dropdown selector on the top of the region (it says "Project" in second screenshot)
I have been unable to create them myself.
You can create folders in file manager.
You can also use IDE, right click on the app, then select "New" -> "Folder (green in the bottom)" -> "JNI Folder" for example.
You can also use "New" -> "Directory".
I'm very new to Android. Whenever I create a new project using a new workspace, I get an exclamatory red mark in Eclipse in my project and an error at Appcompat. I searched here for an answer, but no answer was what I was looking for, so I just asked this. When I create a workspace at DDMS it displays this:
Sending Tracking request failed!
At Android, after I create a new project
WARNING: unable to write jarlist cache file here, src file, layout file not available.
I've searched a lot and found no solution.
OK, first thing first. Eclipse is no longer supported by Google. The only official IDE for Android Development is Android Studio Download Page.
Here is the announcement of Eclipse support ending
Over the past few years, our team has focused on improving the development experience for building Android apps with Android Studio. Since the launch of Android Studio, we have been impressed with the excitement and positive feedback. As the official Android IDE, Android Studio gives you access to a powerful and comprehensive suite of tools to evolve your app across Android platforms, whether it's on the phone, wrist, car or TV.
To that end and to focus all of our efforts on making Android Studio better and faster, we are ending development and official support for the Android Developer Tools (ADT) in Eclipse at the end of the year. This specifically includes the Eclipse ADT plugin and Android Ant build system.
Please note that the number of people using Eclipse to develop Android apps are going down. You will get less and less support even on Stackoverflow as time goes by. Overall, it is better to just make the switch while you are just starting.
Check on the first link, you will see some amazing documentation in the Android Studio IDE
If you 100% required to use Eclipse...
OK, so you have a job that requires Eclipse or there is some other reason, then check out this documentation by Eclipse.
Also, here is a list of all the different icons that can be displayed by Eclipse (credit for the icon list).
Build path problems are sometimes easy to miss among other problems in a project. The Package Explorer and Project Explorer views now show a new decorator on Java projects and working sets that contain build path errors:
The concrete errors can be seen in the Problems view, and if you open the view menu and select Group By > Java Problem Type, they all show up in the Build Path category:
Please refer this link too here
If you go to appcompat_v7/bin folder, you'll see that file "jarlist.cache" doesn´t appear or is unsynchronized. You need to
refresh the appcompat_v7 folder, only press F5 over that folder.
The appcompat_v7 folder is added because you use an action bar
component.
Aah. To avoid a new appcompat_v7_XX folder when you are creating a new
project, choose a LEVEL API 14 as Minimun Required SDK. After you must
modifier the AndroidManifest.xml and put the level that you need.
change it
android:targetSdkVersion="19" />
Delete all appcompat_v7_XX. It is a bug.
With appcompat_v7, You will see that Eclipse creates two XML files:
Activity_main.xml and fragment_main.xml. If you want to have an option
to create a project in the old way only with activity_main.xml, do
that:
Make a copy of the folder "BlanckActivity" located in this path:
\sdk\tools\templates\activities of an ADT previous version.
Rename the folder as “BlankActivityNoFragment”, then edit the field
name of the file "template.xml" with a notepad as
name=”BlankActivityNoFragment”
Copy the new folder in the same path of the new Eclipse
IDE:sdk/tools/templates/activities
Now you´ll see the new template when you go to create a new project.
Remember to choose as Minimum Required SDK an API 14
If you don't want the support of appcompat library then just remove it from your project by following steps :
Right click on project
Select properties
In dialog select android on left side
In dialog check library section
Remove appcompat library by selecting it and press remove
Extends your MainActivity.java with Activity
You can run your project successfully.
If you want the support of appcompat then follow this steps :
download the latest appcompat using Sdk Manager
import appcompat project in your eclipse
add it as a library project
extend your MainActivity with AppCompatActivity.
If you're getting any problem with app_compact library... This is the solution
Hopefully it will work....
According to the documentation
Decorates Java projects and working sets that contain build path
errors
There can be several reasons. Most of the times it may be some of the below reasons ,
You have deleted some of the .jar files from your /lib folder
You have added new .jar files
you have added new .jar files which may be conflict with others
So what to do is we have to resolve those missing / updating / newly_added jar files.
right click on the project and go to properties
Select Java Build Path
go to the Libraries tab
Remove the references of the jar files which you have removed already. There will be a red mark near them so you can identify them easily.
Add the references to the newly added .jar files by using Add JARs Refresh the project
This will solve the problem if it's because one of the above reasons.
Still Facing problem ??Try this:
Go to Windows -> Preferences -> Android -> Build and uncheck "Skip packaging and dexing until export or launch" then restart Eclipse.
I am new to android development. I installed android studio 1.2.2 on osx 10.10 successfully. I downloaded the devunwired/accessory-samples repo and I am trying to view the activity_client.xml in design mode, but I am not able to do so.
I think I am supposed to see the "Design" tab in the botton somewhere, but I do not see it. Here is what I see. What do I need to do to see this .xml file in the graphical view?
It looks like your project isn't imported as Android module.
Also the folder "BluetoothGattPeripheral" must be the root of the module.
Either try to reopen the correct folder or use File -> New -> Project From existing sources and make sure you import it as Android Project/Module.
When you've done it correctly the "src/main/java" folder should be automatically chosen as "Source Root" and should turn blue.
There's no need to say one word:
Being a week old in AS, I am trying to find the folder/file paths that are being referenced in some posts. For example, when reading posts about trying to understand how to resolve the lack of an R.java file, several posts refer to a path, such as
"build/source/flavor/r/build type(optional)/package/R.java."
In Android Studio 1.2.2, I created a new project, named it, pasted some XML layout code into the generated layout file, then also the associated Java code for making a popup window, into the Activity window. Then ran the project. It could not find the R.java file so crashed.
My problem at this point is that I cannot seem to find such a path anywhere so I can track things. The path components look like they would be hierarchies in Android projects. But I cannot find anything like this in Windows Explorer, in the Android project window, the Android structure window.... Any ideas?
I don't know if the crashing prevents the R file from generating, since the build never finishes. Or rather if I just need to read more documentation ;) Thanks for any help.
It could not find the R.java file so crashed.
You have an error in one of your resources or your manifest, preventing R from being built. If you do not see an error indicator on any of those files in the project tree (left-hand pane in Android Studio), run Tools > Rebuild Project, and you should get an error pane popping up at the bottom of the screen after a moment.
My problem at this point is that I cannot seem to find such a path anywhere so I can track things.
In Android Studio 1.2.2, for a standard Android Studio project, the generated R.java file will be in:
app/build/generated/source/R/.../your/package/name/R.java
where:
... is typically going to be debug for the sorts of builds that you are doing, but technically will be tied to whatever build variant you are building (see the Build Variants view, docked on the lower left side)
your/package/name/ will be based on the package attribute in the <manifest> element of your AndroidManifest.xml file