`Unresolved reference: android` on new Flutter project
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.
android kotlin flutter
add a comment |
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.
android kotlin flutter
add a comment |
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.
android kotlin flutter
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.
android kotlin flutter
android kotlin flutter
asked Dec 31 '18 at 23:27
DaveDave
22.7k1486151
22.7k1486151
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
There are a few things you can try:
open Android directory of your flutter project in android studio(new window). Then
- go to Build and select clean project. Then after this select Rebuild project.
- If above step doesn't solves your problem then go to file -> open -> select build.gradle to reopen and get the dependencies of project.
- 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:)
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
add a comment |
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.
add a comment |
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).
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
There are a few things you can try:
open Android directory of your flutter project in android studio(new window). Then
- go to Build and select clean project. Then after this select Rebuild project.
- If above step doesn't solves your problem then go to file -> open -> select build.gradle to reopen and get the dependencies of project.
- 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:)
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
add a comment |
There are a few things you can try:
open Android directory of your flutter project in android studio(new window). Then
- go to Build and select clean project. Then after this select Rebuild project.
- If above step doesn't solves your problem then go to file -> open -> select build.gradle to reopen and get the dependencies of project.
- 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:)
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
add a comment |
There are a few things you can try:
open Android directory of your flutter project in android studio(new window). Then
- go to Build and select clean project. Then after this select Rebuild project.
- If above step doesn't solves your problem then go to file -> open -> select build.gradle to reopen and get the dependencies of project.
- 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:)
There are a few things you can try:
open Android directory of your flutter project in android studio(new window). Then
- go to Build and select clean project. Then after this select Rebuild project.
- If above step doesn't solves your problem then go to file -> open -> select build.gradle to reopen and get the dependencies of project.
- 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:)
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
add a comment |
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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Jan 1 at 5:33
DaveDave
22.7k1486151
22.7k1486151
add a comment |
add a comment |
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).
add a comment |
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).
add a comment |
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).
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).
answered Jan 26 at 15:25
Rohit GurjarRohit Gurjar
182210
182210
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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