Error while Installing APK app-debug.apk does not exist on disk - android-studio

Hopefully someone can help. Have an APP that I have been working on for awhile. Compiled it earlier, no issues, and ran a debug on an attached device.
When I came back to AndroidStudio today, was prompted for an UPDATE to studio as well as a Gradle update. Ran both updates as listed... no errors during the update.
Restarted AndroidStudio and "Run APP" once again. Went through the Gradle Build as normal... then received an error when installing to the attached device....
Session 'app': Error Installing APK
Checking the RUN, I am getting:
The APK file C:\Users\Pete&apos;s PC\AndroidStudioProjects\<myapp>\app\build\outputs\apk\app-debug.apk does not exist on disk.
Error while Installing APK
That file exists with the current build date/time.
Doing some searching, people mention CLEAN / REBUILDS in various steps, tried them all. Tried exiting AndroidStudio too. Went to the device's Developer Options and Revoked USB Debugging Authorizations... then reapproved them when prompted. Also tried SYNC.
Nothing works.
It's even more frustrating because I didn't change one line of code, one setting, or anything. It was a prompted AndroidStudio/Gradle update. Uggghhh!!!
Any other suggestions... I am dead in my tracks right now.

I do get the same problem as yours but I solved it by transferring the project file to a thumb drive. Any drive but not C drive.
It can install the apk in my phone. Hope it works.

It looks like it might be an actual bug in AndroidStudio. My "path" to where the project is stored is based off the "computer name" that was created when my copy of Windows 10 was originally setup... "Pete's PC".
So the path is....
C:\USERS\PETE'S PC\AndroidStudioProjects\myproj
It looks like the apostrophe (') in the path is throwing it off. If I move the project to ANY where where there isn't an apostrophe in the path, it compiles/installs fine... as is.
Thanks to Syaf for sort of pointing me into this direction with his "move the project to a flash drive"... that's what got me thinking and trying things.
Sadly, this is possibly a problem for alot of people because even during the Windows 10 setup, you are prompted to name the computer you can remember.... like John's PC.
I forwarded my findings to Google for review.
Peter

Related

"Could not get user for package id" error on completely fresh blank project on fresh install

I get this error on every project, even completely blank ones with just an empty activity, I've tried adding the package name to the manifest, and checking the package name in the gradle files. I've also gone as far as deleting every reference of android studio on my pc and doing a complete fresh install and that did not work either. If anyone has any ideas of how to fix this, please let me know, usually programs work fine, but I need to request permissions and the permissions manager also cannot find the package. Picture of the error upon install on the android emulator

Too many open files error in Visual Studio Node.js under parallels after upgrade to MacOS Catalina 10.15.7

I just upgraded my Mac to 10.15.7 today. I run Parallels Desktop on the Mac so I can run my Node.js Visual Studio projects. Upon doing this upgrade I can no longer get my project to run. Unfortunately I made a few changes to the code before trying to run but I do not think that is the source of the issue or the log files would be telling me something else. When I run I get hundred/thousands of lines with the "too many open files" error. Below is a sample of one of those lines:
SourceMaps: could not preload for generated script: c:\Users\chris\github\CollegeTennisRanks\CollegeTennisRanks\obj\Release\Package\PackageTmp\node_modules\core-js\library\fn\string\bold.js. Error: Error: EMFILE: too many open files, open 'c:\Users\chris\github\CollegeTennisRanks\CollegeTennisRanks\obj\Release\Package\PackageTmp\node_modules\core-js\library\fn\string\bold.js'
I tried a suggestion I found online to change the settings by going to e terminal window and running the following command:
sudo launchctl limit maxfiles 65536 200000
but that did not change anything, still the same errors when i run the project. The odd thin is that I actually have two projects in the solution and the 2nd one actually runs, but it is a much smaller project and only a console app that dows not start up a web server, etc.
I am assuming that the upgrade to 10.15.7 had something to do with this but no cluee where to go now. Any help would be greatly appreciated.
Well I'll be darned... it was a code change. I copied the project over to a PC and ran and got the same result. Went through last changes one by one undoing them and found that one of my controllers had an issue that for some reason prevented it from running. How to determine that from the log is another question but at least that answers that. Evidently all the "too many open files" messages in debug log are not an issue, which also seems odd.

Android Studio 2.2.1 - Windows 7 Ultimate 32-bit

I am new here so I would like to apologise if I do/say anything wrong firstly. I have Googled this issue and searched Stack Overflow for it as well but it was not the exact problem which I am having.
I am currently doing Rob Percivals Android N Developer course on Udemy.com . In the course they recommend that you work in Android Studio 2.2.1 (which they generously provide a download link for).
I installed this on my machine and immediately I encountered a JDK/JRE issue which I solved through a quick Google. Then when it came time for me to create a new project, a whole new problem appeared.
Here is what I am doing (I'm sure if you're reading this you are 100% familar with Anroid Studio and don't need screenshots hence why I didn't provide any):
Create new project
I am choosing "Phone and Tablet Only" with and API 15
I am checking on "Generate new layout file" and "Backwards Compatibilty"
Finish
Now immediately. an error message pops-up "Grade 'xxxxx' project refresh failed. Unable to start the daemon ... object heap"
The solution proposed on Stack Overflow was to go into the "gradle.properties" file and change "-Xmx1536m" to "-Xmx1024m" and then close and open Android Studio. While this works, my question is do I have to do this every time I start a new project? Is there no permanent fix here?
I have read through all other suggestions such as deleting the .gradle folder in my Users folder and File Menu - > Invalidate Caches/ Restart->Invalidate and Restart but none of them works for me.
I would appreciate any responses.
Answer 1 :
Steps to solve problem in android studio
Click on file and select a other setting from dropdown menu and then select default setting.
Select build,Execution,Deployment option.
Select Compiler
Here add a following line in Additional build process VM option
-Xmx3072m -XX:MaxPermSize=524m
Check This Image
Answer 2 :
Try deleting your .gradle from C:\Users\<username> directory and try again

Xamarin.ios Error MSB6006: "codesign" exited with code 1

When trying to test my app on my device iPhone, I get the following error, I think it's something about registering my device.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(3,3):
Error MSB6006: "codesign" exited with code 1. (MSB6006)
(multifacturacion.iOS)
The strange thing is that this same device in another mac with xamarin if it works and with the same project.
If someone can help me with this, I have several days looking for a solution.
This went away for me after I cleaned the solution in Visual Studio.
(yes this is a complete answer, there are no citations, this is just what I did to fix it).
Open the info.plist and check "Automatic Provisioning".
Thing is, I am having this error regularily. I am working with a local developer certificate created on my Mac using a free Apple Id, but without a paid Apple Developer Membership. I am using a Windows based devloper workstation and program in Visual Studio 2019 with Xamarin.Forms 4.0. To get local deployment working again, I need to visit the general settings on my iPhone and remove my trusted account from the list of developer apps under device management which basically not only removes the account but also the app from the device.
Then I need to remove all occurances of the corresponding certificate on my Mac within the Keychain Utility and even the mobileprovision file on my harddrive located somewhere beneath my user directory.
Now I have to Start XCode on my Mac, open the project, I am working on and have it automatically "repair" the signing certificate which basically creates a new one and registers it in the Keychain. The moment I run the app from XCode, I need to always allow keychain access and on my iPhone I can see the account appear in the general settings again which I have to manually trust... again.
THEN I can open the corresponding project in my Visual Studio on my Windows Developer Workstation, rebuild and deploy the app and get no errors.
Without being able to say why, it could happen even the next time I try to build and deploy the app, that this error happens again... this is very (!) inconvenient and I didn't find any real solution for it yet...
remove your certificates from keychains and add again, close Info.plist open and fill de information on bundle singing option, that works for me, remember link your device with you provisioning.
The answer of Mephisztoe worked for me, except that I am working on Windows and you find the scheme-property in the project-settings and not in the plist-file.
Furthermore be sure that you installed fastlane (just open Extras > Options > Xamarin > Apple-Accounts and click on "install fastlane") and added your Apple-ID there.
I also deleted the certificate with the keychain-utility. That's why I had to reenter my password on the mac as I clicked on build on my windows machine.
With these steps done I can finally work again...
If the certificate of Apple developer is expired, you can get the error like "codesign", so you need to create a new certificate in Apple Developer site (https://developer.apple.com/account/), then download & install to your computer.
I have been struggling with the same issue for several days, the error came only when I tried to publish the app from my Windows VS 2019. It had no further details of why it was behaving like this.
What I changed was:
Created New Publishing Profile & Certificates
Instead of selecting Release in Configuration as suggested in this Microsoft article, I selected AppStore from the configuration.
Tried to recreate the archive and it was completed successfully.
Now when I tried to publish it, I encountered few error messages, I fixed them and submitted the app again. It worked fine.
For me, the issue was that there was a popup asking for a password on the network-attached Mac. I had to VNC into it and enter the password.
For some reason the first time I did this (and chose "always allow"), it failed again with this error, but the second time I ran it succeeded.
You'll want to make sure to have an app-specific password ready if you haven't already generated one. I have no idea why, but it prompts you for one in VS.

This app failed to launch because of an issue with its license

I'm happily in the middle of coding then I try to launch my app in debug mode but I get this error message.
Unable to activate Windows Store app
This app failed to launch because of an issue with its license
The app was launching fine a few minutes earlier so this came as a surprise. I tried restarting Visual Studio but doing so did not help.
I got the annoying "renew your developer license" dialog yesterday I think. It had renewed without issue.
How do I make this error message go away so i can debug my app?
Well, I got it working by deleting the main project's 'bin' and 'obj' folders. Cleaning and Rebuilding wasn't enough. Hope this answer saves someone else the few minutes of confusion I just experienced.
I recently had a similar issue. In my case I had to uninstall the re-install the app to get it working.
Hope this helps someone. Also, to find out further detail about why it failed, you can checkout the event logs:
Event Viewer > Applications and Services logs > Microsoft > Windows > Aps > Microsoft-Windows-TWinUI/Operational
There might be some more detail in there. In my case it was logged as an error event which said the app could not be launched because of a temporary issue with its license.
I just uninstalled the existing version of the app from the start screen, and then launched the app again from Visual Studio and it is launched just fine.
I think the reason behind this is because of renewing the license of Visual Studio and trying to launch an app that was installed when the previous license was active.
I see doing stuff with the bin and obj folders appears to be the accepted answer to this.
I fixed this issue by selecting the 'Uninstall and then re-install my package. All information about the application state is deleted.' check box under the Debug tab of the project properties. You can uncheck it once you've done it once for all future builds.
I haven't had any issue with this solution. Simple fix and you don't have to worry about someone doing something to folders that could cause bigger issues.
http://daxdude.blogspot.com/2013/04/c-error-unable-to-activate-windows.html
I've had this issue a few times now, most of the time deleting the Bin and Obj folders will clear the issue up (These folders are automatically generated during a project build so don't worry about deleting them)
I have found whilst debugging on a remote device (A tablet or phone) that Deleting these folders doesn't solve the problem though - in this case the best solution I have found is just to do a restart on the device I was remote debugging to.
Simple but it works!
I just cleaned my solution and re-started Visual Studio. That did the trick for me - and didn't involve hunting around for files to delete, so you might want to try that first.
go to BUILD-->Clean Solution and click and after its has been cleaned again go to BUILD-->Rebuild Solution. After it has successfully rebuilt your solution just deploy it(Ctrl+F5). This solved the problem for me.

Resources