gpt4 book ai didi

android - ApolloGraphql 文件未找到异常 : source/apollo/generatedIR/debug/src (Is a directory)

转载 作者:行者123 更新时间:2023-11-29 02:27:10 25 4
gpt4 key购买 nike

我正在尝试将 ApolloGraphql 添加到我的 android 项目中,但是当我尝试重建项目时,我得到:

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 中,我添加了所需的依赖项:

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'

尝试重建我得到的项目:

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,粘贴在主文件夹中。

有什么想法吗?

最佳答案

在研究这个问题时,我遇到了两种解决方案:

  1. 从您的项目中删除 apollo,(通过编辑您的 gradle 文件) 清理您的项目,然后再次添加 apollo。

  2. 尝试更改项目 gradle 文件中的 apollo 版本,IE。我和

  3. 一起工作

classpath 'com.apollographql.apollo:gradle-plugin:0.3.1

最初是 0.3.2

关于android - ApolloGraphql 文件未找到异常 : source/apollo/generatedIR/debug/src (Is a directory),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51540510/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com