1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Android Library を自作してJit pack に公開する時の備忘録

Posted at

概要

Android Library を自作してJit pack に公開する時に遭遇した
エラーなどを備忘録的に残しておきたいと思います。

基本的な流れ

こちらの神記事をフォローします。

いくつかの変更点と備忘録

ただ、いくつか変更した箇所がありました。

build.gradle.kts

私の場合、build.gradle でなく、
build.gradle.kts (kotlin) を使っていたので、
app レベルのbuild.gradle.kts には

build.gradle
afterEvaluate {
    publishing {
        publications {
            // Creates a Maven publication called "release".
            release(MavenPublication) {
                from components.release
                groupId = 'com.github.xxx'
                artifactId = 'xxx-yyy-zzz'
                version = '0.0.1'
            }
        }
    }
}

から、

build.gradle.kts
afterEvaluate {
    publishing {
        publications {
            create<MavenPublication>("release") {
                from(components["release"])

                groupId = "com.github.xxx"
                artifactId = "xxx-yyy-zzz"
                version = "0.0.1"
            }
        }
    }
}

というふうにフォーマットを書き換える必要がありました。

jitpack.yml

jitpack.yml に

jitpack.yml
jdk:
  - openjdk11

と最初記載していましたが、

* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 17 to run. You are currently using Java 11.

というビルドエラーがjit pack で出たため、

jitpack.yml
jdk:
  - openjdk17

とjdkのバージョンを調整しました。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?