Android Studio – Local path doesn’t exist

Playing with Android Studio again tonight and my little Facebook test app, I received an annoying error that I thought was resolved by cleaning the project and importing it fresh again. Sadly, the error came back again

Uploading file

local path: D:\Ninjacrab\Projects\FacebookTesterProject\FacebookTester\build\classes\debug\FacebookTester.apk
remote path: /data/local/tmp/com.ninjacrab.facebooktester
Local path doesn't exist.

When I review the file system I see that the apk is generated but in a different folder and with a different name.


However, it seems as though AndroidStudio doesn’t want to use that APK for debugging. After some painful experimentation it turns out that there is an poorly documented option that is not included in the “.iml” file that you can configure to fix it. (My .iml was located at D:\Ninjacrab\Projects\FacebookTesterProject\FacebookTester)

There are multiple “.iml” files, one for the master project, one for the module that contains that produces the apk. If you edit the “.iml” file for the module and add the following option with path respective to your project

<option name="APK_PATH" value="/build/apk/FacebookTester-debug-unaligned.apk" />

You should be able to debug again from AndroidStudio. Happy coding!

Facebook connecting Android App

Well since Random coding didn’t happen, I decided to move to another hobby project which was creating an Android activity that would connect to Facebook, get me an identity so that I could use it to handle Authentication for Conflicademia. I don’t personally care about managing accounts and I was thinking of some other distraction from actual game content. Regardless, it was finally a success and I think my next personal coding session will go to the game again.

Note to others, the instructions provided by Facebook for getting started with Android Studio had a number of hurdles to overcome.

One with Gradle, which as far as I can tell is something like Maven or MsBuild with a Nuget attachment. I should have documented everything that I did to make it work, but I didn’t. Those of you trying to follow the examples and giving up. Sorry for the documentation fail.

The other issue was the instructions for generating the “Key Hash” with OpenSSL. I kept getting an error stating “remote app id does not match stored id”. So I did a little bit of Googling and came across the following link.

Regenerated the keyhash from the code sample, replaced it on the app configuration in Facebook and viola. It all worked

With that, I think tonight was generally satisfactory in terms of hobby productivity.

Random Coding 3 didn’t happen… yet!

Well, I was diligently playing with Nuget packaging and hoping to make a video where I create a Nuget package that hosts the VSIX that I created in random coding two. However, it seems as though Nuget doesn’t support installing a VSIX, item templates or project templates.

I then sat back and thought “Unpossibleh!!!”

I’m certain I’ve downloaded packages that alter Visual Studio’s menus and options and then it hit me.

I built a Visual Studio Extension.

Nuget is a package manager for libraries.

I didn’t need to place the VSIX in a Nuget package, I simply needed to upload the extensions to the Visual Studio Extensions Gallery. There really is no need for a 2 minute video on uploading the package that was created. So now I’ll be off to thinking about my next random coding Video topic.

Regardless you may now download my project and item templates from the Visual Studio Gallery, but it’s incredibly incomplete as I no longer develop Prism apps.

I probably should delete it, but maybe I’ll get back around to it.