Announcement

Collapse
No announcement yet.

Version 4.0 Robot Controller Not Running on Moto G4

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Version 4.0 Robot Controller Not Running on Moto G4

    I Have Moto G4 phones and updated to Version 4.0 and the Robot Controller will not load. It says "Unfortunately FTC Robot Controller has Stopped"

    I have narrowed it down do a custom I2C sensor we created using the following functions
    I2cDeviceSynchDevice From this wiki https://github.com/ftctechnh/ftc_app...-an-I2C-Driver Is this a bug? Is there a workaround?

  • #2
    Also in the sample file SensorREV2mDistance the following
    import com.qualcomm.hardware.rev.Rev2mDistanceSensor; Cannot Resolve Symbol

    Comment


    • #3
      After a long night debugging, I found that if I merge my team code into a freshly downloaded ftc-app this error is not there
      "import com.qualcomm.hardware.rev.Rev2mDistanceSensor; Cannot Resolve Symbol".
      However if I delete the old ftc-app keeping the old teamcode directory and copy the downloaded ftc-app where the old project was then this error occurs. However this did not fix the custom i2c sensors app crash.

      This is the I2C sensor file we created over the summer
      https://github.com/TOWR5291/2018-201...s/VL53L0X.java



      Comment


      • #4
        Not sure if this is the issue or not, but the annotation @I2cSensor has been deprecated. @I2cDeviceType should be used instead.

        Comment


        • #5
          I did notice that it was deprecated, but did not know @I2cDeviceType replaced it, I commented that line out and it still caused the app to crash on load. I will try replacing it tonight. Just having the class in team folder causes the crash, so anyone an test just by placing that file in your team folder and not even using it.

          Comment


          • #6
            We also have custom I2C driver for PixyCam. Please let us know if @I2cDeviceType fixed this error. We have not migrated to 4.0 yet will do this weekend

            Comment


            • #7
              Hi Corban987,

              I'm sorry you are having issues.

              Would it be possible to get some log files so we can try and troubleshoot?
              Also, what sensor is this? Is this the REV 2m Distance Sensor (which uses the ST Micro VL530X time of flight sensor)?

              Also, are you also having a problem with your PixyCam driver? If so could you share the PixyCam driver source code?

              Tom

              Comment


              • #8
                Corban987, I am able to build your custom driver into the app without any issues. If you commented out the @I2cSensor annotation, then the app will completely ignore your class until you explicitly access it. The fact that it still crashed even after you commented out that line suggests to me that this is not an issue with that class.

                As Tom said, we need to see logs to be able to help you any further. Either get them from the phone's file system, or crash the app while the phone is connected to Android Studio, and copy the crash log from the Logcat tab (at the bottom of the screen).

                @I2cSensor has been deprecated, but it should continue to work fine for this season. I recommend migrating to @I2cDeviceType (accompanied by @DeviceProperties) so that your driver will continue to work with next year's SDK, which will probably not support @I2cSensor anymore. You won't need to change anything about the class itself other than the annotations.

                Comment


                • #9
                  I am also having a similar issue.
                  I have Moto G4 phones and updated to Version 4.0 and the Robot Controller will not load. It says "Unfortunately FTC Robot Controller has Stopped"

                  I don't believe it was an issue with I2cSensor though.
                  Here is the error:

                  09-15 15:37:09.760 4226-4226/com.qualcomm.ftcrobotcontroller E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: com.qualcomm.ftcrobotcontroller, PID: 4226
                  java.lang.RuntimeException: Unable to bind to service com.qualcomm.ftccommon.FtcRobotControllerService@a 661fff with Intent { cmp=com.qualcomm.ftcrobotcontroller/com.qualcomm.ftccommon.FtcRobotControllerService (has extras) }: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.qualcomm.robotcore.wifi.NetworkConnection.setC allback(com.qualcomm.robotcore.wifi.NetworkConnect ion$NetworkConnectionCallback)' on a null object reference
                  at android.app.ActivityThread.handleBindService(Activ ityThread.java:3253)
                  at android.app.ActivityThread.-wrap3(ActivityThread.java)
                  at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1585)
                  at android.os.Handler.dispatchMessage(Handler.java:10 2)
                  at android.os.Looper.loop(Looper.java:154)
                  at android.app.ActivityThread.main(ActivityThread.jav a:6165)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:888)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:778)
                  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.qualcomm.robotcore.wifi.NetworkConnection.setC allback(com.qualcomm.robotcore.wifi.NetworkConnect ion$NetworkConnectionCallback)' on a null object reference
                  at com.qualcomm.ftccommon.FtcRobotControllerService.o nBind(FtcRobotControllerService.java:232)
                  at android.app.ActivityThread.handleBindService(Activ ityThread.java:3239)
                  at android.app.ActivityThread.-wrap3(ActivityThread.java)
                  at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1585)
                  at android.os.Handler.dispatchMessage(Handler.java:10 2)
                  at android.os.Looper.loop(Looper.java:154)
                  at android.app.ActivityThread.main(ActivityThread.jav a:6165)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:888)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:778)

                  Comment


                  • #10
                    FTC6055 : a shot in the dark, but you don't perchance have Instant Run turned on in Android Studio, do you?

                    Comment


                    • #11
                      FTC6055 can you post the entire log please?

                      Comment


                      • #12
                        Corban987 I just reproduced your crash, and I'll make sure to figure it out and fix. In the meantime, switching to the new annotations should be a successful workaround.

                        FTC6055 Your issue is definitely unrelated. A full log file would still be appreciated so we can track down that one too.

                        Comment


                        • #13
                          A patch for the @I2cSensor issue will be in the next release.

                          Comment


                          • #14
                            I got it to work with the following changes. I had to clean, rebuild,. I also somehow reindexed everything. Once all that done it runs, on the phone, I will now test if it works.
                            Code:
                             
                             //@I2cSensor(name = "VL53L0X Light Ranging Sensor", description = "Light Ranging Sensor From ST Microelectronics", xmlTag = "VL53L0X") @I2cDeviceType() @DeviceProperties(name = "VL53L0X Light Ranging Sensor", description = "Light Ranging Sensor From ST Microelectronics", xmlTag = "VL53L0X")
                            I also made a test I2C file and copied everything from the precompiled Modern Robotics Colour Sensor

                            Code:
                             
                             /**  * {@link com.qualcomm.hardware.modernrobotics.ModernRoboticsI2cColorSensor} provides support for the Modern Robotics Color Sensor.  * @see <a href="http://www.modernroboticsinc.com/color-sensor">MR Color Sensor</a>  */ public class TestI2C extends I2cDeviceSynchDevice<I2cDeviceSynch>         implements ColorSensor, NormalizedColorSensor, SwitchableLight, I2cAddrConfig { ETC
                            this caused the relinking then everything worked

                            Comment


                            • #15
                              Not sure why the code tags didn't format that correctly!

                              //@I2cSensor(name = "VL53L0X Light Ranging Sensor", description = "Light Ranging Sensor From ST Microelectronics", xmlTag = "VL53L0X") @I2cDeviceType() @DeviceProperties(name = "VL53L0X Light Ranging Sensor", description = "Light Ranging Sensor From ST Microelectronics", xmlTag = "VL53L0X") and

                              /** * {@link com.qualcomm.hardware.modernrobotics.ModernRobotic sI2cColorSensor} provides support for the Modern Robotics Color Sensor. * @see <a href="http://www.modernroboticsinc.com/color-sensor">MR Color Sensor</a> */ public class TestI2C extends I2cDeviceSynchDevice<I2cDeviceSynch> implements ColorSensor, NormalizedColorSensor, SwitchableLight, I2cAddrConfig { etc

                              Comment

                              Working...
                              X