ApolloGraphql FileNotFoundException: source/apollo/generatedIR/debug/src (是一个目录) [英] ApolloGraphql FileNotFoundException: source/apollo/generatedIR/debug/src (Is a directory)
问题描述
我正在尝试将 ApolloGraphql 添加到我的 android 项目中,但是当我尝试重建该项目时,我得到:
I am trying to add ApolloGraphql to my android project, but when i try to rebuild the project, i get :
org.gradle.api.UncheckedIOException: java.io.FileNotFoundException: /Users/mcebotari/Downloads/Projects/Barcloud/app/build/generated/source/apollo/generatedIR/snapshotDebug/src (Is a directory)
在 build.gradle 中,我添加了所需的依赖项:
in build.gradle i have added the needed dependencies:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.apollographql.android'
android {
compileSdkVersion 27
defaultConfig {
applicationId "barcloud.com"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
//Design
implementation 'com.github.rasoulmiri:buttonloading:v1.0.8'
//Vision Library
implementation 'com.google.android.gms:play-services-vision:15.0.2'
// RxJava
implementation "io.reactivex.rxjava2:rxjava:2.1.16"
implementation "io.reactivex:rxandroid:1.2.1"
implementation "com.jakewharton.rxbinding:rxbinding:1.0.1"
implementation "com.squareup.retrofit2:adapter-rxjava:2.3.0"
implementation 'com.jakewharton.rxbinding:rxbinding-appcompat-v7:1.0.1'
//RxPermissions
implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar'
//Retrofit
implementation "com.squareup.retrofit2:retrofit:2.4.0"
implementation "com.squareup.retrofit2:adapter-rxjava2:2.4.0"
implementation "com.squareup.retrofit2:converter-gson:2.4.0"
// rxandroid
implementation "io.reactivex.rxjava2:rxandroid:2.0.1"
// Dagger
implementation "com.google.dagger:dagger:2.12"
kapt "com.google.dagger:dagger-compiler:2.12"
//GraphQL
implementation 'com.apollographql.apollo:apollo-runtime:1.0.0-alpha'
implementation 'com.apollographql.apollo:apollo-rx2-support:1.0.0-alpha'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
还有依赖:
classpath 'com.apollographql.apollo:apollo-gradle-plugin:1.0.0-alpha'
尝试重建我得到的项目:
Trying to rebuild the project i get :
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:generateDebugApolloClasses'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
...
Caused by: org.gradle.api.UncheckedIOException: java.io.FileNotFoundException: /Users/mcebotari/Downloads/samples/Barcloud/app/build/generated/source/apollo/generatedIR/debug/src (Is a directory)
at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:57)
...
Caused by: java.io.FileNotFoundException: /Users/mcebotari/Downloads/samples/Barcloud/app/build/generated/source/apollo/generatedIR/debug/src (Is a directory)
at java.io.FileInputStream.open0(Native Method)
graphql 文件来自官方示例 - GithuntFeedQuery.graphql 及其 schema.json,粘贴在主文件夹中.
The graphql files are the ones from the official sample - GithuntFeedQuery.graphql and their schema.json, pasted in main folder.
有什么想法吗?
推荐答案
我在研究这个问题时遇到了两种解决方案:
There are two solutions which I came accross while researching this problem:
从您的项目中删除 apollo,
(通过编辑您的 gradle 文件)
清理您的项目,然后再次添加 apollo.
Remove apollo from your project,
(by editing your gradle files)
clean your project, and add apollo again.
尝试更改项目 gradle 文件中的 apollo 版本,IE.我的工作与
Try changing the apollo version in your project gradle file, ie. mine worked with
classpath 'com.apollographql.apollo:gradle-plugin:0.3.1
最初是0.3.2
.
这篇关于ApolloGraphql FileNotFoundException: source/apollo/generatedIR/debug/src (是一个目录)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!