running flutter in vs code shows Running with sound null safety - flutter

This is my first app in flutter using VS Code.
While I try to run my program via terminal using command flutter run shows:
Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts, consider enabling software rendering with"--enable-software-rendering".
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Running Gradle task 'assembleDebug'... 12.3s
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Syncing files to device Android SDK built for x86... 9.4s
Flutter run key commands.
r Hot reload.
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
Running with sound null safety
An Observatory debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:63186/_rjqXM3bogc=/
The Flutter DevTools debugger and profiler on Android SDK built for x86 is available at:
http://127.0.0.1:9101?uri=http://127.0.0.1:63186/_rjqXM3bogc=/
After this nothing happens in terminal neither virtual device opens up. What is happening?
When running flutter doctor shows everything ok.

This error happens because of gradle version this is an error like this question just update your gradle in Your_Flutter_App > android > build.gradle, dependencies block to new versions like:
classpath 'com.android.tools.build:gradle:7.0.2'
check buildToolsVersion and compileSdkVersion in /android/app/build.gradle if didnt work.

Related

Compiler error in Flutter - .AAR .Metadata

I'm trying to compile my Flutter app but I get the following problem:
`Execution failed for task ':app:checkDebugAarMetadata'.
Multiple task action failures occurred:
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
> The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.media2:media2-session:1.2.0.
When I update the compile SDK to 31, I get this message:
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
I have made changes to some of the gradle files and the warning messages have been removed but now the message below appears:
Running Gradle task 'assembleDebug'...
WARNING: [Processor] Library 'C:\.gradle\caches\modules-2\files-2.1\androidx.media2\media2-session\1.2.0\e110e7db678fbfc107af48fe6110e3cc713f4564\media2-session-1.2.0.aar' contains references to both AndroidX and old support library. This seems like the library is partially migrated. Jetifier will try to rewrite the library anyway.
Example of androidX reference: 'androidx/media2/session/MediaBrowser$Builder'
Example of support library reference: 'android/support/v4/media/session/MediaSessionCompat$Token'
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
W/FlutterActivityAndFragmentDelegate(13937): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
Debug service listening on ws://127.0.0.1:54956/S_ZxDICL0Ic=/ws
Syncing files to device AOSP on IA Emulator...
The Notes within the message are highlighted in red so I think this could possibly lead to the root cause/solution.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

How Fixing Warning Mapping New ns in Flutter?

i was updated my Android Studio and i face this type of issue in flutter
enter image description here
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
i was researched to fix that issue, using gradle version updated. but it was fix that flutter project only. i was tired, when i was run an new flutter project coming that same issue.
please, let me know,
how to fix this problem **permanently.**your help is so appreciated
Thank you in Advance.
Warning:Mapping new ns to old ns
Clean your project: Run flutter clean
Update gradle-wrapper.properties: Go to <project>/android/gradle/gradle-wrapper.properties , then set the value of distributionUrl to whatever latest gradle distribution is available; currently: https://services.gradle.org/distributions/gradle-7.5.1-bin.zip
Update build.gradle: Update <project>/android/build.gradle with the newest version of Gradle and Kotlin available.
classpath 'com.android.tools.build:gradle:7.3.1' (latest here) and ext.kotlin_version = '1.7.20' (latest here)
Final Step: Run flutter packages get, then run your flutter app. The first run may take more time as the IDE downloads new files.

Questions about updating Gradle in Android Studio

I am working through the Net Ninja YouTube tutorial for Flutter. I just updated Flutter (or maybe Android Studio, whichever is arctic fox?) and now I am getting this error message whenever I try to run any basic app.
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Running Gradle task 'assembleDebug'...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk...
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install /Users/dillonbond/AndroidStudioProjects/testapp3/build/app/outputs/flutter-apk/app.apk: Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
Error launching application on sdk gphone64 arm64.
A google search led me to
when I try to "sync project with gradle files" a warning pops up
People are saying I need to update Gradle. The click through solutions from this page are outdated or gone for me. Where do I input
codecompileSdkVersion(30)
buildToolsVersion("30.0.3")
solutions like this at? Do I put them somewhere in Android Studio in a dart file? Do I enter them into my command terminal? (I'm on a Mac).
All I know about Android Studio is the basic stuff from YouTube, I am very lost here. My programming skills are rudimentary. I'm not completely sure that the linked article even applies to my situation. I installed AS through the home brew pub thing if that makes any difference.
Thanks a million in advance to anyone that can help! I seriously appreciate it!
It is already mentioned in your error that it is due to insufficient storage, delete some files from your real device and it will work.

Warning: Mapping new ns to old ns and emulator stopping abruptly

After upgrading to Arctic Fox , I am getting the following errors, even though the emulator is running but sometimes stopping abruptly.
What is this error ?
How can I get rid of this ?
I am using the following as copied from cmd :
> C:\Users\Debasis>flutter doctor Doctor summary (to see all details,
> run flutter doctor -v): [√] Flutter (Channel stable, 2.2.3, on
> Microsoft Windows [Version 10.0.19042.1165], locale en-IN) [√] Android
> toolchain - develop for Android devices (Android SDK version 31.0.0)
> [√] Chrome - develop for the web [√] Android Studio [√] Connected
> device (2 available)
• No issues found!
The Error :
Launching lib\main.dart on sdk gphone x86 in debug mode... Running
Gradle task 'assembleDebug'... Warning: Mapping new ns
http://schemas.android.com/repository/android/common/02 to old ns
http://schemas.android.com/repository/android/common/01 Warning:
Mapping new ns
http://schemas.android.com/repository/android/generic/02 to old ns
http://schemas.android.com/repository/android/generic/01 Warning:
Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02
to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns
http://schemas.android.com/sdk/android/repo/repository2/02 to old ns
http://schemas.android.com/sdk/android/repo/repository2/01 Warning:
Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02
to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 √
Built build\app\outputs\flutter-apk\app-debug.apk. Installing
build\app\outputs\flutter-apk\app.apk... Debug service listening on
ws://127.0.0.1:57467/XzCZTOeqyQs=/ws Syncing files to device sdk
gphone x86...
I had a similar issue. Two things did the trick for me.
Updated the gradle version in my gradle-wrapper.properties file to the latest available version
Updated the gradle plugin version in my /android/build.gradle file to the latest available version
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
/android/build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
}
Give these a try and see if it works!
I have also the same problem, when I was updated android studio. i research to fix that issue,
TODO ;
step 1 : GOTO project Folder
/android/build.gradle
to update a latest gradle version in dependencies.
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
}
step 2 :
/android/gradle/wrapper/gradle-wrapper.properties
here also to update a latest version of gradle
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
step 3: go to terminal and run flutter clean
step 4: and run flutter pub get
step 5: and run your project using flutter run command
one more think but that issue fix that project only. if u know fix that issue permanently please let me know,
I got the same problem, but after quick research, I managed to solve the problem.
step 1: Go to this webpage: Android Gradle plugin
step 2: Copy the build.gradle plugin to version
step 3: Go to your flutter app project and open the "build.gradle" file under
your_project>android
step 4: In that file edit dependencies.
classpath 'com.android.tools.build:gradle:<step 2 copied version>'
step 5: Now re-run your flutter app. You might see a new error, showing
A problem occurred evaluating project ':app'.
Failed to apply plugin 'com.android.internal.version-check'.
Now follow the instructions given in that error. (highlighted area in the image)

When I run flutter app shows Warning: Mapping new ns http://schemas.android.co

this pop ups when I run flutter app, I already installed all version of build tool of 30
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
I deleted platforms in android sdk and reinstall and it works fine now!