Hello Everyone I am getting error when I build the apk in flutter project. I am not sure whether its is because of code or some setup issue. I think that there is something wrong in setupping flutter.
The error states that:
PS F:\FYP\Code\Recipedia> flutter build apk --build-name Recipedia --build-number 01
Building with sound null safety
w: Runtime JAR files in the classpath should have the same version. These files were found in
the classpath:
C:/Users/safin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-
jdk8/1.5.30/5fd47535cc85f9e24996f939c2de6583991481b0/kotlin-stdlib-jdk8-1.5.30.jar (version
1.5)
C:/Users/safin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-
jdk7/1.6.10/e1c380673654a089c4f0c9f83d0ddfdc1efdb498/kotlin-stdlib-jdk7-1.6.10.jar (version
1.6)
C:/Users/safin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-
stdlib/1.6.10/b8af3fe6f1ca88526914929add63cf5e7c5049af/kotlin-stdlib-1.6.10.jar (version 1.6)
C:/Users/safin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-
common/1.6.10/c118700e3a33c8a0d9adc920e9dec0831171925/kotlin-stdlib-common-1.6.10.jar (version
1.6)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing
them from the classpath
w: Runtime JAR files in the classpath should have the same version. These files were found in
the classpath:
C:/Users/safin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-
jdk8/1.5.30/5fd47535cc85f9e24996f939c2de6583991481b0/kotlin-stdlib-jdk8-1.5.30.jar (version
1.5)
C:/Users/safin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-
jdk7/1.6.10/e1c380673654a089c4f0c9f83d0ddfdc1efdb498/kotlin-stdlib-jdk7-1.6.10.jar (version
1.6)
C:/Users/safin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-
stdlib/1.6.10/b8af3fe6f1ca88526914929add63cf5e7c5049af/kotlin-stdlib-1.6.10.jar (version 1.6)
C:/Users/safin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-
common/1.6.10/c118700e3a33c8a0d9adc920e9dec0831171925/kotlin-stdlib-common-1.6.10.jar (version
1.6)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing
them from the classpath
Running Gradle task 'assembleRelease'... 772.7s
√ Built build\app\outputs\flutter-apk\app-release.apk (22.3MB).
This is the output of flutter run --verbose
PS F:\FYP\Code\Recipedia> flutter run --verbose
[ +91 ms] executing: [C:\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +163 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +2 ms] e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
[ +1 ms] executing: [C:\flutter/] git tag --points-at
e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
[ +100 ms] Exit code 0 from: git tag --points-at e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
[ +1 ms] 3.3.7
[ +95 ms] executing: [C:\flutter/] git rev-parse --abbrev-ref --symbolic @{upstream}
[ +85 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{upstream}
[ ] origin/stable
[ ] executing: [C:\flutter/] git ls-remote --get-url origin
[ +88 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ +147 ms] executing: [C:\flutter/] git rev-parse --abbrev-ref HEAD
[ +89 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] stable
[ +159 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +10 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ +3 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +120 ms] executing: C:\Users\safin\AppData\Local\Android\sdk\platform-tools\adb.exe devices
-l
[ +166 ms] List of devices attached
[ +27 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping
update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping
update.
[ +4 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ +23 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +128 ms] No supported devices connected.
[ +45 ms] The following devices were found, but are not supported by this project:
Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version
10.0.19045.2193]
Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.88
Edge (web) • edge • web-javascript • Microsoft Edge 107.0.1418.26
If you would like your app to run on web or windows, consider running `flutter create
.` to generate projects for these
platforms.
[ +22 ms] "flutter run" took 606ms.
[ +37 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.validateCommand (package:flutter_tools/src/commands/run.dart:491:7)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart:1330:5)
<asynchronous suspension>
#3 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1209:27)
<asynchronous suspension>
#4 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#5 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#6 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
<asynchronous suspension>
#7 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#8 FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
<asynchronous suspension>
#9 run.<anonymous closure>.<anonymous closure>
(package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#10 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#11 main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>
[ +42 ms] ensureAnalyticsSent: 32ms
[ +3 ms] Running shutdown hooks
[ +1 ms] Shutdown hooks complete
[ +1 ms] exiting with code 1
Please help me to resolve the isssue so I can build the apk without any errors. Thankyou :)