0

I've a problem building my app in Android Studio. It is just a small app (about 35 classes) with now modules and with only a few library dependencies. But Android Studio or Gradle often seems to build old sources.

For example now I added a simple line Log.i(TAG, "var: " + var). But I don't get this output. I tried to clean the project and then run it again but still there is no log-output. After cleaning and running once again I get this message:

10/07 09:27:11: Launching app
The APK file <path-to-file>/<file>.apk does not exist on disk.
Error while Installing APK

I know I maybe can solve this buy uninstalling the app first and building it again and/or even by clicking "refresh all gradle projects" but I don't want to do that all the time. I only have this problem for about 2 months now. But it appears very irregural.

I am using the following versions now:

  • macOS Sierra Version 10.12
  • Android studio 2.2 Buikd #AI-145.3276617, built on September 15, 2016 (JRE: 1.8.0_76-release-b03 x86_64)
  • java version "1.8.0_102", Java(TM) SE Runtime Environment (build 1.8.0_102-b14), Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode
  • Gradle 2.2.0

But this problem also appeared in another app on another system, too. There I used El Capitan and a beta version of Android Studio 2.1.

So what can I do?

Btw. I never used InstantRun. So this is definitely disabled.

unlimited101
  • 3,653
  • 4
  • 22
  • 41
  • By default `InstantRun` is enabled. Therefore your app is not restarted, but patched with the new code at runtime. If the changed code is in `onCreate()` of your MainActivity it will not be executed as the MainActivity is already running. – Robert Oct 07 '16 at 08:02
  • If you test the `./gradlew` command to build your app, and see the same problems, then it likely isn't the IDE – OneCricketeer Oct 07 '16 at 08:12
  • @cricket_007 I wanted to check this but I uninstalled the app by mistake so now I need to wait til the problem appears again. Because after re-installing it works. But as I told I don't want to uninstall the app on every small code change. But assuming my IDE is not the problem. What else could be the problem? – unlimited101 Oct 07 '16 at 08:22
  • Maybe you aren't seeing `Log` output because you've filtered it out in the LogCat settings somehow – OneCricketeer Oct 07 '16 at 08:24
  • No, there are no filters on. Everything is right with logcat. I think it is something with gradle but I don't know what. – unlimited101 Oct 07 '16 at 08:39

0 Answers0