Razeeman / Android-SimpleTimeTracker

Simple app that tracks time.
GNU General Public License v3.0
631 stars 80 forks source link

F-Droid can't build #89

Closed licaon-kter closed 5 months ago

licaon-kter commented 1 year ago

ref: https://gitlab.com/fdroid/fdroiddata/-/jobs/3917489169#L2102

I've tried some tricks about PNGs but maybe they need to be adapted to Kotlin? eg. https://gitlab.com/fdroid/fdroiddata/-/issues/2816#note_1311197528

Razeeman commented 1 year ago

Interesting. Previous version was built fine and nothing significant changed since last version except of maybe raising Room library version. Also I don't recognize these pngs and don't think that the app has any pngs at all, maybe they are from some external library. Did something maybe changed on the fdroid side?

licaon-kter commented 1 year ago

Also I don't recognize these pngs and don't think that the app has any pngs at all, maybe they are from some external library

https://github.com/Razeeman/Android-SimpleTimeTracker/tree/master/app/src/main/res/ has PNGs in mipmap folders, the names in the APK are different once processed, afaik

Did something maybe changed on the fdroid side?

Not recently

Razeeman commented 1 year ago

Sorry, you are right, there were some PNGs in the project, but also they were there for a long time. Converted them to webp anyway, maybe it will help with the next f-droid build.

ghost commented 1 year ago

@licaon-kter is there any update on this issue?

licaon-kter commented 1 year ago

Maybe the next release that was just pushed....

linsui commented 1 year ago

https://gitlab.com/fdroid/fdroiddata/-/jobs/4279706696 It failed...

linsui commented 1 year ago

One of the different pngs is UGX. I guess it's generated from a drawable icon.

I thought this is the problem. Could you please try this workground?

linsui commented 1 year ago

For kts, both

vectorDrawables.generatedDensities()

and

vectorDrawables.generatedDensities?.clear()

should work. I added them to core/build.gradle.kts and got the same apks.

Razeeman commented 1 year ago

Hello! Thank you for the help. Problem indeed seems to be with the pngs generated from vector drawables. This fix maybe would work but lower apis (19, 20) will crash without generated pngs. So it would be also required to raise minSdk to 21. Fortunately very very small number of users are using such old phones.

@licaon-kter @linsui I was wondering if there is an easy way to check fdroid build without releasing a new update? I've checked documentation and it seems that fdroidserver and fdroiddata repos should be installed and configured properly to run fdroid build, and it doesn't seem like a trivial task.

licaon-kter commented 1 year ago

@Razeeman you can open a MR here: https://gitlab.com/fdroid/fdroiddata/-/merge_requests and the Gitlab CI will run fdroid for you

Razeeman commented 1 year ago

@licaon-kter Hello! New release was pushed, implemented this fix, also raised minSdk to 21, checked that vector drawables didn't generate pngs now.

fdroid data was updated it seems, but it didn't trigger fdroid build.

Can you help identify the problem?

linsui commented 1 year ago

It builds. Thanks! See https://gitlab.com/fdroid/fdroiddata/-/jobs/4324352340

Razeeman commented 1 year ago

Thank you for the help!

licaon-kter commented 6 months ago

so I won't open a new one, can you reopen this?

ref: https://gitlab.com/fdroid/fdroiddata/-/jobs/6468076066#L1765

only difference is:

│ │ │ │ │ │   --- 1.40-stt-base-release/smali/com/example/util/simpletimetracker/DaggerTimeTrackerApp_HiltComponents_SingletonC$SingletonCImpl.smali
│ │ │ │ │ ├── +++ com.razeeman.util.simpletimetracker_43/smali/com/example/util/simpletimetracker/DaggerTimeTrackerApp_HiltComponents_SingletonC$SingletonCImpl.smali
│ │ │ │ │ │ @@ -5059,15 +5059,15 @@
│ │ │ │ │ │  .method public injectTimeTrackerApp(Lcom/example/util/simpletimetracker/TimeTrackerApp;)V
│ │ │ │ │ │      .locals 0
│ │ │ │ │ │      .annotation system Ldalvik/annotation/MethodParameters;
│ │ │ │ │ │          accessFlags = {
│ │ │ │ │ │              0x0
│ │ │ │ │ │          }
│ │ │ │ │ │          names = {
│ │ │ │ │ │ +            "arg0"
│ │ │ │ │ │ -            "timeTrackerApp"
│ │ │ │ │ │          }
│ │ │ │ │ │      .end annotation
│ │ │ │ │ │  
│ │ │ │ │ │      .line 0
│ │ │ │ │ │      return-void
│ │ │ │ │ │  .end method

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/424f243c7325f6f85bec53bbcccfe39feb9b128f

Razeeman commented 5 months ago

@licaon-kter Hello! I'm not familiar with Fdroid building process. Can you share what are the two apks that are being compared here, where are they came from?

licaon-kter commented 5 months ago

The CI APK was removed so can't point to it directly,

The recipe is here: https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/com.razeeman.util.simpletimetracker.yml#L247-L259

so, those two seds are run, then gradle clean, then gradle assembleBaseRelease, the log shows as much: https://gitlab.com/fdroid/fdroiddata/-/jobs/6468076066#L1765

Razeeman commented 5 months ago

Is it correct that CI builds apk and then compares it to the one stored in github releases?

licaon-kter commented 5 months ago

yes, as set in the recipe: https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/com.razeeman.util.simpletimetracker.yml#L12

and seen in the CI log: https://gitlab.com/fdroid/fdroiddata/-/jobs/6468076066#L1676

/LE: I'll rebuild locally to test again

Razeeman commented 5 months ago

Local build does have this line in it, as mentioned here https://github.com/Razeeman/Android-SimpleTimeTracker/issues/89#issuecomment-2017737970. But I'm not sure what produces this difference, may be it is built this different java version, or these sed commands do something, need to research more.

image
licaon-kter commented 5 months ago

may be it is built this different java version

you mean you don't use Java 17?

these sed commands do something,

you can run them in the app folder, clean cache, rebuild APK, how is that then?

Razeeman commented 5 months ago

Yep. Seems like It caused by sed commands. Run them locally and rebuild as you suggested.

image
licaon-kter commented 5 months ago

Ok, let me review them then, thanks for the confirmation

Razeeman commented 5 months ago

Maybe I spoke too soon, sorry, I didn't try to rebuild locally before running these commands. I've tried that and it also produces correct build even without running sed commands.

Razeeman commented 5 months ago

@licaon-kter Can you please share, If I rebuild version 1.41 and reupload it to github releases, will it appear on fdroid or new release should be created in order to trigger fdroid update?

licaon-kter commented 5 months ago

it's disabled now for 1.41, so we can enable it after confirming

so, you can update the APK in https://github.com/Razeeman/Android-SimpleTimeTracker/releases/tag/v1.41 and then we recheck

Razeeman commented 5 months ago

Rebuilt 1.41 and updated apk in github release.

licaon-kter commented 5 months ago

@Razeeman wow, that's repro :tada: how did you fix it?

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/2379245df9274401b69976f2803ca9ef58011e15

Razeeman commented 5 months ago

Just rebuilt it the usual way. Not sure what messed up previous two releases. Will keep an eye next time.