-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Every second build fails due to compiler not finding things changed with DexReplace #28
Comments
Cheers, yeah I probably should have opened a new issue from the start! |
Ah yeah, that should work reliably - though for a larger app it's probably also slower than hitting compile twice! |
clean building is pretty fast if you enable gradle caching. MAKE SURE YOU DO!!! i don't think that's in the docs... it should! the v2 gradle plugins fully take advantage of caching. |
hey! i'm missing the orig/*apk. lanchon at google's email. |
and an unrelated comment. you are using:
platform 29 might require newer versions of these tools. consider downgrading to 28 if your app permits. |
The apk should be there, but it is checked in with LFS https://gitlab.com/alelec/fossil_smartwatches_alelec_android/blob/9c8fecfea815dbf33c68e13b5c78498bce3773b8/orig/Fossil_Smartwatches_v4.1.3.apk If you install git lfs it should work, or you could download it directly from that link. The original app appears to be compiled with build tools 29 so I assumed I needed to add well, haven't tried going back to 28. |
but i need the apk you feed dxp-gradle. is this the file that you already put though apktool and your class renaming script? |
Ah, yes it is the repacked/renamed one, this is what I feed into dxp-gradle. When I try your new auto-renaming I'll go back to the original unmodified apk, I can update this ticket when I have it up of you'd prefer. |
no, it's ok for investigating this issue. meanwhile, your use of
which is not surprising, as this dependency is processed by a zipTree(...) which shouldn't work on a straight directory. (or maybe i coded it to autodetect?) im suprised this works for you. what platform are you working on? |
FYI, im building using i still can't build. now i'm getting lots of these:
what's wrong? |
Yep that error is from the older dex-tools, I just switched back to your copy and sync'd it, the first error is
IIRC there's a newer android feature that trips it up, but works with the newer snapshot version included in the repo. I remember it taking a bit of trial and error (late at night) to get the gradle reference to the newer dex-tools working, but what's there builds fine in a clean checkout in CI so seems to work fine for me. Again, all the dex-tools files are checked in with LFS so may not have cloned correctly? |
ok so that's the issue. |
i was able to repro. i have a strong suspicion that this is caused by gradle's java compile avoidance:
i might be able to build a mockup of this without the dxp plugin and verify. and report it to gradle. |
observation: you should avoid as much as possible copying code from the source app.
for instance, look at AppType:
why not this instead?
|
Interesting... and thanks for the pointers. In this case, with But yeah I do tend to bring in more and more, even when I don't continue to use it (usually after a bit of debug tracing). Habits from my navdy project where I know the source apk's are never going to change again since the company closed. |
lol of course i didn't notice this :)) sorry
interesting... it probably is possible. an enum is just syntactic sugar. the values indeed are |
Adding a gradle [clean assembleDebug] target is definitely a step in the right direction. Do you know whether there's a way to just clean the compiler artifacts, leaving the decodeApk and dedex outputs there? update: scratch that, I found that by deleting
Permanenetly fixes my issue! (I already had this task with the |
lol, i told you! enable the gradle build cache. clean builds will be almost instantaneous |
Oh I did look into that, everything I could find said the gradle cache is automatically enabled by recent versions of Android studio. Is there something different you do? |
i dont remember, let me take a look. what i can tell you is, the cache works for stuff like apktool decode and dex2jar. if clean build causes those tasks to run, then it is not enabled in your setup. |
|
i think that was the Android Gradle plugin build cache. this was a "proprietary" solution for android. later, Gradle develop their own and better Gradle-wide cache, and then Google removed the ad-hoc old build cache from the Android plugin. |
Ah, I see. I guess this is what you mean, this makes more sense: https://docs.gradle.org/current/userguide/build_cache.html yep, [clean debug]:
thank you, thank you very much |
originally filed by: @andrewleech
moved to new issue by Lanchon
often every second build fails due to the compiler not finding a bunch of things I've changed with DexReplace. I hit build again and it always works though. Have you seen this? Thinking about it now, it might be from cases
the build issue I get, it's reliable for me with this project, this commit: https://gitlab.com/alelec/fossil_smartwatches_alelec_android/tree/9c8fecfea815dbf33c68e13b5c78498bce3773b8
It should just checkout and build, I'm currently on Android Studio 3.5.1 (though I've had this issue for a long time now)
Basically build, it works. build again, it's still fine (it doesn't re-compile anything). If I make one change (even just change formatting on a file, no functional change) the build fails, with the first failure being
In this case, jadx decompiles a number of functions like this with a couple more args than the builtin decompilers comes up with. So I've got the jadx copy sitting there completely DexIgnored and that satisfies the compiler (every second time) and function calls I make to the long version seem to work fine in practice. But every other time, the compiler only sees the jar version and complains the signature's wrong. Not the end of the world, I just compile again, but a bit odd nonetheless.
The text was updated successfully, but these errors were encountered: