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

Installing dev client on android works fine but crashes when enabling remote debugging #15436

Closed
itsramiel opened this issue Dec 4, 2021 · 21 comments

Comments

@itsramiel
Copy link

Summary

I am trying to use a custom development build to be able to debug with flipper; however, when opening the downloaded apk on my android device and enableing remote debugging the apps crashes directly

Managed or bare workflow? If you have made manual changes inside of the ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android

Package versions

"expo": "~43.0.2",
"expo-community-flipper": "^43.0.5",
"expo-dev-client": "~0.6.3",
"expo-status-bar": "~1.1.0",
"react": "17.0.1",
"react-devtools-core": "^4.21.0",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-flipper": "^0.123.0",
"react-native-web": "0.17.1"

Environment

Expo CLI 4.12.12 environment info:
System:
OS: Windows 10 10.0.18362
Binaries:
Node: 14.16.0 - C:\Program Files\nodejs\node.EXE
npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 2020.3.0.0 AI-203.7717.56.2031.7678000
npmPackages:
expo: ~43.0.2 => 43.0.3
react: 17.0.1 => 17.0.1
react-dom: 17.0.1 => 17.0.1
react-native: 0.64.3 => 0.64.3
react-native-web: 0.17.1 => 0.17.1
Expo Workflow: managed

Reproducible demo

import { StatusBar } from "expo-status-bar";
import React from "react";
import { StyleSheet, Text, View } from "react-native";
// App.tsx
import { connectToDevTools } from "react-devtools-core";
if (__DEV__) {
	connectToDevTools({
		host: "localhost",
		port: 8097,
	});
}

export default function App() {
	return (
		<View style={styles.container}>
			<Text>Open up App.tsx to start working on your app</Text>
			<StatusBar style="auto" />
		</View>
	);
}

const styles = StyleSheet.create({
	container: {
		flex: 1,
		backgroundColor: "#fff",
		alignItems: "center",
		justifyContent: "center",
	},
});

https://github.com/ramiel1999/eas-trial-error

Stacktrace (if a crash is involved)

No response

@itsramiel itsramiel added the needs validation Issue needs to be validated label Dec 4, 2021
@itsramiel
Copy link
Author

okay so I believe I am not supposed to enable remote debugging. I am seeing console logs in flipper but Hermes debugger is not working and getting this error:
Debuggin connection was closed. Reason WebSocket disconnected Reconnect when ready by reopening DevTools

@professorx00
Copy link

I am getting the same issue.

@tcdavis tcdavis added Issue accepted and removed needs validation Issue needs to be validated labels Dec 7, 2021
@expo-bot
Copy link
Collaborator

expo-bot commented Dec 7, 2021

Thank you for filing this issue!
This comment acknowledges we believe this may be a bug and there’s enough information to investigate it.
However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.

@tcdavis
Copy link
Contributor

tcdavis commented Dec 7, 2021

Thanks @ramiel1999. https://github.com/ramiel1999/eas-trial-error doesn't include expo-dev-client, but I was able to reproduce on my own.

@itsramiel
Copy link
Author

So is this an android bug only? Is it working with ios? I am asking because i was following one of expo’s blogs:
https://blog.expo.dev/developing-react-native-with-expo-and-flipper-8c426bdf995a

Is there anyway to debug a managed expo workflow with flipper on android currently?

it is just that most packages use rn-reanimated and it is really getting tough not to see my redux state and do general debugging

@tcdavis
Copy link
Contributor

tcdavis commented Dec 9, 2021

@ramiel1999 yes, this is an Android only issue.

If you are trying to use Flipper (which will be required anyway if you are attempting to reanimated v2) then you do not need to enable remote debugging and you can just follow the guide in that post. (This is a useful workaround for anyone else encountering this issue)

@lukmccall
Copy link
Contributor

@ramiel1999, you're using the managed workflow and SDK 43, so your built app will contain the react-native-reanimated. That's why your app crashes. We changed how that's working in SDK 44, where your app won't contain reanimated by default. You can read more here.

For now, I will close that. If the same problem occurs with SDK 44 and the newest expo-dev-client, please create a new issue.

@lukmccall lukmccall self-assigned this Dec 19, 2021
@itsramiel
Copy link
Author

Hello likmccall, I tried it with sdk 44 and the same issue. I believe it is a windows vs macos issue. I tried debugging with flipper on my friend's mac and it worked; however when I try it on my windows it doesnt work.
I guess this was a problem for debugging with flipper on windows, but there was a workaround by running this command:
'react-native start --host localhost'. You can check the issue on flipper here: facebook/flipper#1520.

Please try creating a development build and try to debug it on a windows machine. Do you get the same error mensioned this issue? Is there a workaround for it with expo?

@lukmccall
Copy link
Contributor

Ok, I don't have a windows machine right now. So I can't debug this on my own, but I have the following question for you.

You said that the Hermes debugger doesn't work, but I don't see a js engine specification in your app.json. By default, expo using jsc. You can change it by adding a field in your app.json config. You can read more about this here. Could you try that with Hermes enable?

@itsramiel
Copy link
Author

Yeah I am sorry I changed that later, but did not update the repo. My bad. However the error is after changing the engine. If the engine was still jsc, i would get something like: “No Hermes app was detected”, but that is not the issue because i changed the engine to hermes.
I really hope you could test it on a windows machine.

@lukmccall
Copy link
Contributor

Will try, but this may take a while ;)

@itsramiel
Copy link
Author

any news?

@lukmccall
Copy link
Contributor

I wasn't able to reproduce that behavior. Everything was working on my end. Could you try to run the expo start with the --tunnel flag?

@itsramiel
Copy link
Author

You were able to debug an eas development build with flipper on a windows machine? I will try again this weekend with sdk 44 and if it doesn not work i will paste the output of the expo start with --tunnel flag

@itsramiel
Copy link
Author

is it possible to share the github repo of the demo app you created?

@github-actions
Copy link
Contributor

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Mar 20, 2022
@lukmccall lukmccall removed the stale label Mar 21, 2022
@lukmccall
Copy link
Contributor

I believe that the crash is caused by the vendored reanimated. We will bump the reanimated version hopefully before the next release. That should fix that crash.

@Nantris
Copy link
Contributor

Nantris commented May 5, 2022

Issue persists in SDK 45 with Flipper 0.144.0. Android here too.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2022

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Oct 4, 2022
@lukmccall lukmccall removed the stale label Oct 5, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2023

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Jan 3, 2023
@github-actions
Copy link
Contributor

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

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

No branches or pull requests

6 participants