-1

I wanted to try and code location based AR which shows places.I tried the android code in the following link Augmented reality android example and ended up with the following error in Redmi note 3(API 24) Nougat. I did some changes in main.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/surface_overlay">

<SurfaceView android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/surface_camera" />
</FrameLayout>

Error

 08-18 09:15:15.588 32701-32701/? E/AndroidRuntime: FATAL EXCEPTION: main
                                               Process: advisory.arplaces, PID: 32701
                                               java.lang.NullPointerException: Attempt to write to field 'advisory.arplaces.arview.DataView advisory.arplaces.arview.RadarView.view' on a null object reference
                                                   at advisory.arplaces.arview.DataView.draw(DataView.java:329)
                                                   at advisory.arplaces.arview.RadarMarkerView.onDraw(ARView.java:390)
Vishal Yadav
  • 3,642
  • 3
  • 25
  • 42
Sumi
  • 157
  • 1
  • 3
  • 15
  • 5
    Possible duplicate of [What is a NullPointerException, and how do I fix it?](https://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it) – Vishal Yadav Aug 18 '17 at 06:32

1 Answers1

0

Hi I think you may not declare lib properly or you did not initialize RadarView object in java file so you want to check it properly or try to debug it, because you are getting null object reference exception.

SWAPDROiD
  • 357
  • 3
  • 15