前提・実現したいこと
現在kotlinでandroidアプリを作成中にjsonobjectに変換してくれる外部ライブラリが必要になったので使えるようにしたい
https://github.com/cbeust/klaxon
を参考にした
発生している問題・エラーメッセージ
app下のgradleを変更したがエラーが発生しました。
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.beust:klaxon:3.0.1. Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.beust:klaxon:3.0.1. Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.beust:klaxon:3.0.1. Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.beust:klaxon:3.0.1. Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.beust:klaxon:3.0.1.
該当のソースコード
app/bulid.gradle
1apply plugin: 'com.android.application' 2 3apply plugin: 'kotlin-android' 4 5apply plugin: 'kotlin-android-extensions' 6 7android { 8 compileSdkVersion 28 9 defaultConfig { 10 applicationId "hamataku.example.com.myapplication" 11 minSdkVersion 24 12 targetSdkVersion 28 13 versionCode 1 14 versionName "1.0" 15 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 } 17 buildTypes { 18 release { 19 minifyEnabled false 20 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 } 22 } 23 24} 25 26dependencies { 27 implementation fileTree(dir: 'libs', include: ['*.jar']) 28 implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 29 implementation 'com.android.support:appcompat-v7:28.0.0-rc01' 30 implementation 'com.android.support.constraint:constraint-layout:1.1.2' 31 testImplementation 'junit:junit:4.12' 32 androidTestImplementation 'com.android.support.test:runner:1.0.2' 33 androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 34 implementation 'com.beust:klaxon:3.0.1' 35} 36repositories { 37 jcenter() 38} 39 40}
project/build.gradle
1// Top-level build file where you can add configuration options common to all sub-projects/modules. 2 3buildscript { 4 ext.kotlin_version = '1.2.60' 5 repositories { 6 google() 7 jcenter() 8 } 9 dependencies { 10 classpath 'com.android.tools.build:gradle:3.1.4' 11 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 12 13 14 // NOTE: Do not place your application dependencies here; they belong 15 // in the individual module build.gradle files 16 } 17} 18 19allprojects { 20 repositories { 21 google() 22 jcenter() 23 } 24} 25 26task clean(type: Delete) { 27 delete rootProject.buildDir 28}
試したこと
今までの外部ライブラリはlibsの中に.jarを入れていたのですがklaxonは.jarが配布されていなかったためできませんでした。
よろしくお願いします。
補足情報(FW/ツールのバージョンなど)
AndroidStudio3.14を使っています
回答1件
あなたの回答
tips
プレビュー