Project has no project.properties file. Changing android project path - android

I changed the folder my android app was in and re-inported it. Then I got the error:
Project has no project.properties file! Edit the project properties to set one. Wakeify - Spotify Alarm - Plus Unknown Android Target Problem
Android Tools - Fix Project Properties does not fix this problem. When I go onto the project properties the Path and Location is listed as the old path! I changed the path so I don't understand why it's referencing the old path in the properties. I deleted the old project before re-importing it.
How do I get eclipse to recognise my project in it's new path exactly as it was before except the new path? I have no choice but to use a new path since ndk-build wants a path with no spaces.
Thank you.

Right click on the project -> Refactor -> Rename -> Change the name to the folder name.
No idea why eclipse needed me to do that but that was the solution.

Related

SDK Location not found in android studio

I have just imported my eclipse project in android studio. it keeps my saying that
Error:SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
I have seen some tutorials of editing local.properties files but it didnt work. here is my project.properties file:
sdk.dir=E:\\Mod Eclipse\\adt-bundle-windows-x86_64-20130219\\sdk
Actual directory of my folder is :
E:\Mod Eclipse\adt-bundle-windows-x86_64-20130219\sdk
A quick note about this if trying to run a Facebook sample and this error pops up, make sure you select the build.gradle file in the root of Facebook sdk, for all the samples when 'opening an existing project'. I got this error when I tried to open the gradle for just the Scrumptious sample from the 3.22 SDK
If you are sure that you have assigned correct SDK path in project settings,
and you can see it in local.properties as well, but still getting this error then there are chances that you are missing something in you project.
I was getting the same error after looking in to my project I found settings.gradle was missing.
and then add following script to your apps build.gradle
You will not face this error any more. It worked for me may be gradle set up was the blocking issue
My problem was:
I cloned a project from github
I clicked open existing Android Studio project
I chose the path of the inner sample app instead of the containing folder.
So what you should do is:
close the project.
click open existing Android Studio project
select the parent folder instead of the sample app.
You should also change it on Project Structure.
Close the current project and you'll see pop up with dialog which will then proceed to Configure option.
Configure -> Project Defaults -> Project Structure -> SDKs on left column -> Android SDK Home Path -> give the exact path as you did on local.properties and select Valid Target.
There you go.
The simplest solution sometimes is just do the File -> Invalidate Cache / Restart.
If it does not help then go for the more complicated stuff, as suggested in other answers
You can add a local.properties with to set the sdk.dir like sdk.dir=/Users/roofe/Library/Android/sdk.
But please note below, which is very important,
add the local.properties to the uppermost path of the project. Here the uppermost have some difference with root path of a project.
For example in the below project, I just use the ijkplayer-example, but this module also used other module with different cpu architecture.
If I only add local.properties to ijkplayer-example will not work. Here will get sdk location issue for other module.
While I can add the local.properties to the ijkplayer directory, then when I try to open the ijkplayer-example project, there will auto create a local.properties for ijkplayer-example, and everything works well.
In my case, it was a fresh install with checkout from github.
Just close the checkout window.
Create a new project (not from git, just a fresh one).
exit the project.
checkout whatever you like
Its just the fastest way that I found.
So I had the same issue, and none of the answers given previously helped me. What I did was check for new API updates (in my case, I updated to API level 23) and the problem was fixed.
Sync project with Gradle files, It will modify the project's local.properties file.
In Android Studio, I just clicked on File and then Choose Project Structure or Ctrl-Alt-Shift+S. This'll clearly show you the Android SDK location and an input box where you can browse to the correct one if it is not correct.
I add just local.properties file where my project is located. In local.properties:
sdk.dir=C\:\\Users\\dglig\\AppData\\Local\\Android\\Sdk
such kind of path is there which is our Sdk path.
So just create local.properties file manually and inside this just copy the Sdk file location.
Probably local.properties file missing.
Copy a local.properties from an existing file and add it to your current project. That worked for me.
I installed the SDK again (from here for example :
https://www.mediafire.com/file/azbsqg6dmg7z7np/Sdk+tools+for+android+studio.rar/file
& it created the directory & the packages, after installation.
Now I open android studio & everything is normal.
Everything posted so far was helpful in an overall learning capacity. However, most of the time, fixing one problem created others. What ended up working for me was completely deleting the GitHub project .zip file and any unzipped files. Then I made sure the correct .zip file was re-downloaded and unzipped. When it came time to open it in Android studio, I noticed there were 2 folders with identical project file names, one being contained in the other. The first (or upper) one is actually the .zip file. Open the other one!

import errors in android

I imported a project. I see import errors in each file. In the problems view I have the following errors:
Project X is missing the required source folder 'Gen'
The project can't be built until the build path errors are resolved
Unable to resolve target 'android-10'
In my package Explorer view, I don't see the gen folder so that I could tweak it.
What should I do, i am new to android.
check whether you have android-10 version installed.
Clean the application
Right click on project -> select Android tools -> Fix project properties
Re build the application.
Try to delete the folder (if it exists) and do a Project Clean in Eclipse. Mostly this helps to recreate your gen folder.
You can try to recreate it manually and make it a source folder, too!
Make sure your project build target and API level you're using match.

Eclipse Android gen already exists but is not a source folder

I am getting the following errors when I try to load an Android project in Eclipse that was working just fine last week.
Any ideas?
[2012-03-16 09:29:43 - MyProject] /MyProjectName/gen already exists but is not a source folder. Convert to a source folder or rename it
Note that I have tried to clean the project several times, even restarted but it still gives me this errors.
right click on project and go to project properties, then goto java build path, and then in source tab, click on add folder button and add gen folder.
just src and gen folders should be checked there if you haven't any library projects attached.
MyProject] /MyProjectName/gen already exists but is not a source folder. Convert to a source folder or rename it
This problem happens when eclipse does not able to find each linked contents in a project.
For example:
When we import a project to eclipse from a specific folder(suppose D://NewFolder), eclipse memorized and link each content with its appropriate path (which is D://NewFolder/project_library/src in our example).
But if we replaced(Here D://NewFolder To E://Another_Folder) or delete the library from its specific folder(Here D://NewFolder), eclipse unable to find its(project_library) original path
and give red error.
So when this problem happens, first we have to make sure that the imported project or library is its original folder and no changes has made to this.
Otherwise again replace the project to its specific folder to which eclipse has linked at the time of import i.e parent folder.
This happens because your .classpath file got wiped out somehow. This file contains all the information from the Java Build Path tab under Project Properties. You could add in all information manually but there's an easier way of fixing this problem.
If you have a copy of the .classpath file on your machine, you can just copy and paste it into your project directory.
Follow these steps in Eclipse :
Project -> Properties -> Select Java Build Path ->
Open Source tab -> Click Add Folder and check the gen

Proguard error during Android project export - System cannot find the specified file

Before I publish an Android app I'd like to run it through proguard. When attempting to build with progaurd I receive an error:
[2011-07-26 11:11:17 - app_name] Error: C:\Users\User\Galileo (The system cannot find the file specified)
After reading through some threads I found that progaurd won't work if the path has spaces. Well, the default workspace that Eclipse created has a space:
c:\Users\User\Galileo Workspace\
So, I went to the workspace folder and changed the name of the workspace folder from:
Galileo Workspace
to:
Galileo_workspace
...hence removing the space from the path.
When I did this, two things happened.....my workspace couldn't be found (not a big deal, just switching the workspace corrects this issue). The problem is that all of my alias information is gone. And the biggest problem of them all:
When trying to export my android projects with keystores I've created before changing the workspace, they no longer work.
How can I change the name of my workspace folder and remove the space in the path so that none of my aliases or existing keystores are affected?
In default.properties file, I was originally telling eclipse where to look like this:
proguard.config=proguard.cfg
I changed this line to tell the eclipse the entire path like this and the project was successfully built:
proguard.config=/project_folder/proguard.cfg
Anyone know why? Is it the space in the path to my workspace folder that caused the initial error or could it be my Eclipse setup?
Regarding your original problem: you should try upgrading to Android SDK R12. The problem with spaces in paths has been solved in the updated Ant configuration file (android-sdk/tools/ant/main_rules.xml; android issue 16674).
I tried #dell116 answer but it didn't work for me, but I realized that the "space" charachter in the path is the problem, so if the project that you want to export the apk for is in your workspace you may switch the workspace path to the same old one but replacing each (SPACE) with (~).
But if your project has its own path you may use Right-Click your project name in
Eclipse > Refactor > Move > then
choose another path for your project without spaces then it will move your project in the new path and every thing will be OK.

Problem importing Android project archives into Eclipse

My apologies if this is a stupid newbie question...
I'm using Eclipse (Helios release) and have the Android SDK all configured as per the developer.android.com recommendations. I can create and run new projects without any problem but I can't import archived project code samples (found on the web etc.) using Import > Existing Projects Into Workspace.
Importing a zip creates a project but it doesn't create it as an Android project and the console displays the error: "Project has no default.properties file! Edit the project properties to set one."
I've tried going into the project Properties but as soon as I click on 'Android' in the properties tree a pop-up appears saying "Could Not Accept Changes: The currently displayed page contains invalid values"
See: http://screencast.com/t/ZmY3ZWQ4
But if I do this on one of my own projects I have no such error, and I'm able to change things such as the Android Platform/API level. I'm also able to archive my own projects (using export) and import them again without any problems... nut not other people's archives! Am I being really stupid?
Any help would be really appreciated!
All the baseline default.properties needs is a line like:
target=android-8
You can most likely copy another projects' default.properties into this project. A (not-so-)quick restart of Eclipse, a rebuilding of the workspace, and you're off to the races.
It's really lame that this is needed -- it should happen as part of the import process, I would think.
just change your
project.properties file to default.properties
and restart your eclipse
it's done..
Right click on the project in navigator window, go to android tools and click on fix project properties. It might work, as it did for me ;-)
You can look at this section, it works for me:
Project has no default.properties file!
If you want to change the library of your project, do that :
- right click on the project name
- Build Path
- Configure build path
- click Android on the left, and select the library you need.
I had the same problem.
What you are trying is little difficult.Just unzip the files ,copy res and src folders
to ur existing project.The problem is the files starting with "." which have settings for their android and eclipse.
So you need to modify all that,so simply create new project or to ur existing one copy res, src and AndroidManifest.xml file.
It worked for me .
In the project right click Android Tools -> Fix Project Properties

Categories

Resources