Closed frederiko-famobi closed 1 year ago
Well, you remember, Expo isn't officially supported (#8, #19). I bet, with the regular Android build example app works fine with last release (I just double-checked it):
Anyway, what you shared so far sounds like the server per se works fine. Are you actually running the example app as is? Because, my first guess would be that you accessing http://localhost:34797
without having any index file in the folder served by the server (which is configured to be one of these, and in the example app it would be index.html
), so it probably attempts to list all content of the served folder, it is denied by OS, and thus it responds with 403 error. Though, it presumably able to see the directory to be served exists, as otherwise it would respond with 404 or 500 error.
Hello @birdofpreyru, after your reply and analysing the example code, I noticed that in the Expo generated android files, it was missing the following config in android/app/build.gradle
:
android {
...
sourceSets {
main {
assets.srcDirs = ['../../assets']
}
}
After adding this, it worked fine. :) Now I see the same as you sent in your screenshot. Thank you!!
Hello, after following the example project, I managed to make the server work.
But now I am getting an error
403 Forbidden
on the webview for Android.My project logs (following the example project) are the following:
I checked the
origin
state and the uri ishttp://localhost:34797
.I tried to add to the webview:
I also changed the assets files/folder to
chmod 777
.But no success.
I am currently using Expo and had to install the library
react-native-fs
so the project would work. Usually we useexpo-file-system
, not sure if this is related or not.If I set the property in the server to
nonLocal: true
and try to open in the browser and the same error 403 appears.How can I solve this problem?