ericberman / MyFlightbookAndroid

Android client app for MyFlightbook.com
http://myflightbook.com
GNU General Public License v3.0
20 stars 8 forks source link

Clean up gradle files #276

Closed TacoTheDank closed 1 year ago

TacoTheDank commented 2 years ago

I stumbled across this app on IzzySoft's F-Droid repo and found some things that I think can be improved.


1st commit

2nd commit

3rd commit

4th commit


Thanks!

ericberman commented 1 year ago

Thanks. I'm going to have to dive in a bit on this because when I try to build your branch, it's not finding SwipeRefreshLayout, and thus isn't building. Were you able to build this without errors?

TacoTheDank commented 1 year ago

Oh, interesting. The only error I got was the missing googleApi key. The missing swiperefreshlayout is a simple fix, though. I'll fix that.

ericberman commented 1 year ago

No worries - I'm actually manually doing a bunch of these changes (Thanks!) on my branch because there are other incompatibilities besides swipe-to-refresh - updating some of the other dependencies is breaking Kotlin in weird ways, such as giving me false-positive errors (e.g., I have an exhaustive when statement that it's telling me is...not exhaustive, I have a couple of places where it's expecting a non-null value and complaining when I pass it a value! i.e., with the "!" to assert non-null). If I don't update those dependencies, everything is fine, so I'm going to just do these incrementally.

The gradle updates may be the hardest piece for me to unpack, partly because android studio doesn't expose a bunch of these files.

TacoTheDank commented 1 year ago

Mm, alright. I fixed the SwipeRefreshLayout error (the dependency was missing).

TacoTheDank commented 1 year ago

Also, the command I ran was ./gradlew wrapper --gradle-version 7.4.2 --distribution-type bin in Git Bash. You can independently verify the integrity of these files by running this command on your own machine and then using a file comparison tool (like WinMerge for example) to compare the results between this PR and your machine. You could also just use a hash checker, as that would be easier.

The updated JAR's integrity can be verified through this as well: https://gradle.org/release-checksums/

ericberman commented 1 year ago

Hmm...

ericberman@EricbeMac MyFlightbookAndroid % ./gradlew wrapper --gradle-version 7.4.2 --distribution-type bin Gradle 7.3.3 requires Java 8 or later to run. You are currently using Java 7. ericberman@EricbeMac MyFlightbookAndroid %

Not quite sure how to upgrade to using Java 8, particularly since I'm all Kotlin now. Already running Gradle 7.3.3, so the error is confusing me even more...

TacoTheDank commented 1 year ago

@ericberman I have not received any such error on my machine. I looked it up though. Try going to File | Settings | Build, Execution, Deployment | Build Tools | Gradle on your Android Studio installation. You should have the JDK set to something that says 11 (or default). This may fix the issue. Also, make sure your Android Studio installation is updated.

image

TacoTheDank commented 1 year ago

Also, appreciate the partial merge, but it seems you still left out some important things. I'll update the PR.

ericberman commented 1 year ago

Oh, I'm not done. It's just incremental, and I'm making sure it still works at each stage. I've found that a few components break things if I upgrade; I don't want to be touching functional code for this. I have more to do to merge these tomorrow.

THANK-YOU so much both for doing this, and for helping me with the merge items!!

ericberman commented 1 year ago

Thank-you for this!!!