Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable "android-app-dependencies-platform" not found in strict mode #184

Closed
konceptosociala opened this issue Aug 9, 2023 · 4 comments · Fixed by #185
Closed

Variable "android-app-dependencies-platform" not found in strict mode #184

konceptosociala opened this issue Aug 9, 2023 · 4 comments · Fixed by #185

Comments

@konceptosociala
Copy link

Describe the bug
When I run cargo mobile init I get following error:

error: Android template processing failed
    Failed to render template at "/home/ks/.cargo/.tauri-mobile/templates/platforms/android-studio/app/build.gradle.kts.hbs": Failed to render template: Error rendering
    "Unnamed template" line 53, col 5: Variable "android-app-dependencies-platform" not found in strict mode.

And then using cargo android run and cargo android open I see following errors respectively:

error: Failed to assemble APK
    No such file or directory (os error 2)
    
    ...
    
    error: Failed to open project in Android Studio
    Launch failed: No such file or directory (os error 2)

Steps To Reproduce

  1. Install Android Studio Giraffe in /opt/android-studio
  2. Follow this tutorial for Linux (Ubuntu): https://github.com/tauri-apps/wry/blob/dev/MOBILE.md

Expected behavior
Application is initialized correctly

Screenshots
image

Platform and Versions (please complete the following information):
Host OS: Ubuntu 22.04
Target OS: Android 10.0
Rustc: 1.70.0
cargo mobile doctor:
(if you build with specific commit, please list it as well)

@mikebelanger
Copy link

Getting the same error after following instructions here: https://github.com/tauri-apps/wry/blob/dev/MOBILE.md

Host OS: EndeavorOS (basically Arch), kernel version: 6.4.9-arch1-1. On an AMD system.
Target OS: Android 10
Rustc: 1.70.0 (90c541806 2023-05-31)

@jbrummack
Copy link

This or something similar also happens when building for iOS.
error: Xcode template processing failed

  Failed to render template at
   "/Users/jb/.cargo/.tauri-mobile/templates/platforms/xcode/projec
   t.yml.hbs": Failed to render template: Error rendering "Unnamed template"
   line 39, col 7: Variable "ios-additional-targets" not found in strict mode.

OS: macOS 13.4 arm64
Rust: rustc 1.71.0

@samdace
Copy link

samdace commented Aug 14, 2023

is this broken now ?

@konceptosociala
Copy link
Author

is this broken now ?

Everything works!
Except there is a bug with indents in build.gradle.kts, line 23:

packaging {                
                                                                jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so")
                                                                                                                            jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so")
                                                            jniLibs.keepDebugSymbols.add("*/x86/*.so")
                                                                                                                                jniLibs.keepDebugSymbols.add("*/x86_64/*.so")
            }

Instead of

packaging {                
    jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so")
    jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so")
    jniLibs.keepDebugSymbols.add("*/x86/*.so")
    jniLibs.keepDebugSymbols.add("*/x86_64/*.so")
}

It is easy to fix manually, but it just refuses to compile. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants