-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Bug]: Android Live Reload broken in Capacitor 5.7.2 #7323
Comments
Here's a finding and a fix, through adding Debugging here, where Lines 1080 to 1085 in e45d60d
The generated xml is missing the cleartext attribute: <?xml version='1.0' encoding='utf-8'?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:amazon="http://schemas.amazon.com/apk/res/android">
<application >
</application>
</manifest> Manually patching Unfortunately, there's no way for us to reliably patch this at build time, because we can't control when capacitor writes this file + copies it to the phone. |
Update: iOS works fine, I was running into another bug #7324 that was preventing app startup on iOS. I have unticked 'affects iOS' in the issue description |
This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
+1 I noticed the same behaviour as the one @alextreppass described in his repro I don't understand why |
I am also encountering this issue and was able to reproduce with the repo shared by @alextreppass |
Facing the same issue. In my case: android\app\src\main\assets\capacitor.config.json is being replaced with a dynamic one when I run the live-server. Example: On my root capacitor.config.json, I have this in the server section: "server": {
"url": "http://192.168.1.4:3000",
"clearText": true
} I also ran "npx cap sync" Then the file at: android\app\src\main\assets\capacitor.config.json also contains the same thing. But when I run The file at: android\app\src\main\assets\capacitor.config.json changes to the following: "server": {
"url": "http://172.25.144.1:3000"
} And when I exit the run command. The file reverts back to the original contents. So my specified values in the root capacitor.config.json is not being used for the server. |
still and issue 👍🏻 live-reload using custom server field in config. |
Hi team. A reproduction was attached above a few weeks ago — I don't think the 'needs reproduction' label is still appropriate. Please let me know if you need any more information |
I can see the Noting the protocol is also hardcoded and prevents SSL. |
This Gist preserves server options declared in |
This issue has been labeled as |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Capacitor Version
[warn] The bundledWebRuntime configuration option has been deprecated. Please,
use a bundler to bundle Capacitor and its plugins.
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 5.7.2
@capacitor/core: 5.7.2
@capacitor/android: 5.7.2
@capacitor/ios: 5.7.2
Installed Dependencies:
@capacitor/cli: 5.7.2
@capacitor/core: 5.7.2
@capacitor/android: 5.7.2
@capacitor/ios: 5.7.2
Other API Details
Platforms Affected
Current Behavior
Our
capacitor.config.ts
when running in live reload mode (-l external
), has the following config:LIVE_RELOAD_SERVER_URL
is set ashttp://10.0.2.2:3000
for Android (as Android Studio treats the host machine's ip as 10.0.2.2), andhttp://0.0.0.0:3000
for iOS.We are using this setup to proxy a local dev server running on port 3000 for fast iteration without having to run
npx cap run
+ rebuild each time.Issues
In 5.7.2 with Android, when going to the url capacitor's
live-reload.ts
generates (e.g. http://192.168.1.241:3000) the webpage does not load. There is anERR_CLEARTEXT_NOT_PERMITTED
error:It doesn't look like there have been updates to https://github.com/ionic-team/capacitor/blob/main/cli/src/util/livereload.ts since @IT-MikeS introduced it, so something else must be going on here.
Expected Behaviour
This worked great on 5.4.2:
The webview would load correctly.
Project Reproduction
https://github.com/alextreppass/capacitor-live-reload-bug
The text was updated successfully, but these errors were encountered: