2016-11-17 206 views
1

我是Android Studio开发人员以及gradle和j2v8的新手。 我有一个示例Hello World应用程序,并希望在其中使用j2v8(只是为了好奇)。我在我的申请gradle中有以下内容在Android Studio中安装/使用J2V8

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
    compile 'com.android.support:appcompat-v7:24.2.1' 
    testCompile 'junit:junit:4.12' 
    // https://mvnrepository.com/artifact/com.eclipsesource.j2v8/j2v8_android 
    compile group: 'com.eclipsesource.j2v8', name: 'j2v8_android', version: '3.0.5' 
} 

最后一个在那里是我尝试添加j2v8。 接下来,我尝试了取样管从this post,所以我增加了以下我的活动:

V8 v8 = V8.createV8Runtime(); 

我不明白的是我所需要的进口是工作。我必须缺少一个或多个步骤,但很难在线查找说明。

感谢。

+0

我想你在问什么是'import com.eclipsesource.v8.V8;' ?? – Ranjeet

回答

1
使用 编译组

: 'com.eclipsesource.j2v8',名称:'j2v8_android',版本:'3.0.5',添加导入com.eclipsesource.v8.V8也不起作用。

改为使用编译 'com.eclipsesource.j2v8:j2v8_android:[email protected]'工作正常。