Does anyone have such problems as:
Cannot install debug-apk because cannot find Application file, which exists in Androidmanifest.xml or:
The APK file /home/skullper/AndroidStudioProjects/app_pay/app/build/outputs/apk/app-debug.apk does not exist on disk.
Error while Installing APK
Of course I can fix this with ./gradlew assembleDebug, but I should launch this each time before run, otherwise it will run only assembleDebug build
Issue with kotlin std in projects with Java only
When I was using 3.0 everything was ok and I haven't such issues. What should I do to run my project???
UPDATE
Everything works. Answer in comments under question.
Thank to all who was trying to help
Try rebuilding your project and reinstall if nothing helps, I had this bug on my old computer and rebuilded helped.
Though if you reinstall Android Studio, make sure you delete the AVR folder properly! Otherwise the bits remaining from the previous version will alter the new installation completely useless.
did you try to go to Android Studio's File menu and select Invalidate Caches / Restart... option, then restart Android Studio?
If so try this:
1- Remove the directory ~/.gradle/caches/. It's OK to do this while Android Studio is opened. (Refer pm installing wrong package name)
2- Press "Sync project with Gradle files" icon on Android Studio
3- Run the project and the remote path will be correct.
Try this:
1 - Go to "Run/Debug configurations"
2 - In "Before launch" click in the "+"
3 - Add "Gradle-Aware Make"
4 - Click OK
Image here
Hope it helps
Related
my project was working well but suddenly when I ran it on my phone, Android Studio freezes and I should stop it from task manager.
before this happens I installed "Geny motion" & "Virtual Box", but when the error occurred I uninstalled them. but the problem insisted.
Solutions I've tried
I uninstalled it and installed it again
I unplugged and plugged in my device
I disabled android indexing from setting
None of the above solutions worked.
I had today this exact problem. None of the above helped me until I found simple solution here
Just run File -> Invalidate Cache and Restart
That simple and it works!!!
Delete all Android Studio data - .gradle .android .androidstudio folders from your home folder. And all project build folders gradle and iml files.
This worked for me.
1.Close the project
2.Remove the project
3.Close Android Studio
4.Open it again
5.Open the project
Enjoy Coding!
I checked my java file and I saw somehow all the code in one of my java files was replaced with "NULL NULL NULL NULL....."
I deleted the file and the application runs without a problem.
Android Studio (3.1.3) froze on me while editing a source file. I waited and finally killed the process in Task Manager (Windows). Twice I tried to start up again and both times it got stuck with the "indexing..." message in the lower right. Both times I ended the process in Task Manager.
I looked in the source folder of the project I was working on. The source file I had been editing when it froze was "Receipt.java". There was another file in the src folder "Receipt.java__jb_tmp__". I deleted that file and Android Studio started up fine. It looks like I lost some edits, though.
When I did start up, it detected there had been some error and offered to submit a report.
If the project is large & has a lot of modules, you might need to increase the Allocated Heap Size for Android Studio.
Go to Edit Custom VM Options from Help menu and increase the value for -Xms and -Xmx
This is what I'm using
-Xms2048m
-Xmx8192m
-XX:MaxPermSize=2048m
-XX:ReservedCodeCacheSize=1024m
-XX:+UseCompressedOops
In my case color was declared as invalid, Android Studio ignored that and during building it froze. I had to remove the file, let it index, paste it back and fix the color string (it gave me error when I entered the pasted file)
just rename project folder then open IDE, it will show
now rename back to origin folder name, click open project
it work on my case
I have older project with sdk version 22, when I open it in android studio 3.1.2 on macOS. It keep indexing forever, everything was installed and configured properly but indexing loop never stopped.
Following worked for me
File > Invalidate caches/restart… > Invalidate caches/restart
Go to the File menu and click the option Invalidate Caches / Restart This will solve the problem ! Enjoy ;)
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~
I can't click the run button. Does anyone know how to fix it?
Click Run on the menu and then Edit Configurations... then click on Android Application on the left and click the + button. Choose Android Application from the pop-up menu. Then pick the module (its normally app or something like that). Then click apply and ok.
If you have more errors after that, try to re-import the project in Android Studio.
When creating the Run Configuration, the dropdown for Module had only <no module> for me. Invoking menu File -> Sync Project with Gradle Files added app to the dropdown for Module. Then the Run button became enabled.
The above answer didn't work for me, instead closing the project and restaring the AS IDE worked for me.
Just click the dropdown button on left side of RUN button (in your image the dropdown which is in red box) select 'app' option from that and RUN button will be enabled.
Please refer below screenshot.
just to go File -> Sync Project with Gradle files then it solves problem.
for flutter project, if the run button is disabled then you have to
tools>> flutter>> flutter packages get >>enter your flutter sdk path >>finish
This should solve your problem...
Above answer didn't work for me, just do click File -> Invalidate/cache -> Invalidate and Restart.
open your existing application by selecting build.gradle file. it will automatically sync the project and run button will be clickable
Run 'app' button disable issue coming sometimes in Android Studio Dolphin
Sync your project with gradle files
It was quite silly for me, I just opened the Run > Run Configurations window
everything seemed to be fine there, I didn't change anything, when I closed the window the button was enabled.
If you have changed jdk version then go to File->Project Structure->Select SDK Location from left bar->update JDK Location in editbar in right bar.
If your IDE is in power save mode, then the run button etc. are also disabled.
You can verify this via the file -> power save mode, make sure it is disabled.
If you are on a Mac, try clicking on File, then click on "Sync project with Gradle files" .... Run button should turn green again in a few seconds.
if you're importing an eclipse project to android studio, you'll also encounter the same issue as above. Double Check if grade>app has
apply plugin: 'com.android.application' on the top as sometimes android studio imports it as a library.
You have to reconfigure the FlutterSDK path in Android Studio: Go to Setting -> Language & Frameworks -> Flutter and set the path to Flutter SDK
I just clicked on the debug icon and it started working.
Build->Clean Project
make the run button enable again in my case
For me increasing the version of compile SDK to latest solved my issue, Go to
build.gradle(app-level)
compileSdkVersion 30
Because My Emulator is Api-level 30
Select the project view in the android studio.
Remove all gradle folders.
Restart the android studio.
This will work.
The issue is happening since the gradle was configured for an android studio in another machine and the files pushed on the git and are using in your studio.
After removing these gradle files and restarting the studio, the studio will generate gradle files for your system. This will solve the issue.
I opened the wrong folder.... Verify is your root folder in Android studio has the build.gradle file.
If you are trying to run the Flutter Project in Android Studio, and the run button is disabled then here is the solution
Click on add configuration
and select Flutter and then select the main class in dataentrypoint
I'm using Linux where I had a symlink in my home folder pointing to a folder containing the Android Studio projects. Loading a project using the symlink failed, loading a project from the folder where the symlink is pointing to worked!
My solution was to go to that multiselect button, then "Edit Configurations" -> Go to "+" and select the module (in this case it would be an app if you do not have a multiproject -> then apply and OK
Happened to me twice, and then I figured out it happened after I upgraded my flutter version. When I opened (flutter SDK path) in (flutter) tab in (system preferences) I found it empty.
Solution was to point out to flutter directory on my disk from (flutter SDK path) in (flutter) tab in (Android studio preferences).
Run button is bounded with Configuration that is why you should check if your project is build, synced and indexed and after that you can select a Configuration
For me, more than 1 instance of adb was initialized and due to this run button was disabled. I had to open ActivityManager (on mac) and kill all the initialized adb instances.
go to Build-> Clean Project
Selecting a different build variant (in the Build Variants view), then reselecting the initial build variant, fixed this issue for me.
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.
I created one android application project in eclipse and whenever I tried to run that application its throwing an error message saying AndroidManifest.xml file is missing. what is the reason for this ?
I am using eclipse with android-sdk and ADT version is 20. in SDK manager I installed android 2.2 API level only.. Is this is the problem for that error ?
Delete bin folder in project and your library dependencies. Then re-run application.
you should clean and refresh your project once.
I was able to fix this by manually deleting the bin directory, as well as the gen directory, right clicking project and selecting Android Tools->Fix Project Properties, then using Project->Build All.
Restart your eclipse and make sure that build automatically checked. It worked for me all the time. Hope this helps some one.
I closed all projects that were unrelated with the one I was trying to run (right-click on project in Project Explorer and then selecting Close Project) and the problem magically disappeared (for no apparent reason). Then, even after I re-opened the closed projects, the problem did not come back.
I put the AndroidManifest.xml that in appcomatv7 and pasted to the project and problem solved
Click project -> Refresh (F5) -> Go to "Project" in the menu bar -> Clean. It works for me.
I was having the same problem and didn't understand why - followed all deletes of /bin, /gen, fixing AVD's, etc, still to no avail.
The /bin got me thinking though -
I had previously used this advice to exclude /bin from the resource filters (in an effort to remove results from the search)....
I removed the filter for /bin and voila.....
Interesting this only affected me when I wanted to Debug or Run within Eclipse -- I could export a working APK without any problem, but debugging failed.
Hope this helps.
I had the problem in android studio after an update , it worked by Tools ->Android ->sync with gradle file
(what worked for me)
1 - copy the file build.gradle
2 - drop the copied file in the android folder [example MyApp/android]