无法为参数找到方法jackOptions()

时间:2018-04-20 12:07:57

标签: android android-studio android-gradle

大家好我正面对

  

无法在DefaultConfig_Decorated上找到参数[build_ccqj3loj50621uihss8xz3wml $ _run_closure1 $ _closure3 $ _closure6 @ 24055137]的方法jackOptions(){name = main,dimension = null,minSdkVersion = DefaultApiVersion {mApiLevel = 16,mCodename ='null'},targetSdkVersion = DefaultApiVersion {mApiLevel = 25,mCodename ='null'},renderscriptTargetApi = null,renderscriptSupportModeEnabled = null,renderscriptSupportModeBlasEnabled = null,renderscriptNdkModeEnabled = null,versionCode = 1,versionName = 1.0,applicationId = com.vpaliy.flip_concept,testApplicationId = null, testInstrumentationRunner = android.support.test.runner.AndroidJUnitRunner,testInstrumentationRunnerArguments = {},testHandleProfiling = null,testFunctionalTest = null,signingConfig = null,resConfig = null,mBuildConfigFields = {},mResValues = {},mProguardFiles = [],mConsumerProguardFiles = [],mManifestPlaceholders = {},mWearAppUnbundled = null},类型为com.android.build.gradle.internal.dsl.DefaultConfig。

当我尝试从Github克隆this repo时出现问题。我已经尝试了官方文档disable jack,并检查了SO link1link2但是当我尝试删除

时它们没有多大帮助
jackOptions {
    enabled true
}
根据官方文档从gradle开始,但仍然存在错误,并且还尝试使缓存无效并重新启动,但也没有。非常感谢任何帮助

模块级gradle文件:

apply plugin: 'com.android.application'

android {

    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "com.vpaliy.loginconcept"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        jackOptions {
            enabled true
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}


dependencies {
    compile 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
    compile 'com.andkulikov:transitionseverywhere:1.7.4'
    compile 'com.android.support:design:25.3.1'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.1.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.github.Q42:AndroidScrollingImageView:1.2'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
}

项目级gradle文件:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

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

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

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

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

1 个答案:

答案 0 :(得分:9)

  

展望未来,Android构建系统将本机支持Java 8语言功能。

我发现我犯了一个愚蠢的错误,就是不删除下面的代码

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

df = pd.DataFrame(columns=['Name', 'Cat_1', 'Cat_2'])

df['Name'] = ['foo', 'bar', 'bla', 'blu', 'boo', 'faa']
df['Cat_1'] = ['P', 'R, M', 'E', 'F', 'G', 'P, E']
df['Cat_2'] = ['Apples, Pears, Cats', 'Apples', 'Pears', 'Cats, Pears', 'Apples, Pears', 'Apples, Cats']

# arrange data simply prepopulate with zero
df_pl = pd.DataFrame(columns=df["Cat_1"].str.split(", ", expand=True).stack().unique().tolist(),
                     index=df["Cat_2"].str.split(", ", expand=True).stack().unique().tolist(),
                     data=0)

# get chunk size for each combination
for x in df_pl.columns:
    ind = df.Cat_1.str.contains(x)
    for name in df_pl.index:
        df_pl.set_value(name, x, df.loc[ind, 'Cat_2'].str.contains(name).sum())

N = len(df_pl.columns)
ind = np.arange(N)    # the x locations for the groups
width = 0.35       # the width of the bars: can also be len(x) sequence

plotted = []
p = {}
for name in df_pl.index:
    bottoms = df_pl.index.isin(plotted).sum()
    p[name] = plt.bar(ind, df_pl.loc[name].values.tolist(), bottom=bottoms)
    plotted.append(name)

plt.ylabel('y_label')
plt.title('some plot')
plt.xticks(ind, df_pl.columns.tolist())
plt.legend(p.values(), p.keys())

plt.show()

来自flip-concept's jackOptions { enabled true } 文件,因为我无法构建和运行该项目。删除后,我可以运行项目