`Unresolved reference: android` on new Flutter project












2















My first Flutter app seems to be debugging okay so far on my phone, but all of a sudden I'm seeing this error in my android/app/src/main/kotlin/my.appname.whatever/MainActivity file (screenshot below).



And when I rollover the onCreate, it shows this:
Cannot access class 'android.Os.Bundle'. Check your module classpath for missing or conflicting dependencies.



I'm using AndroidStudio 3.2.1



While trying to get Firebase going, I changed the version of this (it was 1.2.17 I think, but had a warning about it being different than the IDE, so I changed it to what it suggested and the warning went away). Even after trying to change it back, I'm still getting the warning below.



buildscript {
ext.kotlin_version = '1.3.11'



I assume this is something simple, but for someone very new to Android/Flutter...etc, I just don't have a clue where to look for the Unresolved reference: android, nor have any idea what I did to make it show up.



error










share|improve this question



























    2















    My first Flutter app seems to be debugging okay so far on my phone, but all of a sudden I'm seeing this error in my android/app/src/main/kotlin/my.appname.whatever/MainActivity file (screenshot below).



    And when I rollover the onCreate, it shows this:
    Cannot access class 'android.Os.Bundle'. Check your module classpath for missing or conflicting dependencies.



    I'm using AndroidStudio 3.2.1



    While trying to get Firebase going, I changed the version of this (it was 1.2.17 I think, but had a warning about it being different than the IDE, so I changed it to what it suggested and the warning went away). Even after trying to change it back, I'm still getting the warning below.



    buildscript {
    ext.kotlin_version = '1.3.11'



    I assume this is something simple, but for someone very new to Android/Flutter...etc, I just don't have a clue where to look for the Unresolved reference: android, nor have any idea what I did to make it show up.



    error










    share|improve this question

























      2












      2








      2








      My first Flutter app seems to be debugging okay so far on my phone, but all of a sudden I'm seeing this error in my android/app/src/main/kotlin/my.appname.whatever/MainActivity file (screenshot below).



      And when I rollover the onCreate, it shows this:
      Cannot access class 'android.Os.Bundle'. Check your module classpath for missing or conflicting dependencies.



      I'm using AndroidStudio 3.2.1



      While trying to get Firebase going, I changed the version of this (it was 1.2.17 I think, but had a warning about it being different than the IDE, so I changed it to what it suggested and the warning went away). Even after trying to change it back, I'm still getting the warning below.



      buildscript {
      ext.kotlin_version = '1.3.11'



      I assume this is something simple, but for someone very new to Android/Flutter...etc, I just don't have a clue where to look for the Unresolved reference: android, nor have any idea what I did to make it show up.



      error










      share|improve this question














      My first Flutter app seems to be debugging okay so far on my phone, but all of a sudden I'm seeing this error in my android/app/src/main/kotlin/my.appname.whatever/MainActivity file (screenshot below).



      And when I rollover the onCreate, it shows this:
      Cannot access class 'android.Os.Bundle'. Check your module classpath for missing or conflicting dependencies.



      I'm using AndroidStudio 3.2.1



      While trying to get Firebase going, I changed the version of this (it was 1.2.17 I think, but had a warning about it being different than the IDE, so I changed it to what it suggested and the warning went away). Even after trying to change it back, I'm still getting the warning below.



      buildscript {
      ext.kotlin_version = '1.3.11'



      I assume this is something simple, but for someone very new to Android/Flutter...etc, I just don't have a clue where to look for the Unresolved reference: android, nor have any idea what I did to make it show up.



      error







      android kotlin flutter






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 31 '18 at 23:27









      DaveDave

      22.7k1486151




      22.7k1486151
























          3 Answers
          3






          active

          oldest

          votes


















          0














          There are a few things you can try:



          open Android directory of your flutter project in android studio(new window). Then




          1. go to Build and select clean project. Then after this select Rebuild project.

          2. If above step doesn't solves your problem then go to file -> open -> select build.gradle to reopen and get the dependencies of project.

          3. go to project root directory and try flutter clean command this would clean the build/ and then try running your project by flutter run command.


          This must resolve the dependency error. Hope it helps:)






          share|improve this answer
























          • In Android Studio 3.2.1, there is no "Build->clean project" nor an option to "Rebuild project". Unless it's in another menu and I just don't see it?

            – Dave
            Jan 1 at 5:28



















          0














          In my case, File -> Invalidate Caches / Restart worked. When Android Studio started back up, the issue was gone. Doesn't really answer the "why", but... it worked.






          share|improve this answer































            0














            Configure to the project SDK to the appropriate API level as per your project will solve your issue(shown in the dialog after clicking Setup SDK at right corner).



            enter image description here






            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53992118%2funresolved-reference-android-on-new-flutter-project%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              There are a few things you can try:



              open Android directory of your flutter project in android studio(new window). Then




              1. go to Build and select clean project. Then after this select Rebuild project.

              2. If above step doesn't solves your problem then go to file -> open -> select build.gradle to reopen and get the dependencies of project.

              3. go to project root directory and try flutter clean command this would clean the build/ and then try running your project by flutter run command.


              This must resolve the dependency error. Hope it helps:)






              share|improve this answer
























              • In Android Studio 3.2.1, there is no "Build->clean project" nor an option to "Rebuild project". Unless it's in another menu and I just don't see it?

                – Dave
                Jan 1 at 5:28
















              0














              There are a few things you can try:



              open Android directory of your flutter project in android studio(new window). Then




              1. go to Build and select clean project. Then after this select Rebuild project.

              2. If above step doesn't solves your problem then go to file -> open -> select build.gradle to reopen and get the dependencies of project.

              3. go to project root directory and try flutter clean command this would clean the build/ and then try running your project by flutter run command.


              This must resolve the dependency error. Hope it helps:)






              share|improve this answer
























              • In Android Studio 3.2.1, there is no "Build->clean project" nor an option to "Rebuild project". Unless it's in another menu and I just don't see it?

                – Dave
                Jan 1 at 5:28














              0












              0








              0







              There are a few things you can try:



              open Android directory of your flutter project in android studio(new window). Then




              1. go to Build and select clean project. Then after this select Rebuild project.

              2. If above step doesn't solves your problem then go to file -> open -> select build.gradle to reopen and get the dependencies of project.

              3. go to project root directory and try flutter clean command this would clean the build/ and then try running your project by flutter run command.


              This must resolve the dependency error. Hope it helps:)






              share|improve this answer













              There are a few things you can try:



              open Android directory of your flutter project in android studio(new window). Then




              1. go to Build and select clean project. Then after this select Rebuild project.

              2. If above step doesn't solves your problem then go to file -> open -> select build.gradle to reopen and get the dependencies of project.

              3. go to project root directory and try flutter clean command this would clean the build/ and then try running your project by flutter run command.


              This must resolve the dependency error. Hope it helps:)







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jan 1 at 5:03









              John WickJohn Wick

              34039




              34039













              • In Android Studio 3.2.1, there is no "Build->clean project" nor an option to "Rebuild project". Unless it's in another menu and I just don't see it?

                – Dave
                Jan 1 at 5:28



















              • In Android Studio 3.2.1, there is no "Build->clean project" nor an option to "Rebuild project". Unless it's in another menu and I just don't see it?

                – Dave
                Jan 1 at 5:28

















              In Android Studio 3.2.1, there is no "Build->clean project" nor an option to "Rebuild project". Unless it's in another menu and I just don't see it?

              – Dave
              Jan 1 at 5:28





              In Android Studio 3.2.1, there is no "Build->clean project" nor an option to "Rebuild project". Unless it's in another menu and I just don't see it?

              – Dave
              Jan 1 at 5:28













              0














              In my case, File -> Invalidate Caches / Restart worked. When Android Studio started back up, the issue was gone. Doesn't really answer the "why", but... it worked.






              share|improve this answer




























                0














                In my case, File -> Invalidate Caches / Restart worked. When Android Studio started back up, the issue was gone. Doesn't really answer the "why", but... it worked.






                share|improve this answer


























                  0












                  0








                  0







                  In my case, File -> Invalidate Caches / Restart worked. When Android Studio started back up, the issue was gone. Doesn't really answer the "why", but... it worked.






                  share|improve this answer













                  In my case, File -> Invalidate Caches / Restart worked. When Android Studio started back up, the issue was gone. Doesn't really answer the "why", but... it worked.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 1 at 5:33









                  DaveDave

                  22.7k1486151




                  22.7k1486151























                      0














                      Configure to the project SDK to the appropriate API level as per your project will solve your issue(shown in the dialog after clicking Setup SDK at right corner).



                      enter image description here






                      share|improve this answer




























                        0














                        Configure to the project SDK to the appropriate API level as per your project will solve your issue(shown in the dialog after clicking Setup SDK at right corner).



                        enter image description here






                        share|improve this answer


























                          0












                          0








                          0







                          Configure to the project SDK to the appropriate API level as per your project will solve your issue(shown in the dialog after clicking Setup SDK at right corner).



                          enter image description here






                          share|improve this answer













                          Configure to the project SDK to the appropriate API level as per your project will solve your issue(shown in the dialog after clicking Setup SDK at right corner).



                          enter image description here







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jan 26 at 15:25









                          Rohit GurjarRohit Gurjar

                          182210




                          182210






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53992118%2funresolved-reference-android-on-new-flutter-project%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Angular Downloading a file using contenturl with Basic Authentication

                              Olmecas

                              Can't read property showImagePicker of undefined in react native iOS