Android: Source path not being included - android

In my project I have added some folders that I want included in my project for source files. But no matter what I do, the source never gets recognized. I tried refreshing, clean up, restarting but nothing works. Here is the project's source folder:
I want the folders integration/android added. This is how it is showing up in Eclipse:
And here is what my build configuration looks like:

I could be wrong, but it looks like you have added them as a folder, but not actually added the folder to your project.
The folder should show up in your src folder in the solution explorer window under your other package.
Try creating the package name in your project, then move all the src files into it.
And when its in the src folder, in its correct package, you dont need to include any extra build paths.
(You can have multiple packages in a single application)

Importing someone elses project that is over 2 years old is almost always problematic. I found the easiest solution just to create a fresh project and add the files manually from the old project.

Related

android studio settings.gradle duplicated, not recognized.

My android studio project is ostensibly error-free and (usually) builds just fine. But as seen in the following picture, there is a set of files that shows up twice in the file tree:
...once at the same level as the root project folder, and once within the project folder. NOTE: The actual files on the file system are ONLY located within the project folder.
In Android Studio, when I try to edit the settings.gradle within the project folder, it tells me "This folder does not belong to a Gradle project. Make sure it is registered in settings.gradle.", as shown here:
So, I try to instead edit the settings.gradle outside the project folder. In that case the Non-Project Files Access window comes up: this file is not part of my project. As shown here:
Who knew Android Studio was designed by Franz Kafka! But seriously, has anybody seen this? Or do you have any thoughts? Because of this issue, I can't add any new libs, so it is quite a show-stopper.
You may be interested to know that there in my git repo, there are existing versions of several auto-generated files including app.iml and project.iml and some other files from .idea/. When I git checkout back to the ones in the repo, the duplicate-file-trees briefly disappear. (I am still unable to access/edit settings.gradle, though).
If you want more information let me know. Thanks!

error in libs folder - android

I was working on my app, editing and coding some xml and layouts when suddenly I got an error on my libs folder. It's very weird because I haven't actually modified or changed any base classes or something. Moreover, I just noticed I lost also my R.java file and all of the references are gone.
What possibly can be the problem? I tried to clean+build the project but it didn't work.
Here is a screenshot of my eclipse:
http://i.gyazo.com/959040321d1fd6d00ee0b9a90133aa9c.png
Place the jar in the root folder of your project. Then you can add it to your classpath . (you cannot place a jar and access it using android.R)
You can add the jars to your build path by right clicking on your project->properties and going to Build Path. Then you can add an external jar

Android eclipse project is broken

After switching to my release branch the project had a missing gen file so I added the gen file from java build path.
Now the assets and the res folders are show like gray packages and not folders and I get the errors like res/values/ is missing.
How to return to the standard android project structure in eclipse?
Is there a standard way of returning to the standard Android project. I have become tired to fix project properties and I have tried to clean and restart eclipse It seams that some project metadata is saved the wrong way.
Thanks .
/gen/ folder is automatically generated during compilation. You should include that and /bin/ and also /.properties/ to .gitignore to avoid having to fix properties all the time and also minimise the amount of unnecessary data stored in your repo.

How can it be two AndroidManifest.xml files on a single android project

I learned that in every project we have only 1 AndroidManifest.xml file.
BUT I found two of the same file name !!
One is in the root folder, and the other is in the /bin folder...
How come, and what shell I do ?
thx !
project/bin folder is for compiled (to bytecode) source code and project resources.
Do not worry about it, your IDE is handling content of bin folder automaticly.
When all code is compilled, your IDE (I think, it is Eclipse) can build your project.
When your project builds, it creates a copy of itself for execution in the bin folder.
You can ignore everything in the bin folder as its automatically generated and it doesn't require any edit directly of you.
The only AndroidManifest.xml you have to worry about is the one in your root project directory
One is created by the developer (the one in root folder) and the other one (the one in /bin) is created by eclipse or whatever IDE you are using.
The other one is a compiled binary. This is totally fine. You don't have to do anything. Continue developing!

Importing the desk-clock android project into eclipse

I copied the code onto my computer via
svn checkout http://desk-clock.googlecode.com/svn/trunk/ desk-clock-read-only
into the folder C:\Programming\desk-clock-read-only
I try to create the project via File/New/Other/Android/Android Project from Existing Source.
I select the C:\Programming\desk-clock-read-only path.
For some reason eclipse only wants to import C:\Programming\desk-clock-read-only\res.
The source files are in C:\Programming\desk-clock-read-only so they don't get imported.
There's just an empty src folder.
What do I have to do to import the project correctly?
I dont't know how the developer of this project managed it to run this but usually the java files belong inside the src folder and the manifest definitely not inside the res folder. If you change this Eclipse(or the IDE of your preference) might recognize it, but you'll maybe get some errors because just putting the java files inside the src folder shouldn't solve it. You actually need a package. Check your manifest for that.

Categories

Resources