質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
RxJava

RxJavaは、リアクティブプログラミングができるReactiveXのJava向けの実装。軽量であり、その他のライブラリへの依存がなく、RxJavaのjarをパスに通せば使用できます。バージョン2.3からはAndroidもサポートしています。

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Kotlin

Kotlinは、ジェットブレインズ社のアンドリー・ブレスラフ、ドミトリー・ジェメロフが開発した、 静的型付けのオブジェクト指向プログラミング言語です。

Q&A

解決済

1回答

11068閲覧

kotlinの環境構築でbuildが出来ない

yasushi_cohi

総合スコア16

RxJava

RxJavaは、リアクティブプログラミングができるReactiveXのJava向けの実装。軽量であり、その他のライブラリへの依存がなく、RxJavaのjarをパスに通せば使用できます。バージョン2.3からはAndroidもサポートしています。

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Kotlin

Kotlinは、ジェットブレインズ社のアンドリー・ブレスラフ、ドミトリー・ジェメロフが開発した、 静的型付けのオブジェクト指向プログラミング言語です。

0グッド

1クリップ

投稿2019/01/29 18:53

編集2019/01/30 20:49

様々なエラーが出て、ビルド(▷Run 'app')が出来ません。
エラー文をもとに検索をしましたが、良い解答は得られませんでした。
StackOverFlowなどの海外のサイトも当たり、試行錯誤しましたが、無意味でした。
Rebuild,Clean Project,Invalidate Caches and Restartは何回も試しました。
打つ手がない状況です。
個人的にはbuild.gradleの問題だと思っています。

何かいい方法はございませんか。


AndroidStudioは3.3です。

以下警告

app: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.android.databinding:compiler:3.1.0'.


A problem was found with the configuration of task ':app:kaptDebugKotlin'. Registering invalid inputs and outputs via TaskInputs and TaskOutputs methods has been deprecated and is scheduled to be removed in Gradle 5.0.

Cannot write to file 'D:\Github Local\Android-1\SampleApp\app\build\intermediates\data-binding\debug\bundle-bin'
specified for property 'dataBindingArtifactOutputDir' as it is a directory.


警告: 注釈プロセッサ'org.jetbrains.kotlin.kapt3.ProcessorWrapper'から-source '1.8'より小さいソース・バージョン'RELEASE_7'がサポートされています

e: [kapt] An exception occurred: android.databinding.tool.util.LoggedErrorException: failure, see logs for details.
Exception while handling step android.databinding.annotationprocessor.ProcessExpressions@7c86326a javax.xml.bind.UnmarshalException
with linked exception:
[com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 1バイトのUTF-8シーケンスのバイト1が無効です。]
・・・
Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 1バイトのUTF-8シーケンスのバイト1が無効です。


以下build.gradleです。

buildgradle

1apply plugin: 'com.android.application' 2 3apply plugin: 'kotlin-android' 4 5apply plugin: 'kotlin-android-extensions' 6 7apply plugin: 'kotlin-kapt' 8 9android { 10 compileSdkVersion 27 11 defaultConfig { 12 applicationId "sampleapp.practice.com.sampleapp" 13 minSdkVersion 21 14 targetSdkVersion 27 15 versionCode 1 16 versionName "1.0" 17 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 18 } 19 buildTypes { 20 release { 21 minifyEnabled false 22 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 } 24 } 25 26 compileOptions { 27 sourceCompatibility JavaVersion.VERSION_1_8 28 targetCompatibility JavaVersion.VERSION_1_8 29 } 30 31 dataBinding { 32 enabled = true 33 } 34} 35 36dependencies { 37 38 // model 39 implementation project(':model') 40 41 // Support Library 42 def supportLibraryVersion = '27.1.0' 43 implementation "com.android.support:support-v4:$supportLibraryVersion" 44 implementation "com.android.support:appcompat-v7:$supportLibraryVersion" 45 implementation "com.android.support:design:$supportLibraryVersion" 46 implementation "com.android.support:support-vector-drawable:$supportLibraryVersion" 47 implementation "com.android.support:cardview-v7:$supportLibraryVersion" 48 implementation "com.android.support:customtabs:$supportLibraryVersion" 49 implementation 'com.android.support.constraint:constraint-layout:1.1.0-beta6' 50 51 // glide 52 implementation 'com.github.bumptech.glide:glide:3.7.0' 53 54 // kotlin 55 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" 56 57 // retrofit 58 def retrofitVersion = '2.3.0' 59 implementation "com.squareup.retrofit2:retrofit:$retrofitVersion" 60 implementation "com.squareup.retrofit2:converter-moshi:$retrofitVersion" 61 implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion" 62 63 // Kotshi 64 def kotshiVersion = '1.0.2' 65 implementation "se.ansman.kotshi:api:$kotshiVersion" 66 kapt "se.ansman.kotshi:compiler:$kotshiVersion" 67 68 // RxJava 69 implementation "io.reactivex.rxjava2:rxjava:2.1.11" 70 implementation 'io.reactivex.rxjava2:rxandroid:2.0.2' 71 implementation 'io.reactivex.rxjava2:rxkotlin:2.2.0' 72 73 // Dagger 74 def daggerVersion = '2.15' 75 implementation "com.google.dagger:dagger:$daggerVersion" 76 implementation "com.google.dagger:dagger-android:$daggerVersion" 77 implementation "com.google.dagger:dagger-android-support:$daggerVersion" 78 kapt "com.google.dagger:dagger-compiler:$daggerVersion" 79 kapt "com.google.dagger:dagger-android-processor:$daggerVersion" 80 81 // MultiDex 82 implementation 'com.android.support:multidex:1.0.3' 83 84 // Android Architecture Components 85 implementation 'android.arch.lifecycle:runtime:1.1.1' 86 implementation 'android.arch.lifecycle:extensions:1.1.1' 87 implementation 'android.arch.lifecycle:reactivestreams:1.1.1' 88 implementation 'android.arch.persistence.room:runtime:1.0.0' 89 implementation "android.arch.persistence.room:rxjava2:1.0.0" 90 implementation "android.arch.lifecycle:common-java8:1.0.0" 91 kapt 'android.arch.persistence.room:compiler:1.0.0' 92 kapt 'com.android.databinding:compiler:3.1.0' 93 94 // OkHttp 95 implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' 96 97 // Test 98 testImplementation 'junit:junit:4.12' 99 testImplementation "com.nhaarman:mockito-kotlin:1.5.0" 100 101 testImplementation "org.robolectric:robolectric:3.5.1" 102 103 androidTestImplementation 'com.android.support.test:runner:1.0.1' 104 androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 105} 106

buildgradle

1buildscript { 2 ext.kotlin_version = '1.2.30' 3 repositories { 4 google() 5 jcenter() 6 } 7 dependencies { 8 classpath 'com.android.tools.build:gradle:3.1.0' 9 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 10 11 // NOTE: Do not place your application dependencies here; they belong 12 // in the individual module build.gradle files 13 } 14} 15 16allprojects { 17 repositories { 18 google() 19 jcenter() 20 } 21} 22 23task clean(type: Delete) { 24 delete rootProject.buildDir 25} 26

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

kakajika

2019/01/30 05:46 編集

プロジェクト直下にあるbuild.gradle(buildscriptを含むもの)の内容も載せてもらえますか?
guest

回答1

0

ベストアンサー

エラーの内容で検索してみたところWindows環境でのDataBinding関連の問題が出てきましたが、これではないでしょうか。 https://qiita.com/kkkkan/items/275ff8c0d567bbb647c2

上記記事によるとこの問題はAndroid Studio 3.1.4以降で修正されているとのことなので、最新の環境でビルドされるよう調整してみてください。

gradle

1// build.gradle内 2classpath 'com.android.tools.build:gradle:3.3.0' 3 4// gradle-wrapper.properties内 5distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

また、その際にDataBindingについてのkaptの宣言は不要になります。 参考
以下の設定は削除してください。

gradle

1kapt 'com.android.databinding:compiler:3.1.0'

投稿2019/01/30 22:55

kakajika

総合スコア3131

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yasushi_cohi

2019/02/03 15:22

XML内の日本語を@stringに変更することでビルドすることが出来ました! ありがとうございます!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問