3

I am new to Android Studio development, as well as gradle and j2v8. I have a sample Hello World app and want to use j2v8 in it (just for curiosity). I have the following in my application 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'
}

The last one in there is my attempt at adding j2v8. Next I tried a sample line from this post, so I added the following to my Activity:

V8 v8 = V8.createV8Runtime();

What I don't understand is what imports I need for that to work. I must be missing one or more steps but had a hard time finding instructions online.

Thanks.

1
  • I think what you are asking is 'import com.eclipsesource.v8.V8;' ?? Commented Apr 3, 2017 at 13:56

2 Answers 2

5

using compile group: 'com.eclipsesource.j2v8', name: 'j2v8_android', version: '3.0.5' , add import com.eclipsesource.v8.V8 also not work.

change to using compile 'com.eclipsesource.j2v8:j2v8_android:3.0.5@aar' works fine.

Sign up to request clarification or add additional context in comments.

Comments

0

My own solution:

  1. download 3.0.5 aar file from here

  2. Add as a module via Android studio following these directions

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.