Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Android Studio中安装/使用J2V8_Android_Android Studio_J2v8 - Fatal编程技术网

在Android Studio中安装/使用J2V8

在Android Studio中安装/使用J2V8,android,android-studio,j2v8,Android,Android Studio,J2v8,我不熟悉Android Studio开发,也不熟悉gradle和j2v8。 我有一个示例Hello World应用程序,希望在其中使用j2v8(只是出于好奇)。我的申请表中有以下内容 dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exc

我不熟悉Android Studio开发,也不熟悉gradle和j2v8。 我有一个示例Hello World应用程序,希望在其中使用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。 接下来,我尝试了来自的示例行,因此我在活动中添加了以下内容:

V8 v8 = V8.createV8Runtime();
我不明白的是,我需要什么来让它工作。我必须错过一个或多个步骤,但很难在网上找到说明

谢谢。

我自己的解决方案:

  • 从下载3.0.5 aar文件

  • 通过Android studio添加模块,如下所示

  • 使用编译组:'com.eclipsesource.j2v8',名称:'j2v8_android',版本:'3.0.5',添加导入com.eclipsesource.v8.v8也不起作用


    更改为使用编译com.eclipsesource.j2v8:j2v8_android:3.0。5@aar“工作正常。

    我想你问的是‘import com.eclipsesource.v8.v8;’?”??