无法添加API

时间:2017-11-13 14:34:44

标签: android

我遵循了这些指示 https://github.com/igdb/api-android-java/blob/master/README.md 并得到此错误

  

错误:任务':app:preDebugAndroidTestBuild'执行失败。   与依赖冲突&com; android.support.test:runner'在项目':app'。 app(0.5)和test app(1.0.1)的已解决版本不同。有关详细信息,请参阅https://d.android.com/r/tools/test-apk-dependency-conflicts.html

build.gradle项目

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle app

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.ofirv.gamesugest"
        minSdkVersion 21
        targetSdkVersion 26
        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 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.github.igdb:api-android-java:master-SNAPSHOT'
}

谢谢

1 个答案:

答案 0 :(得分:2)

用以下代码替换此行import tkinter as tk def update_scrollregion(event): photoCanvas.configure(scrollregion=photoCanvas.bbox("all")) root = tk.Tk() photoFrame = tk.Frame(root, width=250, height=190, bg="#EBEBEB") photoFrame.grid() photoFrame.rowconfigure(0, weight=1) photoFrame.columnconfigure(0, weight=1) photoCanvas = tk.Canvas(photoFrame, bg="#EBEBEB") photoCanvas.grid(row=0, column=0, sticky="nsew") canvasFrame = tk.Frame(photoCanvas, bg="#EBEBEB") photoCanvas.create_window(0, 0, window=canvasFrame, anchor='nw') for i in range(10): element = tk.Button(canvasFrame, text='Button %i' % i, borderwidth=0, bg="#EBEBEB") element.grid(padx=5, pady=5, sticky="nsew") photoScroll = tk.Scrollbar(photoFrame, orient=tk.VERTICAL) photoScroll.config(command=photoCanvas.yview) photoCanvas.config(yscrollcommand=photoScroll.set) photoScroll.grid(row=0, column=1, sticky="ns") canvasFrame.bind("<Configure>", update_scrollregion) root.mainloop() :(它应该可以。我已经为您测试过了)

compile 'com.github.igdb:api-android-java:master-SNAPSHOT'