Tommy-Geenexus / exif-eraser

Permissionless image metadata erasing application for Android
MIT License
205 stars 4 forks source link

v6.2.0 does not build #86

Closed IzzySoft closed 3 months ago

IzzySoft commented 3 months ago

Trying to build the latest release using ./gradlew assembleRelease from the commit the tag points to leads to a crash:

Configuration cache state could not be cached: field `__classpath__` of `com.android.build.gradle.internal.lint.LintTool` bean found in field `__lintTool__` of task `:app:lintVitalAnalyzeRelease` of type `com.android.build.gradle.internal.lint.AndroidLintAnalysisTask`: error writing value of type 'org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection'
> Dependency verification failed for configuration ':app:detachedConfiguration1'
  23 artifacts failed verification:
    - commons-codec-1.10.jar (commons-codec:commons-codec:1.10) from repository MavenRepo
    - groovy-3.0.17.jar (org.codehaus.groovy:groovy:3.0.17) from repository MavenRepo
    - groovy-3.0.17.pom (org.codehaus.groovy:groovy:3.0.17) from repository MavenRepo
    - httpclient-4.5.6.jar (org.apache.httpcomponents:httpclient:4.5.6) from repository MavenRepo
    - httpclient-4.5.6.pom (org.apache.httpcomponents:httpclient:4.5.6) from repository MavenRepo
    - intellij-core-31.5.2.jar (com.android.tools.external.com-intellij:intellij-core:31.5.2) from repository Google
    - intellij-core-31.5.2.pom (com.android.tools.external.com-intellij:intellij-core:31.5.2) from repository Google
    - kotlin-compiler-31.5.2.jar (com.android.tools.external.com-intellij:kotlin-compiler:31.5.2) from repository Google
    - kotlin-compiler-31.5.2.pom (com.android.tools.external.com-intellij:kotlin-compiler:31.5.2) from repository Google
    - kotlin-reflect-1.9.20.jar (org.jetbrains.kotlin:kotlin-reflect:1.9.20) from repository MavenRepo
    - kotlin-reflect-1.9.20.pom (org.jetbrains.kotlin:kotlin-reflect:1.9.20) from repository MavenRepo
    - lint-31.5.2.jar (com.android.tools.lint:lint:31.5.2) from repository Google
    - lint-31.5.2.pom (com.android.tools.lint:lint:31.5.2) from repository Google
    - lint-api-31.5.2.jar (com.android.tools.lint:lint-api:31.5.2) from repository Google
    - lint-api-31.5.2.pom (com.android.tools.lint:lint-api:31.5.2) from repository Google
    - lint-checks-31.5.2.jar (com.android.tools.lint:lint-checks:31.5.2) from repository Google
    - lint-checks-31.5.2.pom (com.android.tools.lint:lint-checks:31.5.2) from repository Google
    - lint-gradle-31.5.2.jar (com.android.tools.lint:lint-gradle:31.5.2) from repository Google
    - lint-gradle-31.5.2.pom (com.android.tools.lint:lint-gradle:31.5.2) from repository Google
    - play-sdk-proto-31.5.2.jar (com.android.tools:play-sdk-proto:31.5.2) from repository Google
    - play-sdk-proto-31.5.2.pom (com.android.tools:play-sdk-proto:31.5.2) from repository Google
    - uast-31.5.2.jar (com.android.tools.external.org-jetbrains:uast:31.5.2) from repository Google
    - uast-31.5.2.pom (com.android.tools.external.org-jetbrains:uast:31.5.2) from repository Google
  If the artifacts are trustworthy, you will need to update the gradle/verification-metadata.xml file. For more on how to do this, please refer to https://docs.gradle.org/8.9/userguide/dependency_verification.html#sec:troubleshooting-verification in the Gradle documentation.

That worked well with the previous one. So am I missing something here, or was maybe something missed to commit/push that's needed to build? Building on Debian Bookworm here with JDK 17, in case it matters.

Tommy-Geenexus commented 3 months ago

./gradlew --dependency-verification lenient assembleRelease will make it build

Tommy-Geenexus commented 3 months ago

There currently is an issue with gradle/AS and metadata verification, see https://github.com/Tommy-Geenexus/exif-eraser/blob/main/.github/workflows/assemble.yml#L33C9-L33C14

IzzySoft commented 3 months ago

Thanks, that helped! Builds now, though I had to patch out the call to signingConfigs.getByName as it failed at the signing part (I need an unsigned APK anyway to compare yours against). Now it not only builds, but also results in a Reproducible Build again – thanks!

For background: Reproducible Builds, special client support and more in our repo :wink:

Tommy-Geenexus commented 3 months ago

I'll update the gradle build to prevent exceptions when missing the signing config, that should make it easier for you.

IzzySoft commented 2 months ago

Eh, it actually was a one-liner, and is set up now – so no need to adjust:

  - tag: v6.2.0
    apks:
      - apk_pattern: app-release\.apk
        apk_url: https://github.com/Tommy-Geenexus/exif-eraser/releases/download/v6.2.0/app-release.apk
        build:
          - sed -r '/signingConfigs.getByName/d' -i app/build.gradle.kts
          - chmod +x gradlew
          - ./gradlew --dependency-verification lenient assembleRelease
          - mv app/build/outputs/apk/release/*unsigned.apk /outputs/unsigned.apk

I have that with so many apps, that sed line I add in less than a minute after skimming the corresponding build.gradle[.kts].

Should you already have changed it, please let me know so I adjust the recipe on the next update. No need to carry unnecessary commands, though in this case it wouldn't even fail I guess (just find nothing to replace, maybe).

You can find the results here, and the full recipe here, if you're curious :wink:

Tommy-Geenexus commented 2 months ago

Should you already have changed it, please let me know so I adjust the recipe on the next update.

getByName has been replaced by findByName which simply returns null, that should fix building release without a config (see https://github.com/Tommy-Geenexus/exif-eraser/commit/c3b18629cd09b308c3905b60ee3d76b8a9236220)

IzzySoft commented 2 months ago

New release built fine and is RB, thanks!