Android Studio can't find runner - android

I cloned a project from git and built it in android studio without any problems but I don't have (Run app) in android studio and also when I run run-android I get this error:
Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`
but I can run my emulator from AVD manager!
I did every solutions that I found with search but they didn't work for me

For me, the reason was one of the following:
Gradle sync was in progress
Gradle sync had failed
For the second case, go to your top-level or app build file and click Try again or Sync button on the notification shown at the top of the file.
You could also just try to sync the IDE with Gradle with either of these buttons:

I faced a similar error. I was trying to import a built apk to profile it and ran into the scenario where the run button was grayed out.
Ultimately what worked. I went to File > Manage IDE Settings > Restore default settings.. and redid the android studio setup.
Note: Doing this will RESET the entire Android Studio and redownload everything.

1- Give the SDK path (to find the emulator path), Usually in User\YourUsername\AppData (is hidden by default)\Local\Android\Sdk. in File->Project structure, SDK location. Also the Java\Jdk path for (JDKs) and the path "...java\util\concurrent" exist
Do not reset the IDE Settings (because you need to reinstall a lot of things and it will not solve)
2 possibility - from File->Setting->Tools->Emulator to check the Launch in a tool window
3 possibility -

Related

Android Studio 2.2 & 2.3 Gradle project refresh failed

I am new to Android Studio though I have watched a few tutorials before. I am getting the following error when I try to make a project on Android Studio 2.3:
Gradle "Projectname" project refresh failed.
Error:Failed to delete original file 'C:\Users\myname\AppData\Local\Temp\gradle_download2913498326076248476bin' after copy to 'C:\Users\myname\.gradle\caches\modules-2\files-2.1\javax.inject\javax.inject\1\6975da39a7040257bd51d21a231b76c915872d38\javax.inject-1.jar'.
Its the same error I got before updating from 2.2 to 2.3.
I tried searching the internet but couldn't find a solution.
Does anyone know how to fix this?
If "Messages Gradle Sync" recommends an upgrade; you probably already did this.
Disable instant run, To do this:
2.a. Open the Settings or Preferences dialog: On Windows or Linux, select File > Settings from the menu bar. On Mac OSX, select Android Studio > Preferences from the menu bar.
2.b. Navigate to Build, Execution, Deployment > Instant Run.
Uncheck the box next to Restart activity on code changes.
Check your anti-virus and turn-off, try again. I have not had this issue, but it was recommended on some older posts with success.
Hope one of these takes care of it. :)

Unable to clean or rebuild project in Android Studio 2

I have a problem with my Android studio 2. That's whenever I want to clean or rebuild my android project, I always get this message
Error:Execution failed for task ':app:clean'.
Unable to delete directory: C:\Users\MyPC\Desktop\SharePlace\app\build\intermediates
and can not fix it. what I only can do is go to File explorer and delete it.
then come back android studio and rebuild again. Sometime, that way also does not work.
I need some help to fix that Android studio. Please.
Thank inadvance!
Solution 1 :
you are using Android Studio 2.0 Beta, this issue might appear (more likely if you are working on NTFS filesystem) and it seems like the "Instant Run" is the culprit. Search for "Instant Run" in settings and uncheck the box.
I have filed an issue on the bug tracker.
Solution 2 :
You need to go to the source file directly. Close the studio and go to the path the issue is located at and delete the folder there.
I got a lot of faults like this.
Try to refresh all gradle projects: in Android Studio click on the "Gradle" tab on the right side of the window. When the gradle menu is shown, click on two blue mixed arrows icon. Then wait a moment until gradle completes refreshing and try cleaning or rebuilding again.
For me it was fixed by running Android Studio as administrator.
Manually deleted folder( build\generated and build\intermediates) after closing android studio works for me.
Found the solution. For windows, goto Task Manager and find your Android Studio. Expand it and end task for OpenJDK Platform Binary as depicted below
screenshot.
Then re-run your app in Android Studio again. It should work, and you don't have to restart your Android Studio all the time. More productivity~

Android Studio not working after update 1.3.0

I've been running Android Studio on Windows 7 since January and haven't performed an update until today. I started having a problem last week in which AS caused my computer to crash every time I tried to run my application, so I decided to finally stop ignoring the popup which told me updates were available. After downloading and running the file from the Android site, I'm seeing a plethora of error messages along the lines of:
Unable to save settings. Failed to save settings. Please restart Android Studio
and
Cannot load settings from file ' (several different files have been listed) ': content truncated File content will be recreated"
and
Plugin Error
Problems found loading plugins: Plugin "Android Support" was not loaded: required plugin "Gradle" is disabled. Plugin "SDK Updater" was not loaded: required plugin "Gradle" is disabled. Plugin "Android NDK Support" was not loaded: required plugin "Gradle" is disabled. Plugin "Google Cloud Tools For Android Studio" was not loaded: required plugin "Gradle" is disabled. Plugin "Google Cloud Testing" was not loaded: required plugin "Gradle" is disabled. Plugin "Google Services" was not loaded: required plugin "Gradle" is disabled.
All of that might be ignored except for the fact that when opening my existing projects none of the files seem to load, meaning I can't do anything.
So basically I'm worse off now than I was before.
Restarting Android Studio multiple times has not resolved the problem. I also cleared the cache and tried removing the old .AndroidStudio file on the advice of another stackOverflow question, but to no avail. Can anyone help me out on this?
I got solution for
Cannot load settings from file ' (several different files have been
listed) ': content truncated File content will be recreated"
by just deleting recentProjects.xml from C:\Users\Username\.AndroidStudio1.3\config\options it worked for me.
I got a simple solution:
1. go to settings>plugins
2. Check all the boxes at your right(especially the one marked red)
3. Update or install the plugin if required(make sure the red marked texts disappears)
4. Finally restart your studio and you are good to go
I made a clean install and it worked for me.
I found a solution to the first error message:
Unable to save settings. Failed to save settings. Please restart Android Studio
After checking the log files I realised that the file .AndroidStudio1.3/config/inspection wasn't a directory as expected by Studio, but a regular file. After removing it and creating a directory with the same name instead, everything was working fine again.
if you see those errors then just below those errors there is some line in blue color that show INSTALL plugins click on that and it restart your studeo then it will work fine.
I faced the same error after i have installed genymotion with plugin but it was not working correctly so i uninstalled it from control panel. but plugin icon was still appearing in android studio.i reinstalled android studio but the error and icon was still there.
The following solution worked for me:
1) File->Settings->plugins;
2) in the plugin panel, check all the plugins except genymotion plugin.click apply.
3) Restart Android Studio and that's it.
Not confirmed about internet because i have tried without internet it was giving error but when i connected to internet it is done.

Android studio 1.0 Local path doesn't exist

I just updated from android studio 0.9 to 1.0 and now when i try to run my app everything goes well up to the point where it asks "choose device", then i select my note 4 and then issues error "Local path doesn't exist."
I am using 64bit windows
Also clicked on "Sync Project with Gradle files". The problem is still there!
App:
Waiting for device.
Target device: samsung-sm_...
Uploading file
local path: C:\MyApp\app\build\intermediates\classes\debug\app.apk
remote path: /data/local/tmp/com.example.MyApp
Local path doesn't exist.
Error Log:
11:32:40 AM Gradle build finished in 5 sec
11:32:43 AM Unexpected Error
Local path doesn't exist.
Local path doesn't exist.
The project may need to be synced with Gradle files.
Sync Project with Gradle files
Looks like an issue with APK_PATH, which for some reason can't be found..
You may try following the solutions from here or here.
Also, you may try updating your Gradle plugin to the latest version and rebuilding the project.
Did you import the file from an Unix system? The path slashes are different in each one. Try correcting the paths to match your current system.
I had got the same error.
And I cleaned and rebuild the project and
Project -> Clean Project/ Build Project
Synced the project using Gradle
Click on "Sync Project with Gradle files" in Event Log
And you should be good. Worked for me.
Check the Run/Debug Configurations you have.
Click on the icon that has the Android robot written app then click on Android Configuration. When you click on "app", you will see to the right, at the bottom there is "Before launch..." Make sure in the input box below that it says "Gradle-aware Make". If it doesn't, click on whatever it says and click the pencil icon just above it (it is for editing). In the dialog box that pops up, remove whatever command is there (sometimes it is to unistallAll before reinstalling the new updated apk) and click "Okay". When you come back, you will see the input box now has "Gradle-aware Make" which means when you build your app, it will just install it on top of what is there.
I had this issue because I was unistalling everything before installing the new apk but I once cut the process in the middle of this process after it unistalled but not reinstalled. This meant the next time I ran the app, it wanted to unistall but could not find the apk as it has been deleted before. Changed back the configuration like above and it worked.

An internal error occurred during: "Launching Project". java.lang.NullPointerException

My android project was compiling well but suddenly it stopped launching. Then I tried to launch other projects from Project Explorer and all project threw same exception:
An internal error occurred during: "Launching Project". java.lang.NullPointerException
But console always shows everything is normal.
Android Launch!
adb is running normally.
Performing com.mmcolrev.LoginActivity activity launch
Here's screenshot of error.
If anyone face this problem, first keep in mind that error is not in your code but due to some internal issue in eclipse ADT. I don't know exact problem but luckily found way to solve it. If you ever encounter this error follow steps below:
Exit Eclipse.
Go to Android workspace.
Locate .metadata folder(make sure you set hidden folder visibility on).
Delete .metedata folder.
Start Eclipse(you will notice project explorer is empty, don't panic) and import all your projects.
Removing Gen/R.java and restarting eclipse, worked for me.
This is a cause of AVD is not picked because you might delete it or it is not picked up correctly ... in other words deployment target is not specified or it has some problem in picking up a device.
To Resolve this:
Right click your project and choose "Properties"
From "Run/Debug" Settings, Highlight over your application name then hit "Edit..."
In "Target" tab, you have to choose a virtual device to be picked automatically under option named "Automatically pick compatible device..."
to avoid such prompt you could choose the first option "Always prompt to pick device" that will ask you everytime to choose or pick a device inside which you want to run your app.
If it still not working restart Eclipse
One cause of this issue for me was that I had been updating my Android Tools with the installer. It was running in the background doing all its updates. I had forgotten about it since I had told it to do the work in the background. Then realized it had finished its work and needed a restart after the installation.
Once the upgrade / installation was done and the IDE was restarted, the Eclipse environment went back to behaving as normal.
I had the same issue.
Non of my project in the workspace would run and I would get the same message "An internal error occurred..." and details would just say something about a Nullpointer. This happend after I did some updates and all projects in the workspace started giving the same issue.
It took me some time to find the problem:
When I go to configuration of the project (Run Configuration...) I could see that "Project" in the configuration settings was empty. So my update removed the projects from the configurations. Once I put back the project in the configuration again problem was gone.
In my case, it was because I was running it with Debug As -> Android Native Application, while the emulator was closed (I debugging on the emulator, not on a real phone).
I needed to first start the emulator using Debug As -> Android Application, after which Debug As -> Android Native Application will work.
Close the emulator and the error re-appears. My conclusion is that Debug As -> Android Native Application won't work unless the emulator is already started.
I had this error with an NDK project (eclipse mars, loaded an ant project) everytime i tried to lauch on the device (google tango yellowstone) using Debug As -> Android Native Application. Note, that i switched the device and changed a dependent library since the last successful build.
When i tried Debug As -> Android Application i got this message:
Re-installation failed due to different application signatures. You must perform a full uninstall of the application. WARNING: This will remove the application data!
Do you want to uninstall?
clicking OK here solved the issue, so Debug As -> Android Native Application also worked again.
I had the same issue all of a sudden. This only happened when I ran in Debug mode, and for me what fixed it was... Run -> Remove All Breakpoints. Then I could add them back, and it ran in debug mode fine.
To resolve this issue, I just remove the old JRE System Library and point to the new JRE System Library.
Got the similar issue after update the project able to procced.
Right click on the project -->Maven --> Update Project
In My case issue was java version in updating it to correct (11->1,8) and doing maven update helped me
ISSUE : Error: Could not find or load main class com.pluralsight.fundamentals.FundamentalsApplication
Caused by: java.lang.ClassNotFoundException: com.pluralsight.fundamentals.FundamentalsApplication
ANSWER:
Open cmd (Command prompt)
Check java version (java -version)
Open POM.xml and check java version there
You are getting this error, that means java version is mismatched.
Change the java version in POM.xml (example: if java 11 , add it as 1.11 in pom.xml file)
Example: <java.version>1.11</java.version>
Update Maven by right click on the on the project in eclipse
Now it will work and the error will be vanished :)

Categories

Resources