Repository: tauri
Issue: [bug]  Generated Kotlin Code Returns Nullable Strings in WryActivity.kt (Tauri 2.0)
Labels: type: bug,status: needs triage,platform: Android

### Describe the bug

Hi Tauri Team,
While using Tauri 2.0 for Android development, the generated WryActivity.kt file produces a compile-time error:
--------------------------------------------------------------------
Return type mismatch: expected 'kotlin.String', actual 'kotlin.String?'
--------------------------------------------------------------------
Specifically, the getAppUrl() and getAppAssetPath() methods return 'kotlin.String?' instead of 'kotlin.String', causing the Android build to fail. Previously, in Tauri 1 we could set "nullableReturnTypes": false in tauri.conf.json to fix this, but Tauri 2.0 no longer supports that configuration.

### Reproduction

Create a Tauri 2.0 project with Android support
Run tauri android init and tauri android dev
Observe the Kotlin compile error in WryActivity.kt


### Expected behavior

 The generated methods should match their expected return types (non-null String) or provide a config to control nullability.

### Full `tauri info` output

```text
> odin@1.3.4 tauri C:\Users\19542\Documents\GitHub\Kiosk-Tizen-V2\odin
> tauri "info"

WARNING: no lock files found, defaulting to npm

[✔] Environment
    - OS: Windows 10.0.26100 x86_64 (X64)
    ✔ WebView2: 131.0.2903.112
    ✔ MSVC: Visual Studio Build Tools 2019
    ✔ rustc: 1.84.0 (9fc6b4312 2025-01-07)
    ✔ cargo: 1.84.0 (66221abde 2024-11-19)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.11.0
    - pnpm: 8.15.9
    - npm: 10.4.0

[-] Packages
    - tauri 🦀: 2.2.2
    - tauri-build 🦀: 2.0.5
    - wry 🦀: 0.48.1
    - tao 🦀: 0.31.1
    - @tauri-apps/api : 2.0.1 (outdated, latest: 2.2.0)
    - @tauri-apps/cli : 2.0.0-rc.18 (outdated, latest: 2.2.4)

[-] Plugins
    - tauri-plugin-shell 🦀: 2.2.0
    - @tauri-apps/plugin-shell : 2.2.0
    - tauri-plugin-localhost 🦀: 2.2.0
    - @tauri-apps/plugin-localhost : not installed!
    - tauri-plugin-fs 🦀: 2.2.0
    - @tauri-apps/plugin-fs : 2.2.0
    - tauri-plugin-http 🦀: 2.2.0
    - @tauri-apps/plugin-http : 2.2.0

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:3000/
    - framework: Svelte
    - bundler: Vite
```


### Stack trace

```text
PS C:\Users\19542\Documents\GitHub\Kiosk-Tizen-V2\odin\src-tauri> pnpm tauri android dev

> odin@1.3.4 tauri C:\Users\19542\Documents\GitHub\Kiosk-Tizen-V2\odin
> tauri "android" "dev"

    Info Detected connected device: Pixel_9_API_35 (sdk_gphone64_x86_64) with target "x86_64-linux-android"
    Running BeforeDevCommand (`pnpm -w dev`)

> kiosk-v2@0.6.0 dev C:\Users\19542\Documents\GitHub\Kiosk-Tizen-V2
> pnpm -C tizen-spa dev --config vite-web.config.js --mode mineremote --host


> tizen-spa@14.3.0 dev C:\Users\19542\Documents\GitHub\Kiosk-Tizen-V2\tizen-spa
> vite "--config" "vite-web.config.js" "--mode" "mineremote" "--host"

  VITE v4.4.9  ready in 1558 ms

  ➜  Local:   http://localhost:3000/
  ➜  Network: http://10.0.0.150:3000/

warning: `odin` (lib) generated 23 warnings (run `cargo fix --lib -p odin` to apply 15 suggestions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.53s
    Info symlinking lib "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\target\\x86_64-linux-android\\debug\\libnext_gen_android_lib.so" in jniLibs dir "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\gen/android\\app/src/main/jniLibs/x86_64"
    Info "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\target\\x86_64-linux-android\\debug\\libnext_gen_android_lib.so" requires shared lib "libandroid.so"
    Info "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\target\\x86_64-linux-android\\debug\\libnext_gen_android_lib.so" requires shared lib "libdl.so"
    Info "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\target\\x86_64-linux-android\\debug\\libnext_gen_android_lib.so" requires shared lib "liblog.so"
    Info "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\target\\x86_64-linux-android\\debug\\libnext_gen_android_lib.so" requires shared lib "libm.so"
    Info "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\target\\x86_64-linux-android\\debug\\libnext_gen_android_lib.so" requires shared lib "libc.so"
    Info symlink at "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\gen/android\\app/src/main/jniLibs/arm64-v8a\\libnext_gen_android_lib.so" points to "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\target\\aarch64-linux-android\\debug\\libnext_gen_android_lib.so"
    Info symlink at "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\gen/android\\app/src/main/jniLibs/x86_64\\libnext_gen_android_lib.so" points to "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\target\\x86_64-linux-android\\debug\\libnext_gen_android_lib.so"

> odin@1.3.4 tauri C:\Users\19542\Documents\GitHub\Kiosk-Tizen-V2\odin
> tauri "android" "android-studio-script" "--target" "x86_64"

e: file:///C:/Users/19542/Documents/GitHub/Kiosk-Tizen-V2/odin/src-tauri/gen/android/app/src/main/java/com/grubbrr/kiosk/generated/WryActivity.kt:43:24 Return type mismatch: expected 'kotlin.String', actual 'kotlin.String?'.
e: file:///C:/Users/19542/Documents/GitHub/Kiosk-Tizen-V2/odin/src-tauri/gen/android/app/src/main/java/com/grubbrr/kiosk/generated/WryActivity.kt:51:24 Return type mismatch: expected 'kotlin.String', actual 'kotlin.String?'.
<==========---> 80% EXECUTING [1s]
> IDLE                                                        Info Forwarding port 3000 with adb
    Info tcp:3000 already forwarded to Pixel_9_API_35

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileX86_64DebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 9s
 ELIFECYCLE  Command failed with exit code 4294967295.
 ELIFECYCLE  Command failed with exit code 4294967295.
Failed to assemble APK: command ["C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\gen/android\\gradlew.bat", "--project-dir", "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\gen/android"] exited with code 1: command ["C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\gen/android\\gradlew.bat", "--project-dir", "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\gen/android"] exited with code 1
    Error Failed to assemble APK: command ["C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\gen/android\\gradlew.bat", "--project-dir", "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\gen/android"] exited with code 1: command ["C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\gen/android\\gradlew.bat", "--project-dir", "C:\\Users\\19542\\Documents\\GitHub\\Kiosk-Tizen-V2\\odin\\src-tauri\\gen/android"] exited with code 1     
 ELIFECYCLE  Command failed with exit code 1.
```


### Additional context

_No response_