様々なエラーが出て、ビルド(▷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
回答1件
あなたの回答
tips
プレビュー