I can not run a project I did not create - android-studio

I have been trying to run a project - which I did not create , but downloaded - in android studio.
For that matter, I put this project's folder in my android studio projects folder.
Then, I use an option of "import existing project". The project seems to be successfully imported. However, the option of run is not active , or disabled.
The same happens when I try the option of "open existing project" instead.
What is the reason for that problem, and how should it be resolved ?

Related

Flutter: How to import existing Flutter project, as a gradle project

How to import existing Flutter project, as a gradle project? 'Import Project' wizard asking for Gradle home path.
I have gradle, installed in my system. But what (which path) needs to set here.
Here is, what I'm trying:
Error
I had also gone through this problem where I have to import the existing Flutter project in Android Studio. I was able to import the project following below steps:
Open Android Studio
Goto File -> Open -> In Open File or Project window select the project you want to import.
Once you have done above steps try to resolve warnings shown in the log window. Warnings may be like update dependencies used in the project, etc.
Hope it will help you out.
I faced the same issue.
The gradle home directory (on my Windows machine) is located under:
C:\Program Files\Android\Android Studio\gradle\gradle-4.1
(please check the gradle version).
This will allow you to open the project. Then, you will most certainly need to "upgrade to gradle".
If this does not fully work, you might also consider using Visual Studio Code, which makes the "import" much easier: simply open the folder where you project resides. Optionally, you will have to resolve missing packages (-> Fetch packages). It should then be possible to run the project.
Hope this helps.
File - Open - Select the project root directory
Open Flutter settings from the tip menu - Click the pull-down menu, then flutter sdk dir appeared
Run
Or you can just use the flutter run command after step 1.
If you first add the flutter plugin for Android studio, then you can directly import the project as an Android Studio project and it should work fine.
In my case, having Android Studio 3.4.2 and Flutter 1.7.8, I only needed to:
1 - Open the project with the option "Open an existing Android Studio project".
2 - Run "flutter pub get" to get the packages listed in the pubspec.yaml file.
3 - Run the project with "flutter run"
If you are using Google services, don't forget to add your google-services.json file in your project. In another case, the project will fail without a clear message when you try to run it.
For Import exiting Flutter project.
Please choose Import Project because of Android Native application mean import use of android app only.
So use File -> Open -> Select Project root directory.
After open if ask for dependencies then Choose to Get dependencies

How to solve the issue of Android Studio 3 (3.1 canary) Preview: Cannot import project

I am working on Android Studio 3 Preview at the moment. However, whenever I tried to open an old project it says:
The project file specified already exists.
I have deleted:
Old code/project from hard disk (completely)
Removed the project from the project list.
Any tips on this?
This needs two steps:
You must delete the .idea folder under your project. It is a hidden directory. use ls -a to find it out.
Right click build.gradle and choose application. It probably popup a window asking for a program to open it, choose Android Studio.
I faced the same problem with 3.1 and .idea folder was also not there. Still it was not working. So instead of doing "Import Project" I did "Open an existing Android Studio project" and it worked.
I encounter same problem recently when opening existing Android Project,
deleting .idea or open directly build.gradle through Mac OS Finder work for me
Open the gradle file (select Android Studio if an application picker pops up) and it should bring up the "Import Project" dialog.
Just go to your Project Location Delete All files like .idea, .app etc and Relocate Your Project Location.

How to restore build.gradle and .Gradle folder

When I was trying to solve an issue with Android Studio I accidentally deleted .Gradle folder at the top of the project and build.gradle from within the app. I will post a screen shot of my project in Android Studio. The build tab also produces "make module my app project name" and "deploy module to app engine". The usual clean project, rebuild.... are not there.
How can I restore them?
If your are not using a VCS:
try use the local history to recovery the build.gradle file in your root folder (right click on the root folder)
If it fails. you can create a new project and copy the build.gradle. Usually this file contains generic info (like android gradle pluging and the repos to be used in the modules)
the .gradle folder is not a problem. Gradle wrapper will recreate this file
I copied both from a different project and pasted them in my project. That didn't solve the problem and I imported the project File->new->import project but that only created a duplicate within my project. I closed the project and deleted it from the list of project in Android studio. Then I created a project by importing it from Android Studio Projects folder. It took forever stuck in the gradle build and I have to restart AS manually. Now I have all my files and the project is compiling as it should.
You just need to reimport your project it will by default create the new gradle folder

Android Studio 1.3.2 No Module

Trying to follow this tutorial to run a new android project on a samsung device.
https://developer.android.com/training/basics/firstapp/running-app.html
However, I'm stuck in this step:
Run the app from Android Studio
1) Select one of your project's files and click Run from the toolbar.
I've selected the MyLoginActivity.java file but I can't click run (it's grey out)
I've tried to “Edit Configuration" add a "Android Application" but "Module" is empty:
I've tried to "Sync Project with Gradle Files". But the "Module" is still empty.
There was an ampersand (&) in the directory path! Creating a new project in a new directory without the & symbol solved all the issues.
No issue when opening a new project for XCode.

Android Studio HoloCircularProgressBar Library

I am trying to add the project https://github.com/passsy/android-HoloCircularProgressBar as a library to my project using android studio. I have added the project as a module and loaded it into the build.gradle file and added the dependency as well.
dependency {
compile project(':HoloCircularProgressBar')
}
No matter what it won't be able to find the attr 'cicularProgressBarStyle' and even in the xml it says unable to locate class file.
Would appreciate any help on this matter.
Thank you.
To import this plugin in Android Studio, complete the following steps:
Download the latest version of the plugin and extract the library directory
(rename it if you want - I've called mine circularProgressBar)
Create a new directory called libraries at the root of your project in Android Studio
Put the previously extracted library directory into into the new libraries directory
Go to your settings.gradle (also at the root of your project) and add the following:
include ':libraries:circularProgressBar'
Now go to File > Project Structure, select your module and click on the Dependencies tab, then click '+' and select 'Module Dependency'. You'll be prompted to select the holoCircularProgressBarModule. Select it and click OK.
Do a Gradle Sync and the project should be successfully imported.
This was completed using Android Studio 0.5.8

Resources