Access to the path resources.apk.bk is denied - android

When using Visual Studio 2017 and building a Xamarin project for Android I get the following error:
access to the path resources.apk.bk is denied
I've been getting this error for over 4 years and I know it's related to McAfee Enterprise but I still can't seem to fix it and the web has been no help. Every once in a while I take some time out and try again to fix it. Persistence paid off and I finally found the fix shown below.

You have to exclude resources.apk.bk from McAfee Enterprise OnAccess scanning but the trick is to configure it properly and the method is confusing.
I struggled with this because I kept adding resources.apk.bk to the "On-Demand" exclusions but that won't work, you have to add it to the "On-Access" exclusions.
There are 2 ways to fix it. If you have permission to configure your own McAfee client then I provide instructions below. Otherwise you have to have your McAfee administrator fix it which I show below as well.
McAfee Admin Instructions:
This step should be performed on the McAfee Enterprise server by your McAfee Enterprise Admin. Add resources.apk.bk to the "On-Access" exclusions, make sure they know it's for "On-Access" and not "On-Demand".
Fix you can do yourself if you have permission
Right-Click on the McAfee icon in your task bar and click on "McAfee Endpoint Security".
Assuming it's password protected, login with the admin password.
In the green bar near the top click the text "Threat Prevention"
Click "Show Advanced" button on the right
Click "On-Access Scan" on the left
Scroll down a little further until you see the Exclusions box
Click Add
within the top input box type in resources.apk.bk then click "Ok"
Click "Apply" at the top right.
You should now be able to rebuild your Xamarin Forms Android project without receiving the error.
NOTE!
Keep in mind, if you configure your McAfee yourself, depending on how your McAfee Enterprise is setup your configuration may be overwritten at any moment, because most McAfee Enterprise setups overwrite your own configurations every 5 minutes because they want to make sure everyone is applying a policy that management requires.

Related

Debugging API in browser and Android app in emulator same time on one Visual Studio

I have Xamarin project based on ASP.NET Web API which is my 2nd sub-project in the same solution. I couldnt find similar problem anywhere so I think that sadly I have to run two Visual Studios which would like to to avoid.
What I want to accomplish is to debug API and android app in same time in one Visual Studio window. Is it even possible?
Example of manual test:
1. Android button click sends request to api.
2. API business logic has break point to check it.
3. Android app gets data from the API.
You can have multiple startup projects in Visual Studio. Here's how to do it in Visual Studio 2015 (from MSDN):
In the Solution Explorer, select the solution (the very top node). Right-click the node to get the context menu.
Select Properties. The Solution Property Pages dialog box opens.
Expand the Common Properties node, and click Startup Project.
Click Multiple Startup Projects and set the appropriate actions. For more information, see NIB How to: Modify Project Properties and Configuration Settings.
You can also start debugging the Android app normally and launch the Web API project later on by right clicking it on the Solution Explorer and clicking Debug > Start New Instance.

Where to check for Android Permissions?

We are moving our app to SDK 23 and realize that we need to explicitly handle permissions in the code.
Instead of going through the entire code base, is there a best practice (or an IDE shortcut) that would help us determine all the places where we may need to use 'ContextCompat.checkSelfPermission' for each permission in the app?
If you are using Android Studio try this:
1- Click on Hector the Inspector (the small icon of a man with a moustache at the very bottom-right of Android Studio). This will show up an option to Configure inspections.
2- Type 'Permissions' into the searchbar, and ensure that "Constant and Resource Type Mismatches" is checked.
3- Run Analyse > Inspect Code.
You need to check for permission each time you use the functionnality who requires it, because you do not know witch path the user will follow in your app.
Remove all permissions node in Manifest, test your app and identify every time you get a permission denied error.
In Android studio 2.2 a new feature is implemented to make it easier to move your app to SDK 23. It is still work in progress howerver.
It is shown here. It adds an option to the refactor menu, which automatically implements the necessary permission checks.

How to use DDMS within Android Studio?

I'm trying to see the contents of a database I'm using through the execution of my program via DDMS. I've looked at lot of questions on here that explain how it's done. My understanding relies on the fact that on clicking Tools--> Android--> Android Device Monitor, there is a change in perspective however nothing of the sort happens when I do the above. In fact, there seems to be no indication at all, that I selected the Android Device Monitor. Could someone please point me in the right direction of finding out what could be wrong?
Going off what #will421 said in the comments, I ran monitor.bat and the typed out monitor in the console (Both needed to be done.) and then I was prompted to enter my sdk path. What tripped me up was the fact that I had two folders labelled sdk and sdk1 so choosing the right one is important. To view the contents of the dtatabase, I just followed along with the great answer at View contents of database file in Android Studio

How do I see gradle tasks run by Android Studio?

I'm following the course "Developing Android Apps" on udacity.
I have a problem on Lesson4A with the test suite (TestUtilities) complaining "Task 'cleanTest' not found in root project 'Sunshine'.
And then it points me to run with --stacktrace option.
But I don't know how I can run the command on the terminal in the first place.
How can I see what gradle-tasks that android studio is running?
Thanks :)
At the bottom right corner of Android Studio you have different views:
Gradle console
Event Log
Additionally, if your Gradle is running, will appear a 3rd one where you can see a progress bar with some information about the process. But if you want a full details use the 2 first views.
I believe you have not do the configuration at first, as the default configuration is not appropriate for this project.
Select Edit Configurations next to Run button on toolbar
Make a testing configuration, by click the + button and select Android Test.
Make sure you choose "Show Chooser dialog" in target device section if you are using Virtual devise like Genymotion
Hit OK and press the run button.
PS. Make sure your have this configuration under Android Test, and nothing under JUnit dropdown.
I was confused at first, but not anymore after I tried above steps from Udacity notes.

How to remove 'unremovable' consoles from eclipse

I don't work with android all the time, sometimes I am working with a server/client app and I need to check the console output of both. What I used to be able to do was pressing the little blue monitor button on the console view to toggle between the two. But now it also have other 3 irremovable consoles(DDMS, OpenGL Trace View, Android) that I don't use, not even when developing for android. What I want to know is how to permanently remove those 3 console views. I don't want to have separated eclipse installations nor having to install/uninstall plugins whenever I am not developing for android.
I am prepared to delete/modify plugin source files, however I don't even know what I would be looking for
You don't have to modify .
1)Go to "windows->open perspective" and choose it for yourself
2) Or go to windows->show perspective select as it suits you.

Categories

Resources