• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Always rebuilding

23tony

Well-Known Member
This is something new.

Since I had a recent problem where I had to clean & rebuild, I now have to rebuild every time I make any code change.

Previously, I could make a change, then click the "play" icon (top right), and my changes would be applied.

Now, nothing gets applied. I've checked this by adding obvious log messages where they couldn't be missed, and they don't show up. I have to do Build->Rebuild Project to get my changes to register.

I'm guessing there may be a setting somewhere I messed up, or something like that? How do I get the previous behavior back?

(BTW this is only happening on one of my projects. Others work like they used to)
 
This is something new.

Since I had a recent problem where I had to clean & rebuild, I now have to rebuild every time I make any code change.

Previously, I could make a change, then click the "play" icon (top right), and my changes would be applied.

Now, nothing gets applied. I've checked this by adding obvious log messages where they couldn't be missed, and they don't show up. I have to do Build->Rebuild Project to get my changes to register.

I'm guessing there may be a setting somewhere I messed up, or something like that? How do I get the previous behavior back?

(BTW this is only happening on one of my projects. Others work like they used to)

I had this issue quite awhile back when the latest version was AS 3.1. Here's how I fixed it...
Go to File > Invalidate Caches/Restart

You may need to restart AS afterwards just for good measure.

Let me know if that works. I'll swing by here tomorrow to see how it worked out.
 
Just tried it. Unfortunately that did not do the trick. I still have to rebuild to register any code changes.
 
Just tried it. Unfortunately that did not do the trick. I still have to rebuild to register any code changes.

For some reason your AS is running the app from cache and is why it's not loading new changes. This is what my previous post is supposed to fix.

Lets try this... Repeat the steps from my previous post, but this time, afterwards click on "Sync Project with Gradle Files". It's the button with the blue arrow facing down-left.

If that don't work then go into the "Run" menu and "Edit Configurations". Make sure that at the bottom of the general tab you have "Gradle-aware Make" selected.

That's pretty much all I got since for me my previous post's fix worked.
 
I followed the first two instructions. Resyncing gradle did not help.

I noticed something interesting in the logs though - I suspect it's a symptom of it not building, though:
Code:
07/31 19:05:36: Launching app
No apk changes detected since last installation, skipping installation of /Users/tony/AndroidStudioProjects/JustAMap/app/build/outputs/apk/debug/app-debug.apk
$ adb shell am force-stop com.poc.justamap
$ adb shell am start -n "com.poc.justamap/com.poc.justamap.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Waiting for process to come online

I can't make the configuration change. That option is not available to me:
Screen Shot 2019-07-31 at 7.08.58 PM.png
 
Back
Top Bottom