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

Client apk getting stopped #1

Open
spaul13 opened this issue Apr 3, 2019 · 2 comments
Open

Client apk getting stopped #1

spaul13 opened this issue Apr 3, 2019 · 2 comments

Comments

@spaul13
Copy link

spaul13 commented Apr 3, 2019

I have already started the server on a ubuntu machine in the same local area network where my phone is connected. BootRun is running and showing 80% Executing with the time when it started executing.

I changed the IP address and port number in config.java in the client side and launch the app on Pixel 2. But after hitting the send button to send a particular image to the server to detect it. I am getting the following error and the apk got stopped.

ERROR:
04-03 13:11:52.118 8778-8778/edu.tensorflow.client E/AndroidRuntime: FATAL EXCEPTION: main
Process: edu.tensorflow.client, PID: 8778
java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.tensorflow.client/edu.tensorflow.client.camera.ListResultActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String edu.tensorflow.client.api.dto.ResultDTO.getPredictedImage()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String edu.tensorflow.client.api.dto.ResultDTO.getPredictedImage()' on a null object reference
at edu.tensorflow.client.api.ResultAssembler.convertToEntityList(ResultAssembler.java:24)
at edu.tensorflow.client.camera.ListResultActivity.onCreate(ListResultActivity.java:25)
at android.app.Activity.performCreate(Activity.java:6999)
at android.app.Activity.performCreate(Activity.java:6990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
 

Can @szaza or anyone else please tell me why I am getting this error and how to resolve it?

@szaza
Copy link
Owner

szaza commented Apr 4, 2019

Hi,

That is interesting, I cannot tell you for sure what the problem is. The error message is descriptive enough, it is because the resultDTO is null at that point so the getPredictedImage() cannot be called for it. The better question: why is it null? Hmmm... good question. Could you replace the android client with Postman and try to simulate a valid request? I would be curious if the server responds correctly? Have you set correctly the port forwarding on your router? Could you please start the client application in debug mode and check the server response? Does the server logs any error message?

Kind regards,
Zoltan

@spaul13
Copy link
Author

spaul13 commented Apr 17, 2019

Hi @szaza, thanks for replying me back. sorry for replying you after a long time. Can u please elaborate

  1. what port forwarding I have to add in the router settings?

  2. How to replace the android client with a postman?

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

No branches or pull requests

2 participants