← All articles
mobile

An Annoying IntelliJ Android Build Issue

IntelliJ threw a phantom 'apk.res not found' build error after a Git branch switch -- the fix was re-selecting the target Android platform in project settings.

Donn Felker

Donn Felker

2010.12.21 · 1 min read

Since I could not find the answer anywhere on the web, I’m posting it here just in case I have this issue sometime in the future.

I was working with IntelliJ early this morning and I received the following error:

File /Users/donnfelker/Documents/android/MyAwesomeApp/out/production/MyAwesomeApp/MyAwesomeApp.apk.res not found. Try to rebuild project

I tried rebuilding, clearing the IntelliJ caches, revering changes back to a previous version, everything. I continually got this funky error. Until I tried to run the code in an emulator via Run –> Run.

Fix

I opened up the project structure (same window that popped up when the Run –> Run command opened after it informed me I did not select an Android platform) and selected a target Android Platform. For some reason (who knows why) IntelliJ bombed when doing some Git branch work and it lost track of which Android version I was targeting. After applying the 2.2 target (which I was targeting before) everything worked as expected and I was able to build the project and deploy.

Donn Felker

Written by Donn Felker

I've spent 25+ years shipping software, writing books, and running my own companies. I write about thinking clearly, working for yourself, and doing real work while AI rewrites the rules. New essays land here every week.

Get the newsletter

Keep reading