google / android-emulator-container-scripts

1.86k stars 260 forks source link

blank page after logged in (React issues) #143

Open zhouziyang opened 4 years ago

zhouziyang commented 4 years ago

environment:

Problems: I can run create_web_container.sh successfully and all containers started. I can get adb shell in emulator (android works fine). But blank page show after successfully logged in. I check Console in chrome Dev-Tools, and there are several js errors:

react-dom.production.min.js:209 TypeError: t.serializeBinary is not a function
    at ve.MethodDescriptor.a (index.js:6216)
    at A.Se.S (index.js:4247)
    at A.serverStreaming (index.js:9585)
    at v.i.android.emulation.control.EmulatorControllerClient.streamLogcat (index.js:6242)
    at F.start (index.js:10431)
    at T.componentDidMount (logcat_view.js:45)
    at il (react-dom.production.min.js:212)
    at pu (react-dom.production.min.js:255)
    at t.unstable_runWithPriority (scheduler.production.min.js:19)
    at Vo (react-dom.production.min.js:122)
el @ 2.77621d05.chunk.js:2
n.callback @ 2.77621d05.chunk.js:2
fi @ 2.77621d05.chunk.js:2
il @ 2.77621d05.chunk.js:2
pu @ 2.77621d05.chunk.js:2
t.unstable_runWithPriority @ 2.77621d05.chunk.js:2
Vo @ 2.77621d05.chunk.js:2
fu @ 2.77621d05.chunk.js:2
Zl @ 2.77621d05.chunk.js:2
(anonymous) @ 2.77621d05.chunk.js:2
t.unstable_runWithPriority @ 2.77621d05.chunk.js:2
Vo @ 2.77621d05.chunk.js:2
Ko @ 2.77621d05.chunk.js:2
qo @ 2.77621d05.chunk.js:2
Ql @ 2.77621d05.chunk.js:2
enqueueSetState @ 2.77621d05.chunk.js:2
x.setState @ 2.77621d05.chunk.js:2
(anonymous) @ main.4d5aa36d.chunk.js:2
l.emit @ 2.77621d05.chunk.js:2
(anonymous) @ main.4d5aa36d.chunk.js:2
Promise.then (async)
login @ main.4d5aa36d.chunk.js:2
G.doLogin @ main.4d5aa36d.chunk.js:2
l @ 2.77621d05.chunk.js:2
p @ 2.77621d05.chunk.js:2
(anonymous) @ 2.77621d05.chunk.js:2
b @ 2.77621d05.chunk.js:2
at @ 2.77621d05.chunk.js:2
ot @ 2.77621d05.chunk.js:2
lt @ 2.77621d05.chunk.js:2
pt @ 2.77621d05.chunk.js:2
I @ 2.77621d05.chunk.js:2
B @ 2.77621d05.chunk.js:2
Jt @ 2.77621d05.chunk.js:2
Yt @ 2.77621d05.chunk.js:2
t.unstable_runWithPriority @ 2.77621d05.chunk.js:2
Vo @ 2.77621d05.chunk.js:2
z @ 2.77621d05.chunk.js:2
Gt @ 2.77621d05.chunk.js:2
index.js:4243 Uncaught TypeError: e.h is not a function
    at qt.<anonymous> (index.js:4243)
    at Mt (index.js:4228)
    at wt (index.js:4227)
    at ae (index.js:4236)
    at qt.R (index.js:4235)
    at qt.L (index.js:4235)
(anonymous) @ main.4d5aa36d.chunk.js:2
Mt @ main.4d5aa36d.chunk.js:2
wt @ main.4d5aa36d.chunk.js:2
ae @ main.4d5aa36d.chunk.js:2
qt.R @ main.4d5aa36d.chunk.js:2
qt.L @ main.4d5aa36d.chunk.js:2
XMLHttpRequest.send (async)
re @ main.4d5aa36d.chunk.js:2
Se.N @ main.4d5aa36d.chunk.js:2
(anonymous) @ main.4d5aa36d.chunk.js:2
i.android.emulation.control.RtcClient.requestRtcStream @ main.4d5aa36d.chunk.js:2
(anonymous) @ main.4d5aa36d.chunk.js:2
componentDidMount @ main.4d5aa36d.chunk.js:2
il @ 2.77621d05.chunk.js:2
pu @ 2.77621d05.chunk.js:2
t.unstable_runWithPriority @ 2.77621d05.chunk.js:2
Vo @ 2.77621d05.chunk.js:2
fu @ 2.77621d05.chunk.js:2
Zl @ 2.77621d05.chunk.js:2
(anonymous) @ 2.77621d05.chunk.js:2
t.unstable_runWithPriority @ 2.77621d05.chunk.js:2
Vo @ 2.77621d05.chunk.js:2
Ko @ 2.77621d05.chunk.js:2
qo @ 2.77621d05.chunk.js:2
Ql @ 2.77621d05.chunk.js:2
enqueueSetState @ 2.77621d05.chunk.js:2
x.setState @ 2.77621d05.chunk.js:2
(anonymous) @ main.4d5aa36d.chunk.js:2
l.emit @ 2.77621d05.chunk.js:2
(anonymous) @ main.4d5aa36d.chunk.js:2
Promise.then (async)
login @ main.4d5aa36d.chunk.js:2
G.doLogin @ main.4d5aa36d.chunk.js:2
l @ 2.77621d05.chunk.js:2
p @ 2.77621d05.chunk.js:2
(anonymous) @ 2.77621d05.chunk.js:2
b @ 2.77621d05.chunk.js:2
at @ 2.77621d05.chunk.js:2
ot @ 2.77621d05.chunk.js:2
lt @ 2.77621d05.chunk.js:2
pt @ 2.77621d05.chunk.js:2
I @ 2.77621d05.chunk.js:2
B @ 2.77621d05.chunk.js:2
Jt @ 2.77621d05.chunk.js:2
Yt @ 2.77621d05.chunk.js:2
t.unstable_runWithPriority @ 2.77621d05.chunk.js:2
Vo @ 2.77621d05.chunk.js:2
z @ 2.77621d05.chunk.js:2
Gt @ 2.77621d05.chunk.js:2
index.js:4243 Uncaught TypeError: e.h is not a function
    at qt.<anonymous> (index.js:4243)
    at Mt (index.js:4228)
    at wt (index.js:4227)
    at ae (index.js:4236)
    at qt.R (index.js:4235)
    at qt.L (index.js:4235)
(anonymous) @ main.4d5aa36d.chunk.js:2
Mt @ main.4d5aa36d.chunk.js:2
wt @ main.4d5aa36d.chunk.js:2
ae @ main.4d5aa36d.chunk.js:2
qt.R @ main.4d5aa36d.chunk.js:2
qt.L @ main.4d5aa36d.chunk.js:2
XMLHttpRequest.send (async)
re @ main.4d5aa36d.chunk.js:2
Se.N @ main.4d5aa36d.chunk.js:2
(anonymous) @ main.4d5aa36d.chunk.js:2
i.android.emulation.control.EmulatorControllerClient.getStatus @ main.4d5aa36d.chunk.js:2
(anonymous) @ main.4d5aa36d.chunk.js:2
getScreenSize @ main.4d5aa36d.chunk.js:2
componentDidMount @ main.4d5aa36d.chunk.js:2
il @ 2.77621d05.chunk.js:2
pu @ 2.77621d05.chunk.js:2
t.unstable_runWithPriority @ 2.77621d05.chunk.js:2
Vo @ 2.77621d05.chunk.js:2
fu @ 2.77621d05.chunk.js:2
Zl @ 2.77621d05.chunk.js:2
(anonymous) @ 2.77621d05.chunk.js:2
t.unstable_runWithPriority @ 2.77621d05.chunk.js:2
Vo @ 2.77621d05.chunk.js:2
Ko @ 2.77621d05.chunk.js:2
qo @ 2.77621d05.chunk.js:2
Ql @ 2.77621d05.chunk.js:2
enqueueSetState @ 2.77621d05.chunk.js:2
x.setState @ 2.77621d05.chunk.js:2
(anonymous) @ main.4d5aa36d.chunk.js:2
l.emit @ 2.77621d05.chunk.js:2
(anonymous) @ main.4d5aa36d.chunk.js:2
Promise.then (async)
login @ main.4d5aa36d.chunk.js:2
G.doLogin @ main.4d5aa36d.chunk.js:2
l @ 2.77621d05.chunk.js:2
p @ 2.77621d05.chunk.js:2
(anonymous) @ 2.77621d05.chunk.js:2
b @ 2.77621d05.chunk.js:2
at @ 2.77621d05.chunk.js:2
ot @ 2.77621d05.chunk.js:2
lt @ 2.77621d05.chunk.js:2
pt @ 2.77621d05.chunk.js:2
I @ 2.77621d05.chunk.js:2
B @ 2.77621d05.chunk.js:2
Jt @ 2.77621d05.chunk.js:2
Yt @ 2.77621d05.chunk.js:2
t.unstable_runWithPriority @ 2.77621d05.chunk.js:2
Vo @ 2.77621d05.chunk.js:2
z @ 2.77621d05.chunk.js:2
Gt @ 2.77621d05.chunk.js:2
number33 commented 4 years ago

I'm also getting a blank screen. If I refresh the page, I get prompted for an username and password again.

Here is what I see in the console.

t.serializeBinary is not a function
    at ve.MethodDescriptor.a (index.js:6216)
    at A.Se.S (index.js:4247)
    at A.serverStreaming (index.js:9585)
    at v.i.android.emulation.control.EmulatorControllerClient.streamLogcat (index.js:6242)
    at F.start (index.js:10431)
    at T.componentDidMount (logcat_view.js:45)
    at il (react-dom.production.min.js:212)
    at pu (react-dom.production.min.js:255)
    at t.unstable_runWithPriority (scheduler.production.min.js:19)
    at Vo (react-dom.production.min.js:122)```
Uncaught TypeError: e.h is not a function
    at qt.<anonymous> (index.js:4243)
    at Mt (index.js:4228)
    at wt (index.js:4227)
    at ae (index.js:4236)
    at qt.R (index.js:4235)
    at qt.L (index.js:4235)
iremmats commented 4 years ago

Getting exactly the same too.

digijap commented 4 years ago

I have the same issue. Some more info as well on what i see in the logs of the emulator:

emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel: ActionExecutorImpl: Action started execution, but we can't guarantee it will complete, the app may be killed. Action: class com.google.android.apps.messaging.shared.datamodel.action.SelfParticipantsRefreshAction-SelfParticipantsRefreshAction:48545005
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.google.android.apps.messaging/.shared.datamodel.action.execution.ActionExecutorImpl$EmptyService }: app is in background uid UidRecord{f2c6596 u0a123 CEM  idle change:cached procs:2 seq(0,0,0)}
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1616)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at android.app.ContextImpl.startService(ContextImpl.java:1571)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at android.content.ContextWrapper.startService(ContextWrapper.java:669)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at com.google.android.apps.messaging.shared.datamodel.action.execution.ActionExecutorImpl.e(SourceFile:107)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at com.google.android.apps.messaging.shared.datamodel.action.execution.ActionExecutorImpl.a(SourceFile:19)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at com.google.android.apps.messaging.shared.datamodel.action.execution.ActionExecutorImpl.a(SourceFile:16)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at dya.c(SourceFile:12)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at dyb.run(Unknown Source:2)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at android.os.Handler.handleCallback(Handler.java:883)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at android.os.Handler.dispatchMessage(Handler.java:100)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at android.os.Looper.loop(Looper.java:214)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at android.app.ActivityThread.main(ActivityThread.java:7356)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at java.lang.reflect.Method.invoke(Native Method)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
emulator_emulator | logcat: 07-10 10:03:36.499  4496  4496 W BugleDataModel:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
emulator_emulator | logcat: 07-10 10:03:36.503  4496  4672 I BugleDataModel: ParticipantRefresh: Start participant refresh. refreshMode: 1
emulator_emulator | logcat: 07-10 10:03:36.525  4496  4672 I BugleDataModel: SelfParticipantsData: insertSelfParticipant. participantId: 2, selfParticipantId: 2, subId: 1
emulator_emulator | logcat: 07-10 10:03:36.529  2088  2115 E memtrack: Couldn't load memtrack module
emulator_emulator | logcat: 07-10 10:03:36.529  2088  2115 W android.os.Debug: failed to get memory consumption info: -1
emulator_emulator | logcat: 07-10 10:03:36.540  2088  2115 E memtrack: Couldn't load memtrack module
emulator_emulator | logcat: 07-10 10:03:36.540  2088  2115 W android.os.Debug: failed to get memory consumption info: -1
emulator_emulator | logcat: 07-10 10:03:36.543  2088  2115 E memtrack: Couldn't load memtrack module
emulator_emulator | logcat: 07-10 10:03:36.543  2088  2115 W android.os.Debug: failed to get memory consumption info: -1
emulator_emulator | video: (network.cc:927): Connect failed with 99
emulator_emulator | logcat: 07-10 10:03:36.619  4496  4672 I BugleDataModel: ParticipantRefresh: Number of participants refreshed: 2
emulator_emulator | video: (network.cc:927): Connect failed with 99
masatoogawa commented 4 years ago

It seems this is a protocol buffer issue. Using binary for --js_out options worked.


diff --git a/js/android-emulator-webrtc/Makefile b/js/android-emulator-webrtc/Makefile
index 29781af..02c7d56 100644
--- a/js/android-emulator-webrtc/Makefile
+++ b/js/android-emulator-webrtc/Makefile
@@ -81,7 +81,7 @@ $(PROTODIR)/%_pb.js  : $(PROTOSRCDIR)/%.proto $(PROTODIR) protoc-gen-grpc-web
        $(PROTOC) \
                -I/usr/local/include -I$(PROTODIR) -I$(PROTOSRCDIR) \
                        --plugin=protoc-gen-grpc-web=$(CURRENT_DIR)/protoc-gen-grpc-web \
-                       --js_out=import_style=commonjs:$(PROTODIR) \
+                       --js_out=import_style=commonjs,binary:$(PROTODIR) \
                        --grpc-web_out=import_style=commonjs,mode=grpcwebtext:$(PROTODIR) \
                        $<
        $(PREFIX_ESLINT) $@```
pokowaka commented 4 years ago

We are in the process of moving the JS library to its own project and releasing it as a separate npm module. This would remove the need of compiling and would likely fix all these issues.

pokowaka commented 4 years ago

@masatoogawa I've applied your suggestion, however the code generated is exactly the same as not adding the binary parameter.

masatoogawa commented 4 years ago

It may depend on the version of the protocol buffer. The version I'm using is 3.0.0. Adding the binary option makes it possible to use It worked. But I noticed the statement in the Makefile "Please install Google protocol buffers 3.6.0> and its compiler.". So I installed 3.7.0, It worked without the binary option. It would have been better if there had been some sort of protocol buffer version check.