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.
D:\Ninjacrab\Projects\FacebookTesterProject\FacebookTester\build\apk\FacebookTester-debug-unaligned.apk
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!
Leave a Reply
You must be logged in to post a comment.