2016-11-17 66 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]'工作正常。