Announcement

Collapse
No announcement yet.

Circle with Red J Next to the Class Names in Android Studio

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

  • Circle with Red J Next to the Class Names in Android Studio

    So I updated the SDK, and I tried to put the opmodes to the phones for the robot, but I found the options to run to the phones grayed out, and red circles with "J"s inside the circles next to the opmode names. It looked like this: http://puu.sh/s30PH/83c9babd17.png

    Now I looked this issue up, and found that changing the project source file to the one that has the opmodes in it would fix this issue, and I did that, but then all the folders and opmodes got a red squiggle line under them and the run buttons still grayed out, with the code not being able to find almost all the methods already in the sample code. It looked like this: http://puu.sh/s312s/9edeced3fd.png (I should also note that changing the source file to more specific folders didn't matter.) For reference, my Project Structure> Modules tab shows this: http://puu.sh/s31bk/c39ca77997.jpg

    How can I solve this issue?

  • #2
    You seemed to have imported the wrong folder into Android Studio. Try opening your current project location in Explorer, close your project in Android Studio and close Android Studio. Delete .idea from your current project location (that is the one that contains the folder ftc_app-master). Reopen Android Studio and open the ftc_app-master folder as your project.

    Comment


    • #3
      I did that, however it didn't seem to fix the problem. (I'm probably going to end up trying it multiple times to make sure I'm doing it right) I should also mention that since I've been having this problem, whenever I go to Android Studio, after one close out then re-open in Android Studio, I get a message talking about migrating the project to the gradle. It looks like this: http://puu.sh/s4fxo/f1619183ab.png
      I went with the Java Update in my system tray if that matters in any way, or if it even does anything to the JDK.
      Is there anything else I should try?

      Comment


      • #4
        Here is what you should do:
        1. You should re-import the app onto Android Studio with no op-modes on it.
        2. Copy the code text onto NotePad and save it.
        3. Go to Android Studio and create a new Java Class.
        4. Paste the code onto the class and you are done.
        If you need clarification just ask.
        Happy Programming!!!

        Comment


        • #5
          Originally posted by DeadPixel View Post
          I did that, however it didn't seem to fix the problem. (I'm probably going to end up trying it multiple times to make sure I'm doing it right) I should also mention that since I've been having this problem, whenever I go to Android Studio, after one close out then re-open in Android Studio, I get a message talking about migrating the project to the gradle. It looks like this: http://puu.sh/s4fxo/f1619183ab.png
          I went with the Java Update in my system tray if that matters in any way, or if it even does anything to the JDK.
          Is there anything else I should try?
          I will tell you that those problems are related. Your Android Studio project is still not using the right root directory (as you have ftc_app-master/ftc_app-master/FtcRobotController) whereas you should only see (ftc_app-master/FtcRobotController) in a properly configured project.

          The folder with the file gradlew is the folder that you need to tell Android Studio when importing your project, otherwise you are using the wrong path to import the folder.

          Comment


          • #6
            Ah. I see. After doing exactly what you said, that is importing the ftc_app-master folder that is inside the ftc_app-master folder (in the C: Drive), it seemed to fix the issue, however now when I try to push the classes to the phones, they all do what they did before, that is having red-squiggle lines under the class names, and red-text and squiggle lines under some of the methods and variables already in the code. Looks like this: http://puu.sh/s5jIv/94633249e6.png
            Is there something else that I have to do?

            Comment


            • #7
              It appears, you have not re-imported as well. You need to delete the red code, and re-type it in. When you do that, you need to press enter which will automatically fix that line. You will most likely have to do that for most of the code. Hope this helps.
              Happy Programming

              Comment


              • #8
                Originally posted by DeadPixel View Post
                Ah. I see. After doing exactly what you said, that is importing the ftc_app-master folder that is inside the ftc_app-master folder (in the C: Drive), it seemed to fix the issue, however now when I try to push the classes to the phones, they all do what they did before, that is having red-squiggle lines under the class names, and red-text and squiggle lines under some of the methods and variables already in the code. Looks like this: http://puu.sh/s5jIv/94633249e6.png
                Is there something else that I have to do?
                Go to the Project tool window (left sidebar -> Project), at the top of that window, you should see a drop down list, use it to choose Project (if it is not already chosen). Down towards the bottom of that tool window you should see an entry called "External Libraries" and expand it. Do you see an entry called RobotCore-release-.

                If not, go to ftc_app-master\libs, and check for RobotCore-release.aar, and if it exists, continue below.

                If so, go to the top of Android Studio to the View -> Tool Windows -> Gradle Console, copy the text in the tool window that should appear (usually at the bottom of Android Studio) into a pastebin and share the link.

                Comment


                • #9
                  Apologies for the late response. Did what you said, stuff is in here: http://pastebin.com/nBbXn8Vv

                  Comment


                  • #10
                    Just in case it's necessary, I tried running the build to the phone and it gave me the whole can't-find-methods and red squiggle lines and stuff. If needed, I went to the Gradle console again and copied the last build info to another pastebin. It's here: http://pastebin.com/VZB0hNiE

                    Comment


                    • #11
                      It appears that there is a problem with the Gradle. In your picture, at the bottom of the screen, it says, "Gradle build finished with 11 errors." It should say, "Gradle build finished successfully" or something like that.

                      Comment


                      • #12
                        Originally posted by DeadPixel View Post
                        Just in case it's necessary, I tried running the build to the phone and it gave me the whole can't-find-methods and red squiggle lines and stuff. If needed, I went to the Gradle console again and copied the last build info to another pastebin. It's here: http://pastebin.com/VZB0hNiE

                        You seem to have modified the HardwarePushbot.java file (in FtcRobotController), and that is breaking a bunch of samples. Download a fresh copy of that file from GitHub and overwrite your local copy with that. If you were using that to program your robot, by all means, copy it to your TeamCode module and your programs as well (just be sure to change the names).

                        Comment

                        Working...
                        X