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

Update android project setup with new all-android recipe #1000

Merged
merged 2 commits into from
Jul 27, 2023

Conversation

Restioson
Copy link
Contributor

Very basic android dev setup in case things need to be tested in a mobile environment.

For me, usually desktop is sufficient, but since I am on Linux/Windows and have no access to an iOS device or Mac with XCode, Android is the easiest option for mobile debugging.

@Restioson Restioson self-assigned this Jul 25, 2023
@Restioson
Copy link
Contributor Author

PR/issue #1000! 🎉

Copy link
Contributor

@da-kami da-kami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared to the iPhone Simulator the Emulator is... buggy... Somehow the UI keeps reporting that it is unresponsive 😅

I tried to test this on my machine, but was unable to go past the initial Email signup screen. I think somehow the rust backend is not built/started correctly.

I keep running into this error when I try to submit the email in the app:

══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
The following ArgumentError was thrown while handling a gesture:
Invalid argument(s): Failed to load dynamic library 'libnative.so': dlopen failed: library "libnative.so" not found

When the exception was thrown, this was the stack:
#0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43)
#1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
#2      api (package:get_10101/ffi.dart:22:22)
#3      api (package:get_10101/ffi.dart)
#4      _WelcomeScreenState.build.<anonymous closure> (package:get_10101/features/welcome/welcome_screen.dart:78:23)

Is there yet another target missing for running this in the emulator on Mac? Any ideas @Restioson

@@ -241,6 +241,9 @@ all: services gen native run
# Run everything at once, tailored for iOS development (rebuilds iOS)
all-ios: services gen ios run

# Run everything at once, tailored for Android development (rebuilds Android)
all-android: services gen android run-local-android
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only used run-local-android for deploying to my phone - but I think it should make no difference if it's an actual device (in the same network) or the simulator running on the same machine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm it does work for simulator!

README.md Show resolved Hide resolved
@Restioson
Copy link
Contributor Author

Restioson commented Jul 26, 2023

Is there yet another target missing for running this in the emulator on Mac? Any ideas @Restioson

This branch is missing a change on main which builds libnative.so for x86, so with that integrated it should work! I'll rebase this on main just for ease of testing, but I'm confident it will work.

@Restioson
Copy link
Contributor Author

Restioson commented Jul 26, 2023

I've updated this from main now

@da-kami
Copy link
Contributor

da-kami commented Jul 26, 2023

Retesting!

@da-kami
Copy link
Contributor

da-kami commented Jul 27, 2023

Retesting!

I ran into a separate error:

══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
The following ArgumentError was thrown while handling a gesture:
Invalid argument(s): Failed to load dynamic library 'libnative.so': dlopen failed: cannot locate
symbol "__extenddftf2" referenced by
"/data/app/~~R9JQuf4SHIHcuppjYxBypA==/finance.get10101.app.local-X7s4VBga0zoY5UDPecX7kw==/lib/x86_64/libnative.so"...

When the exception was thrown, this was the stack:
#0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43)
#1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
#2      api (package:get_10101/ffi.dart:22:22)
#3      api (package:get_10101/ffi.dart)
#4      _WelcomeScreenState.build.<anonymous closure> (package:get_10101/features/welcome/welcome_screen.dart:78:23)

I think this must be related to my setup somehow, but don't have the time to dig into this.

I approved the PR, because I don't think this problem is related to the changes :)

@Restioson
Copy link
Contributor Author

Restioson commented Jul 27, 2023

My suspicion is an NDK installation / version issue (from skimming termux/termux-packages#8029 and mozilla/rust-android-gradle#105). For reference, I seem to have NDK 25.1.8937393 installed.

@bonomat
Copy link
Contributor

bonomat commented Jul 27, 2023

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 27, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@github-merge-queue github-merge-queue bot merged commit 37caeb5 into main Jul 27, 2023
7 checks passed
@Restioson Restioson deleted the android-dev-setup branch July 27, 2023 14:05
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 this pull request may close these issues.

3 participants