Trying To Run Spark In Android: Methodhandle.invoke And Methodhandle.invokeexact Are Only Supported Starting With Android O
I need to generate a webhook url in android. Initially I tried Spring Framework, but it seems quite difficult to implement and I'm just looking to expose a single webhook url so I
Solution 1:
I've been able to run a Spark server on Android. Here is my build.gradle.
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.mycom.appname"
minSdkVersion 27
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.sparkjava:spark-core:2.9.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
We are both using Spark 2.9.2. I'm not too familiar with gradle but I notice that the way we indicate the dependency on it is different (compile "com.sparkjava:spark-core:2.9.2" vs. implementation 'com.sparkjava:spark-core:2.9.2').
Post a Comment for "Trying To Run Spark In Android: Methodhandle.invoke And Methodhandle.invokeexact Are Only Supported Starting With Android O"