Sketchware-Pro / Sketchware-Pro

Sketchware Pro's sources in Java. Now anyone can contribute to Sketchware Pro.
https://sketchware.pro
Other
863 stars 254 forks source link

feat: improve build speed #273

Closed PranavPurwar closed 2 years ago

PranavPurwar commented 2 years ago

By stopping the unnecessary merging of dex files during debug build

PranavPurwar commented 2 years ago

oh wait before merging it, i think it should check min sdk version before skipping dex merging too

PranavPurwar commented 2 years ago

ok completed now

khaled-0 commented 2 years ago

I don't get it. What is your change supposed to do? Did you miss anything 🤔

PranavPurwar commented 2 years ago

merging dex files of libraries isn't necessary when minimum sdk is above 21 (due to multidex support) and a debug build is being done, so it will just skip that step.

tyron12233 commented 2 years ago

While its true that do not need to merge the dex files for each library on a debug build, you should still add each dex files on the apk. If you don't add them then the generated apk will crash as it can't find the classes of the libraries

PranavPurwar commented 2 years ago

ok done, anything else ?

JavkhlanK commented 2 years ago

testing out proposed changes will always be a great idea, btw

khaled-0 commented 2 years ago

testing out proposed changes will always be a great idea, btw

Fine, I'll do it myself. Snap

khaled-0 commented 2 years ago

sir i get error when aapt2 running

No direct method <init>(La/a/a/Dp;Ljava/io/File;ZLcom/besome/sketch/design/DesignActivity$a;)V in class Lmod/jbk/build/compiler/resource/ResourceCompiler; or its super classes (declaration of 'mod.jbk.build.compiler.resource.ResourceCompiler' appears in /data/app/~~Fyo07E1fOYNy_lvKMeWe3Q==/com.sketchware.remod-NS2SwT9gDw2hSySOcptxJQ==/base.apk!classes6.dex)

PranavPurwar commented 2 years ago

that appears to be related to ResourceCompiler

PranavPurwar commented 2 years ago

did you edit that file ? because that method is already present in the class

khaled-0 commented 2 years ago

did you edit that file ? because that method is already present in the class

i just made these changes on beta 6.4

PranavPurwar commented 2 years ago

that seems sussy, maybe a clean rebuild would solve that

khaled-0 commented 2 years ago

congratulation sir ur pr works With: image

without image

PranavPurwar commented 2 years ago

ok

PranavPurwar commented 2 years ago

send me the built apk so i run more tests with it

PranavPurwar commented 2 years ago

the first thing i would test: compiling a project with all appcompat, firebase, admob, map sdk, and all my local libs :trollface:

khaled-0 commented 2 years ago

send me the built apk so i run more tests with it

https://we.tl/t-mpKeiqgnUu Built on top of latest beta, nothing extra. Download link lasts for 10hrs maybe. Download fast

PranavPurwar commented 2 years ago

ok, thanks

PranavPurwar commented 2 years ago

what, it still merged dex files 😔 Screenshot_2021-11-23-22-04-55

khaled-0 commented 2 years ago

what, it still merged dex files 😔 Screenshot_2021-11-23-22-04-55

I don't know sir. But it's faster .sir its because That message is controlled by another class. Actually its not merging dex

PranavPurwar commented 2 years ago

but sir the output dex file is has merged libs 😔

khaled-0 commented 2 years ago

but sir the output dex file is has merged libs 😔

Screenshot_20211123-230852 Sir the app also contains your code sir And theres no other Dp.smali either. This onle lives inside smali_classes6

PranavPurwar commented 2 years ago

ok sir, maybe i did something wrong in minApi thingy

JavkhlanK commented 2 years ago

Dp#a will never change btw

JavkhlanK commented 2 years ago

You'd wanna use ProjectSettings (Dp#settings in this case) instead

PranavPurwar commented 2 years ago

ok

khaled-0 commented 2 years ago

You'd wanna use ProjectSettings (Dp#settings in this case) instead

But, Dp#a is still 21 by default so his code should work🤔 Mine built faster

khaled-0 commented 2 years ago

Screenshot_20211123-231833 Multiple dex sir. And classes2.dex contains some of lubrary and project classed too

franciscowilton commented 2 years ago

https://we.tl/t-mpKeiqgnUu Built on top of latest beta, nothing extra. Download link lasts for 10hrs maybe. Download fast

When compiling using Proguard the following error is returned: Compilation failed to complete, origin: /storage/emulated/0/.sketchware/mysc/601/bin/classes_proguard.jar

PranavPurwar commented 2 years ago

bruh, first of all, this is not a release secondly, i tried it and got no error, probably you're doing something wrong @franciscowilton

franciscowilton commented 2 years ago

bruh, em primeiro lugar, isso não é um release em segundo lugar, tentei e não achei nenhum erro, provavelmente você está fazendo algo errado @franciscowilton

Yes I know it's not a release, I'm just testing, reporting so they can resolve.

JavkhlanK commented 2 years ago

I just noticed that the changed method never gets called anymore lol image

PranavPurwar commented 2 years ago

lamo, so that's why that change didn't work

PranavPurwar commented 2 years ago

congratulation sir ur pr works With: image

without image

don't get how that worked lmao

khaled-0 commented 2 years ago

congratulation sir ur pr works With: image without image

don't get how that worked lmao

:thenking:

JavkhlanK commented 2 years ago

I don't think it's a good idea to copy the DEX files to Internal storage, as that's redundant. Adding them directly to the APK would work too. The current changes are also not affecting the DEX merging step, so these changes aren't worth a merge, sorry.

PranavPurwar commented 2 years ago

ok