私は怒鳴るサンプルから使ってますが、私はライブラリを追加するときに私のエラーを取得しています:Android用apollo graphqlクライアントを使用していますか?
Using the apollo graphql client for Android
ベローは私build.gradle (project)
です:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url "https://jitpack.io" }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.apollographql.android:gradle-plugin:0.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ベローは私build.gradle (Module)
です:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.admin.apollotest"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
testCompile 'junit:junit:4.12'
compile 'com.apollographql.android:api:0.1.0' // the apollo runtime classes needed by auto-generated code
compile 'com.squareup.retrofit2:retrofit:2.1.0' // retrofit2
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0' // rxjava2 to use the Observables stuff
compile 'com.apollographql.android:converter-pojo:0.1.0' // converts retrofit responses to pojos (ApolloConverterFactory)
}
apply plugin: 'com.apollographql.android'
apollo {
// this tells the apollo compiler to generate actual static classes instead of just interfaces (more on that later)
generateClasses = true
}
ぼんやりしたエラーを取得する:
どうすればよいですか? 'apollo-codegen'は、内部または外部のコマンド、 操作可能なプログラムまたはバッチファイルとして認識されません。 –
@JoJoRoid: 'apollo-codegen'はNodeパッケージです。 ** 'npm install -g apollo-codegen' **コマンドを実行してください。これは 'apollo-codegen'を"グローバルに "インストールするので、あなたはApollo-Androidを使いたいAndroidプロジェクトで利用できます。ただし、グローバルインストールに '-g'スイッチを使用すると、あなたの 開発マシンでスーパーユーザ権限(例えば' sudo')が必要になることに注意してください。 – CommonsWare
このエラーを取得します。エラー: ':app:installApolloCodegen'タスクの実行に失敗しました。 >プロセス 'コマンド' D:\ AndroidStudioProject \ TestApollo \ app \ .gradle \ nodejs \ node-v6.7.0-win-x64 \ node.exe ''終了値が0以外の値-4048 –