【问题标题】:Installing/Using J2V8 in Android Studio在 Android Studio 中安装/使用 J2V8
【发布时间】:2017-04-01 14:23:42
【问题描述】:

我是 Android Studio 开发以及 gradle 和 j2v8 的新手。 我有一个示例 Hello World 应用程序,并想在其中使用 j2v8(只是出于好奇)。我的应用程序 gradle 中有以下内容

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();

我不明白我需要什么进口才能让它工作。我一定是错过了一个或多个步骤,但很难在网上找到说明。

谢谢。

【问题讨论】:

  • 我想你要问的是'import com.eclipsesource.v8.V8;' ??

标签: android android-studio j2v8


【解决方案1】:

使用编译组:'com.eclipsesource.j2v8',名称:'j2v8_android',版本:'3.0.5',添加import com.eclipsesource.v8 .V8 也不行。

改为使用 compile 'com.eclipsesource.j2v8:j2v8_android:3.0.5@aar' 工作正常。

【讨论】:

    【解决方案2】:

    我自己的解决方案:

    1. here下载3.0.5 aar文件

    2. these directions之后通过Android Studio添加为模块

    【讨论】:

      猜你喜欢
      • 2013-05-10
      • 1970-01-01
      • 2021-01-26
      • 2019-06-24
      • 1970-01-01
      • 2014-12-02
      • 2015-09-24
      • 2017-09-05
      • 1970-01-01
      相关资源
      最近更新 更多