简体   繁体   English

在android中检索Google方向时出现空点异常

[英]Nullpoint Exception in retrieving Google direction in android

I followed a example through this link about retriving direction between two locations, https://github.com/jd-alexander/Google-Directions-Android我通过此链接查看了一个关于在两个位置之间检索方向的示例, https://github.com/jd-alexander/Google-Directions-Android

But I'm getting an error like below.但我收到如下错误。 This is my log:这是我的日志:

11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime: FATAL EXCEPTION: main
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime: Process: com.example.nirma.abcde, PID: 21943
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.nirma.abcde/com.example.nirma.abcde.ShortestPath.RoadMap}: java.lang.RuntimeException: Unable to bind views for com.example.nirma.abcde.ShortestPath.RoadMap
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2695)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.app.ActivityThread.access$900(ActivityThread.java:177)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1430)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:135)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5910)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:372)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:  Caused by: java.lang.RuntimeException: Unable to bind views for com.example.nirma.abcde.ShortestPath.RoadMap
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at butterknife.ButterKnife.bind(ButterKnife.java:322)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at butterknife.ButterKnife.bind(ButterKnife.java:279)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at com.example.nirma.abcde.ShortestPath.RoadMap.onCreate(RoadMap.java:82)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6178)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2648)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769) 
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.app.ActivityThread.access$900(ActivityThread.java:177) 
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1430) 
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:135) 
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5910) 
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:372) 
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405) 
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200) 
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at butterknife.ButterKnife$Finder$1.findView(ButterKnife.java:91)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at butterknife.ButterKnife$Finder.findOptionalView(ButterKnife.java:152)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at com.example.nirma.abcde.ShortestPath.RoadMap$$ViewBinder.bind(RoadMap$$ViewBinder.java:11)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at com.example.nirma.abcde.ShortestPath.RoadMap$$ViewBinder.bind(RoadMap$$ViewBinder.java:8)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at butterknife.ButterKnife.bind(ButterKnife.java:319)
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at butterknife.ButterKnife.bind(ButterKnife.java:279) 
11-20 17:06:08.909 21943-21943/com.example.nirma.abcde E/AndroidRuntime:     at com.example.nirma.abcde.ShortestPath.RoadMap.onCreate(RoadMap.java:82) 

Where does it go wrong?哪里出错了? Please help me with this.请帮我解决一下这个。 How i can get the places between these two locations??我如何获得这两个位置之间的位置? Please help me with this.请帮我解决一下这个。

Provide us a MCVE .为我们提供MCVE

The guess is that within your code you have a line with猜测是在您的代码中,您有一行

someObject.findViewByInt(someInt)

where the View object is null.其中View对象为空。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM