


After several hours, I eventually worked out that if I changed my adle file so that the compileSdkVersion, buildToolsVersion, and targetSdkVersion were all 29 instead of 30, then the APK installed fine. However, when I built a signed APK file (using my normal key store file) and copied it to my phone, I could not install it on the phone using the Google Files app, like I usually can. In this case, there is no separate step to install WasmEdge share libraries onto the Android device.I built a new Java Android app on a new PC using a fresh install of Android Studio 4.1.2, and was able to run it on my phone from the debugger fine. The CMakeLists.txt file builds the WasmEdge source into Android shared library files and embeds them into the final APK application. Build dependenciesĪndroid Studio and Gradle use CMake to build the C shared library. It is compiled into WebAssembly using the WABT tool. The factorial.wat is a handwritten WebAssembly script to compute factorial numbers. Params.size(), ret_val.data(), ret_val.size()) Įnv->ReleaseByteArrayElements(image_bytes, buffer, 0) Vm_ctx, (uint8_t *)buffer, buffer_size, func_name, params.data(), class MainActivity : AppCompatActivity() Ĭonst WasmEdge_Result &res = WasmEdge_VMRunWasmFromBuffer(

It is written in Kotlin using the Android SDK. The Android UI application is located here. The Android UI app is written in Kotlin, and it uses JNI (Java Native Interface) to load a C shared library, which in turn embeds WasmEdge. Open this folder with Android Studio 2020.3.1 or later.įor Release APK, click Menu -> Build -> Generate Signed Bundle/APK, select APK, setup keystore configuration and wait for build finished. The apksigner utility is at $ANDROID_HOME/build-tools/$VERSION/apksigner.

Call WasmEdge functions from an Android APK app
