Don't show "android" option on Project Structure in android studio - java

I'm new in android development, last day i was doing a project but when i realize that project i don't need, then i just going to project path and delete the project file from hard drive. but after deleting the project, i am trying to create a new project but there is something shows that i didn't see before. and if i import a project from my computer, that time Project Structure don't show "android" option, and all projects show errors! even the Project Structure seems new for me. even i did uninstall my android studio and download new file and installed but it still seem like before!

If you are not seeing Android menu, meaning your project is not recognised as an Android project. Try to open / import your project by selecting the folder that contains .iml, settings.gradle, gradlew, gradle.properties, etc.

Related

How to change the project name in Android Studio safely?

I want to change the project name in Android Studio. I have found some answers on Stackoverflow but it didn't work for me. Please suggest me some suitable solution.Currently I'm using Android Studio 2.3. Thanks always :)
You need to perform a few steps
First move to project view and click on the small settings icon on the top right corner of project view, make sure the compact empty middle packages option is checked
Right click on your java folder and choose Refactor>Rename>change to your desired package name and confirm Refactor
than you MUST also change the project id in your build.gradle file
double check if your android manifest.xml refactored too(android studio should take care of it automatically but check again)
this is the only method that changed the project name from the base for me.
This did the trick for me:
Close android studio
Change project root directory name
Open android studio
Open the project(not from local history but by browsing to it) Clean
project
Check this:
https://stackoverflow.com/a/28324892/4161284
Perform the following Steps:
Step 1 - Rename:
Step 2 - Update app name in String file:
What helps for me is:
Close Android Studio
Go to projects folder i.e. where the projects are saved (Documents)
Rename the desired folder to whatever you want (keep naming conventions)
Open renamed project in Android Studio and clean project
Open app -> java -> right click package name folder containing activity -> select rename and follow prompts
Project should be renamed.
Note: There might be a .iml file with the old name. It can be renamed if you want the project to be completely clean.
Below strategy worked for me:
Close Android Studio
Change Android Project root directory name
Open Android Studio
Open the project from Android Studio (Try not to open the project from android studio history but by browsing it)
If settings.gradle contains the below line, change it to the new project name or remove it
rootProject.name = 'Your project name'
Clean the project and Build it
thanks

Downloading a libgdx Project Gradle Problems

So my friends and I are making a game for Android and we are using Android studio. We are using libgdx. We are also learning how to use github. Anyways, using Android Studio, I uploaded the basic libgdx setup. The one that just displays the Bad Logic image. My friend downloads it from github using Android studio but there are errors everywhere. It says that it can't find the badlogic package and it gives the following error:
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
I know that libgdx uses gradle. So what is the problem? Why can't we simply upload and then download a simple project?
Thanks!
Try to remove the .gradle directory and re-import the project or use the Setup App Installer from here to create a new gradle project.
Thanks for the help! I finally figured it out.
Basically, when I imported the project, I was just importing with existing project files. These are the steps I took to get it fixed.
Check out from Version Control using Android Studio and the welcome screen.
When asked to open, say NO.
Go to the folder that is associated with the repo.
Create a local.properties file there and in that file it should have
sdk.dir = /YOUR/PATH/TO/SDK/HERE
Then go back to Android Studio.
Click Import Project and select the folder that has it in there.
From then on, it should work forever as the .gitignore file that is generated by libgdx will ignore the local.properties file when pushed. I hope this helps someone!

what happend ? when i try to import my project from eclipse to Android Studio,it just can't run correct?

Now, i have problem that in the AndroidMenifest.xml, all of classes is wrong. And in Studio the APP can run , but is just flash past . before import to Android Studio, in the Eclipse , it' runs right . Anyone has an idea what's going on?
I really appreciate it .
In newer versions of Android Studio, the best way to bring in an Eclipse/ADT project is to import it directly into Android Studio; we used to recommend you export it from Eclipse to Gradle first, but we haven't been updating ADT often enough to keep pace with Android Studio.
In any event, if you choose "Import Project" from the File menu or from the Welcome screen when you launch Android Studio, it should take you through a specialized wizard that will prompt you that it intends to copy the files into a new directory structure instead of importing them in-place, and it will offer to fix up some common things like converting dependencies into Maven-style includes and such.
It doesn't seem like you're getting this specialized flow. I think it may not be recognizing your imported project as an ADT project, and it's defaulting to the old built-into-IntelliJ behavior which doesn't know about Gradle. To get the specialized import working, the following must be true:
The root directory of the project you import must have an AndroidManifest.xml file.
Either:
The root directory must contain the .project and .classpath files from Eclipse
or
The root directoy must contain res and src directories.
If your project is complex, perhaps you're not pointing it as the root directory it wants to see for the import to succeed.
Thank you.

Eclipse ADT appcompat... what is it?

I've spent all afternoon getting absolutely nowhere with this.
I've downloaded Eclipse, downloaded the SDK, installed the updates, but every new Android project I create something's wrong.
Firstly, it would not generate the R.java file, at all, now it does but there's a separate project it's created automatically called appcompat_v7. I don't know what this is, but it's causing problems with any other new project.
This is the error a normal project produces:
The container 'Android Dependencies' references non existing library '/home/omar/workspace/appcompat_v7/bin/appcompat_v7.jar'
I have absolutely no idea how to fix this. What is causing this?
EDIT
It appear this is only with KitKat, every other API platform doesn't produce ANY source files at all.... any idea how to combat this?
It's a support library which presumably your project refers to. You will need to build it as a library project in your workspace. This process is described here Support Library Setup under Adding libraries with resources.
You will find the project you need to copy in your SDK in the folder:
\yourSDKlocation\tools\android-sdk-windows4.4\extras\android\support\v7\appcompat
(It's no use just copying a jar, you must build it as a library project.)
I had this problem when I moved a project to a different laptop. I solved it like this:
If appcompat_v7 is not available in Eclipse:
From the File menu, choose New then Project.
Next, choose Android and Android Project from existing Code, then click next
Browse to find your appcompat_v7 project folder
Make sure there’s a check mark next it in the ‘Projects to Import’ list
If the appcompat_v7 project folder is not currently in your workspace, select ‘Copy projects into workspace’, then click Finish
Now that the library project is available in your workspace, it can be added to a project:
Choose your project from the Project Explorer and open the project properties (on a mac it’s in the Project menu)
Click on Android in the left list
Next to the Library list, click the Add button
Choose appcompat_v7 from the list
You should be good to go now.

In Android project include another project

I'm just starting my long way to Android programming and building app where I would like to use this library https://github.com/cfgxy/DevsmartLib-Android/tree/
This is another Android project, how should I include this in my project using Eclipse?
The contents of that repo's devsmartlib/ directory appears to be an Android library project. You can use such projects from Eclipse or from the command line as you see fit.
Create a new Android project in Eclipse and select the contents of devsmartlib/ as the source folder.
You can then right click on your project, click Properties, Android and add the library project from there!

Categories