Status Update
Comments
yo...@gmail.com <yo...@gmail.com> #2
Workaround: Check "Always install with package manager" in the run config.
xa...@google.com <xa...@google.com> #3
Does it runs a build at all or just does not do anything?
yo...@gmail.com <yo...@gmail.com> #4
Yes, it runs :app:assembleDebug
successsfully and then it SAYS that is does an install... but the app is not updated, just relaunches the activity.
Doesn't seem to be a race condition with the build step, because you can just keep running the install and the app never updates.
Works fine on API 23.
uc...@google.com <uc...@google.com>
ac...@google.com <ac...@google.com> #5
no...@google.com <no...@google.com> #6
When this occurs, can you filter logcat for "studio.deploy" events and paste the output here? (ensuring that the box on the top right of the logcat window is set to "No Filters" instead of "Show only selected application")
pa...@nearside.com <pa...@nearside.com> #7
Not OP, but I can repro the issue on my machine (MacOS 10.15.7, Arctic Fox 2 + AGP 7.0.2 + Kotlin 1.4.20 + Emulator v30). Here's the filtered logs from logcat:
2020-12-07 11:36:39.423 13198-13198/? I/studio.deploy: DeltaInstall found API level:30
2020-12-07 11:36:39.423 13198-13198/? I/studio.deploy: -t
2020-12-07 11:36:39.424 13198-13198/? I/studio.deploy: --user
2020-12-07 11:36:39.424 13198-13198/? I/studio.deploy: current
2020-12-07 11:36:39.424 13198-13198/? I/studio.deploy: --full
2020-12-07 11:36:39.424 13198-13198/? I/studio.deploy: --dont-kill
2020-12-07 11:36:39.424 13198-13198/? I/studio.deploy: --skip-verification
2020-12-07 11:36:39.424 13198-13198/? I/studio.deploy: -r
2020-12-07 11:36:39.441 13198-13198/? I/studio.deploy: DeltaInstall created session: '1102668881'
2020-12-07 11:36:39.441 13198-13198/? I/studio.deploy: package
2020-12-07 11:36:39.441 13198-13198/? I/studio.deploy: install-write
2020-12-07 11:36:39.441 13198-13198/? I/studio.deploy: -S
2020-12-07 11:36:39.441 13198-13198/? I/studio.deploy: 9670052
2020-12-07 11:36:39.441 13198-13198/? I/studio.deploy: 1102668881
2020-12-07 11:36:39.441 13198-13198/? I/studio.deploy: base.apk
2020-12-07 11:36:39.553 13198-13198/? I/studio.deploy: Streaming succeeded for '/data/app/~~wkPc3lOFt2w7hPRdWFqVVw==/com.hatchcard.android-r7J6pVCNa8OS5B3hohWTFQ==/base.apk'
2020-12-07 11:36:39.553 13198-13198/? I/studio.deploy: package
2020-12-07 11:36:39.553 13198-13198/? I/studio.deploy: install-commit
2020-12-07 11:36:39.553 13198-13198/? I/studio.deploy: 1102668881
ac...@google.com <ac...@google.com> #8
adb -s emulator-5554 shell run-as com.example.myapplication mv code_cache/.overlays code_cache/.overlay
I suspect this is related to a typo in a recent clean up refactor.
co...@protonmail.com <co...@protonmail.com> #9
Looks like this just bit me.
Arctic Fox C2 with a pixel 5. =(
co...@protonmail.com <co...@protonmail.com> #10
Just tried
adb shell run-as com.example.myapplication mv code_cache/.overlays code_cache/.overlay
and it seemed to work. I'm going to see if I can repro the app not installing/launching properly again and then try the command again to make sure it wasn't a fluke.
co...@protonmail.com <co...@protonmail.com> #11
I was able to repro again and tried the command and it worked!
Ship it (in canary 3 please)!
ac...@google.com <ac...@google.com> #12
We apologize for the unfortunate typo. I am going to close this bug for now, please don't hesitate to report back if Canary 3 didn't fix it or renaming the overlay directory isn't working.
co...@protonmail.com <co...@protonmail.com> #13
lo...@gmail.com <lo...@gmail.com> #14
On the other hand, it's sad that is was a typo that made it to a release instead of a failing build.
lo...@gmail.com <lo...@gmail.com> #16
I think it didn't ship in Canary 3 as I lost time against this issue again even though I'm on AGP 7.0.0-beta03 with AS Arctic Fox Canary3.
Unfortunately, it seems to also affect command line installs (like the installDebug gradle task, launched from the Gradle tool window in my tests).
@
co...@protonmail.com <co...@protonmail.com> #17
If it didn't, do you know of some gradle task or something we can add in the meantime so that my entire team doesn't have to remember to run an adb command?
ac...@google.com <ac...@google.com> #18
This should be out in C3. If you having seeing this issue with command-line, I suspect this is entirely different issue. If that's the case, can you file a new bug?
This bug entry got a bit confusing. So for this .overlays issue:
-Workaround with the adb rename command should fix it
-Only happens in API 30
-Should NOT happen on commandline gradle.
If any of these is not true, it would be great if you can open another bug for us.
Re: #17
I just checked the C3 build and it should have the fix. Can you try uninstalling the app first?
If you are still seeing this, can you try:
adb shell run-as com.example.myapplication ls code_cache
To see if it still say .overlays or .overlay?
pa...@nearside.com <pa...@nearside.com> #19
It looks like C3 AS+AGP fixed the issue for me. It did require an uninstall of my debug APK, which was odd.
lo...@gmail.com <lo...@gmail.com> #20
@
I tried to uninstall my app and reinstall with the IDE, following the comments that it would only be partly fixed since it requires an undocumented action to take for affected users or it continues to plague you… and the issue is still there 😓
I changed a constant (the baseUrl for a server) to reference another constant with a different value, and it didn't take the change into account despite the uninstall.
To me, this is the same issue that takes its roots in AGP rather than the IDE. It's not clear what has been fixed as part of this issue since there's no link to the diff.
ac...@google.com <ac...@google.com> #21
I understand your frustrations. I do suspect you are running into a completely different bug where none of the information in this whole thread is applicable to your situtation.
To help us resolve the issue, can you provide more information for us.
1) Are you running this on an API 30 device?
2) If 1) is yes, can you run: "adb shell run-as com.example.myapplication ls code_cache" after you run the application the 2nd time and notice the application is unchanged.
3) Did you notice the application getting restarted after you run?
4) You mentioned a command line Grade invocation after a code change does not result a correct APK? Can you run a binary diff of the output APK to make sure different APK is built?
5) Is there a good way were we can reproduce this on C3? Does it happen on a brand new created project?
lo...@gmail.com <lo...@gmail.com> #22
I just opened a new issue as you suggested:
1. Are you running this on an API 30 device?
Yes (already specified in the issue which device exactly, spoiler alert: Pixel 2 XL)
2. can you run: "adb shell run-as com.example.myapplication ls code_cache" after you run the application the 2nd time and notice the application is unchanged.
The code_cache
directory is empty for my app (after installing the app after the change and uninstalling, which didn't deploy my change).
After hitting run a second time (which launched the app again) and running the command again, I get this:
install_server-cb306cb8
startup_agents
3. Did you notice the application getting restarted after you run?
Yes, it always does.
4. You mentioned a command line Grade invocation after a code change does not result a correct APK? Can you run a binary diff of the output APK to make sure different APK is built?
It was running the installSomeFlavorDebug
Gradle task from the IDE.
The result is quite weird, borderline concerning: The apks are different, with megabytes of difference (for theoretically just a constant change that is 54 to 57 chars long).
The apk analyzer tells me there's a 4.3MB difference, but is unable to tell me why as everything has the same size (though some rounding might be involved). Did that constant change really put zipping off by so much? See the attached screenshot.
Just in case, I checked the sha256 of both files, and indeed, they are different (though my constant still misses the change).
5. Is there a good way were we can reproduce this on C3? Does it happen on a brand new created project?
I believe the reproducing steps in the issue I linked should do it.
Description
Build: AI-202.7319.50.2031.7006259, 202012020750,
AI-202.7319.50.2031.7006259, JRE 11.0.8+10-b944.6842174x64 JetBrains s.r.o, OS Mac OS X(x86_64) v10.15.7, screens 1440x2560, 2560x1440; Retina
AS: Arctic Fox | 2020.3.1 Canary 2; Kotlin plugin: 1.4.20-release-Studio4.2-1; Android Gradle Plugin: 7.0.0-alpha02; Gradle: 6.7.1;
repro
app
"Run" config to launch the app on the API 30 deviceapp
"Run" config for a second, third, fourth time.Install successfully finished in 175 ms.
Actual
Relaunches the previously installed version of the app, latest changes are NOT installed.
Expected
Updates the install with new version with the changes and Relaunches the updated install of the app.