首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何启用Jack Compiler支持?

如何启用Jack Compiler支持?
EN

Stack Overflow用户
提问于 2016-10-11 21:18:48
回答 1查看 472关注 0票数 2

我一直在为Jack编译器而烦恼。我使用Intellij IDEA来开发Androidd应用程序。

我已经阅读了这些文档:

documentation for jack compiler

how to use java 8 features

下面是我的build.gradle配置:

代码语言:javascript
运行
复制
android {
...
defaultConfig {
    ...
    jackOptions {
        enabled true
    }
    ...
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
...
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile ('io.socket:socket.io-client:0.8.1') {
    // excluding org.json which is provided by Android
    exclude group: 'org.json', module: 'json'
}
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'

compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'io.reactivex:rxjava:1.2.0'
compile 'io.reactivex:rxandroid:1.2.1'
}

但是我还是得到了这个错误:

代码语言:javascript
运行
复制
Error:Gradle: Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

Gradle构建错误:

代码语言:javascript
运行
复制
Error:(12, 0) Gradle DSL method not found: 'jackOptions()'
Possible causes:<ul><li>The project 'App' may be using a version of Gradle that does not contain the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>

不知道该怎么解决这个问题。

EN

回答 1

Stack Overflow用户

发布于 2016-11-01 10:30:02

代码语言:javascript
运行
复制
    defaultConfig {

         ...

       jackOptions {
           enabled true
       }

       // inside defaultConfig
       compileOptions { 
           sourceCompatibility JavaVersion.VERSION_1_8
           targetCompatibility JavaVersion.VERSION_1_8
       }
    }
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39978201

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档