From 1a681c7c7566d1f70fb005ba139a5d9ce7148950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= <49951010+lolocomotive@users.noreply.github.com> Date: Sun, 1 Jan 2023 14:16:12 +0100 Subject: [PATCH] Fix android simulator (#277) * Fix android CI * Set NDK path * Reduced log spam * Fixed NDK path * Fixed NDK path * Android NDK v21e * Use debug signin config if SIGNING_STORE_FILE is not defined This allows the apk to be installed * Fix OmegaActivity class name * Fix formatting Co-authored-by: Yaya-Cout Co-authored-by: Yaya-Cout --- .github/workflows/ci-workflow.yml | 4 +++- ion/src/simulator/android/build.gradle | 2 ++ ion/src/simulator/android/src/cpp/platform_language.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 63b3308f5..2bfbd0f12 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -48,7 +48,9 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'recursive' - - run: make -j2 PLATFORM=simulator TARGET=android + - run: wget -nv https://dl.google.com/android/repository/android-ndk-r21e-linux-x86_64.zip + - run: unzip -q android-ndk-r21e-linux-x86_64.zip + - run: make -j2 PLATFORM=simulator TARGET=android NDK_PATH=./android-ndk-r21e - id: 'auth' if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }} uses: 'google-github-actions/auth@v0' diff --git a/ion/src/simulator/android/build.gradle b/ion/src/simulator/android/build.gradle index bb48650fd..c2e36530e 100644 --- a/ion/src/simulator/android/build.gradle +++ b/ion/src/simulator/android/build.gradle @@ -55,6 +55,8 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt') if (projectVariable('SIGNING_STORE_FILE')) { signingConfig signingConfigs.environment + } else { + signingConfig signingConfigs.debug } } } diff --git a/ion/src/simulator/android/src/cpp/platform_language.cpp b/ion/src/simulator/android/src/cpp/platform_language.cpp index b41b1ae46..7aa29c2ee 100644 --- a/ion/src/simulator/android/src/cpp/platform_language.cpp +++ b/ion/src/simulator/android/src/cpp/platform_language.cpp @@ -12,7 +12,7 @@ const char * languageCode() { JNIEnv * env = static_cast(SDL_AndroidGetJNIEnv()); jobject activity = static_cast(SDL_AndroidGetActivity()); - jclass j_class = env->FindClass("io/github/omega/OmegaActivity"); + jclass j_class = env->FindClass("io/github/omega/simulator/OmegaActivity"); jmethodID j_methodId = env->GetMethodID( j_class, "retrieveLanguage",