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

pixieNoSimd required to make Android work #110

Open
ajusa opened this issue Nov 4, 2023 · 5 comments
Open

pixieNoSimd required to make Android work #110

ajusa opened this issue Nov 4, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@ajusa
Copy link

ajusa commented Nov 4, 2023

The error message I am getting is this

  jni/src/x86_64/@mmain_desktop.nim.c:254: error: undefined reference to 'atmdotdotatsdotdotatsdotnimbleatspkgsatspixieminus5dot0dot4atspixieatssimddotnim_Init000'
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)

Source code is this:

import wiish/mobileutil
import wiish/plugins/webview

var app = newWebviewApp()
app.start("https://www.wikipedia.org", title = "Wiish Webview Demo")

I'm basically just trying to get the basic webview example building and running on Android. I believe I've got Android studio set up and running correctly, but it seems like it is failing to link against the SIMD module in Pixie? Is there any additional configuration I'm expected to do?

@ajusa ajusa changed the title Can't get simple webview app to build for Android Can't get webview app to build for Android Nov 4, 2023
@iffy
Copy link
Owner

iffy commented Nov 6, 2023

I've had to add this to my config.nims file:

switch("d", "zippyNoSimd")
switch("d", "crunchyNoSimd")
switch("d", "pixieNoSimd")

Pixie is used in an unrelated part of the build process, so I consider that you need to add this a bug.

@iffy iffy added the bug Something isn't working label Nov 6, 2023
@ajusa
Copy link
Author

ajusa commented Nov 6, 2023

Ah, thanks that did solve the problem!

Unrelated question - do you know if it is possible to start up a web server locally and have wiish connect to that? I'm trying to do the following:

import wiish/mobileutil
import wiish/plugins/webview
import mummy, mummy/routers

proc indexHandler(request: Request) =
  var headers: HttpHeaders
  headers["Content-Type"] = "text/plain"
  request.respond(200, headers, "Hello, World!")

var router: Router
router.get("/", indexHandler)

let server = newServer(router)
echo "Serving on http://localhost:8080"

proc appProc() {.gcsafe.} = 
  {.cast(gcsafe).}:
    server.serve(Port(8080))

var appThread: Thread[void]

createThread(appThread, appProc)

server.waitUntilReady(5)
var app = newWebviewApp()
app.start("https://localhost:8080", title = "Wiish Webview Demo")

However, I get webpage not found error. My guess is that there is some special permission required to start up a webserver on Android? Or it isn't supported in this fashion. I haven't done much Android development so if you have any idea for what might be going wrong, I'd love to hear it :)

@iffy
Copy link
Owner

iffy commented Nov 6, 2023

I'm really not an expert on Android, but I would guess maybe the s in https is causing a problem? There may also be a permission problem.

@ajusa
Copy link
Author

ajusa commented Nov 7, 2023

That was it, I forgot to update that part of the URL when I swapped it out for Wikipedia. Amazing that this works as well as it does honestly, you've done a great job.

@iffy
Copy link
Owner

iffy commented Nov 7, 2023

I'm amazed every time I use it :) Glad it's working for you. I'm going to leave this issue open and change the title so that I fix that pixieNoSimd thing.

@iffy iffy changed the title Can't get webview app to build for Android pixieNoSimd required to make Android work Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants