When I run the objectbox_generator with flutter packages pub run build_runner watch the classes are being generated in the JSON, but shortly after that the Generation fails due to a null check issue. I checked my code and couldn't find any null check issues. Is there a way to show more detailed logs (e.g. where it is located) ?
[INFO] Starting Build
[INFO] Updating asset graph...
[INFO] Updating asset graph completed, took 0ms
[INFO] Running build...
[INFO] 1.0s elapsed, 14/20 actions completed.
[INFO] 2.1s elapsed, 38/54 actions completed.
[INFO] Running build completed, took 2.4s
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 100ms
// Here the failing info
[SEVERE] objectbox_generator:generator on lib/$lib$ (cached):
Null check operator used on a null value
[SEVERE] Failed after 2.5s
Same command with additional info flutter packages pub run build_runner build --verbose:
[INFO] Build:Running build...
[INFO] objectbox_generator:generator on lib/$lib$:Package: fit_x
[INFO] objectbox_generator:generator on lib/$lib$:Found 15 entities in: (lib/domain/ob/collection_exercise.objectbox.info, lib/domain/ob/equipment.objectbox.info, lib/domain/ob/equipment_setting.objectbox.info, ..., lib/domain/ob/workout_collection.objectbox.info, lib/domain/ob/workout_log.objectbox.info)
[INFO] objectbox_generator:generator on lib/$lib$:Using model: lib/objectbox-model.json
[SEVERE] objectbox_generator:generator on lib/$lib$:
Null check operator used on a null value
package:objectbox_generator/src/code_chunks.dart 444:38 CodeChunks.backlinkRelInfo
package:objectbox_generator/src/code_chunks.dart 488:18 CodeChunks.toManyRelations.<fn>
dart:_internal ListIterable.join
package:objectbox_generator/src/code_chunks.dart 489:12 CodeChunks.toManyRelations
package:objectbox_generator/src/code_chunks.dart 134:46 CodeChunks.entityBinding
package:objectbox_generator/src/code_chunks.dart 32:71 CodeChunks.objectboxDart.<fn>
package:collection/src/iterable_extensions.dart 173:20 IterableExtension.mapIndexed
dart:core Iterable.join
package:objectbox_generator/src/code_chunks.dart 32:99 CodeChunks.objectboxDart
package:objectbox_generator/src/code_builder.dart 97:27 CodeBuilder.updateCode
package:objectbox_generator/src/code_builder.dart 57:5 CodeBuilder.build
[INFO] Build:Running build completed, took 349ms
[INFO] Build:Caching finalized dependency graph...
[INFO] Build:Caching finalized dependency graph completed, took 117ms
[SEVERE] Build:
Failed after 476ms
[+3823 ms] "flutter run" took 3.927ms.
[ +5 ms] pub finished with exit code 1
[ +2 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 _DefaultPub.interactively (package:flutter_tools/src/dart/pub.dart:366:7)
<asynchronous suspension>
#2 PackagesForwardCommand.runCommand (package:flutter_tools/src/commands/packages.dart:241:5)
<asynchronous suspension>
#3 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043: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:196:13)
<asynchronous suspension>
#6 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284: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:232: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>
[ +74 ms] ensureAnalyticsSent: 67ms
[ +1 ms] Running shutdown hooks
[ ] Shutdown hooks complete
[ ] exiting with code 1
From the code it looks like you have a #Backlink() to an unknown entity (one that is not stored in the DB)... try to check those backlinks (and comment them out to see if that works) and when you've found which one triggers this, consider opening an issue on objectbox-dart's GitHub with the minimal example.
P. S. as for the null check failure - yeah, needs a better error (one that tells you about the missing entity) - https://github.com/objectbox/objectbox-dart/commit/00aabe224eaa9bb88ab2bc18a5c31f00b4f3bdc0
Related
I had an old project kind off like a POC 2-3 years old in flutter,
Now when I try to run it on the latest version I get the following error:
On Flutter Run:
/Users/jci/Documents/Projects/Flutter/dicee/android/app/src/main/java/co/appbrewery/dicee/MainActivity.java:11: error: incompatible types: MainActivity cannot be converted to FlutterEngine
GeneratedPluginRegistrant.registerWith(this);
^
Note: /Users/jci/Documents/Projects/Flutter/dicee/android/app/src/main/java/co/appbrewery/dicee/MainActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 21s
Exception: Gradle task assembleDebug failed with exit code 1
Flutter Run -v:
[ +1 ms] /Users/jci/Documents/Projects/Flutter/dicee-flutter/android/app/src/main/java/co/appbrewery/dicee/MainActivity.java:11: error: incompatible types:
MainActivity cannot be converted to FlutterEngine
[ +2 ms] GeneratedPluginRegistrant.registerWith(this);
[ ] ^
[ ] Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
[ ] 1 error
[ ] FAILURE: Build failed with an exception.
[ ] * What went wrong:
[ ] Execution failed for task ':app:compileDebugJavaWithJavac'.
[ ] > Compilation failed; see the compiler error output for details.
[ ] * Try:
[ ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full
insights.
[ ] * Get more help at https://help.gradle.org
[ ] BUILD FAILED in 3s
[ ] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[ ] Use '--warning-mode all' to show the individual deprecation warnings.
[ ] See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings
[ ] 17 actionable tasks: 5 executed, 12 up-to-date
[ +379 ms] Running Gradle task 'assembleDebug'... (completed in 4.3s)
[+2421 ms] Exception: Gradle task assembleDebug failed with exit code 1
[ +1 ms] "flutter run" took 21,908ms.
[ +3 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:699:9)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1183:27)
<asynchronous suspension>
#3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#4 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#5 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
<asynchronous suspension>
#8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10 main (package:flutter_tools/executable.dart:94:3)
<asynchronous suspension>
Not quite certain if it's a single error or multiple, my guess is it has something to do with my gradle any help whatsoever is appreciated.
It's been a while since I have not checked flutter so I am not sure what the error means...
After putting in some hours into this I realized that the issue was with my Activity having the old flutter engine config code, to fix this all i had to do was go from this:
import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
where it was registering PluginRegistrant to that:
import io.flutter.embedding.android.FlutterActivity;
public class MainActivity extends FlutterActivity {
}
More information in the Flutter Github Upgradation document
I am developing a project with flutter and i want to add crashlytics to my project. Everything else works but flutterfire configure is giving me json error. I look every where for all possible answers but still not solving the issue.
npm commands
- firebase login
- npm install -g firebase-tools
- dart pub global activate flutterfire_cli
- flutterfire configure
all these commands is also works in android studio terminal. but flutterfire gives json error.
I already added the android dependencies for firebase.
error log
⠏ Fetching available Firebase projects...
Unhandled exception:
FormatException: Unexpected character (at character 1)
#
^
#0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)
#1 _ChunkedJsonParser.parseNumber (dart:convert-patch/convert_patch.dart:1250:9)
#2 _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:915:22)
#3 _parseJson (dart:convert-patch/convert_patch.dart:35:10)
#4 JsonDecoder.convert (dart:convert/json.dart:612:36)
#5 runFirebaseCommand (package:flutterfire_cli/src/firebase.dart:95:25)
<asynchronous suspension>
#6 getProjects (package:flutterfire_cli/src/firebase.dart:114:20)
<asynchronous suspension>
#7 ConfigCommand._selectFirebaseProject (package:flutterfire_cli/src/commands/config.dart:278:24)
<asynchronous suspension>
#8 ConfigCommand.run (package:flutterfire_cli/src/commands/config.dart:368:37)
<asynchronous suspension>
#9 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#10 main (file:///C:/Users/USER/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutterfire_cli-0.2.4/bin/flutterfire.dart:57:5)
<asynchronous suspension>
⠧ Fetching available Firebase projects...
Unhandled exception:
FormatException: Unexpected character (at character 1)
#
^
#0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)
#1 _ChunkedJsonParser.parseNumber (dart:convert-patch/convert_patch.dart:1250:9)
#2 _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:915:22)
#3 _parseJson (dart:convert-patch/convert_patch.dart:35:10)
#4 JsonDecoder.convert (dart:convert/json.dart:612:36)
#5 runFirebaseCommand (package:flutterfire_cli/src/firebase.dart:95:25)
<asynchronous suspension>
#6 getProjects (package:flutterfire_cli/src/firebase.dart:114:20)
<asynchronous suspension>
#7 ConfigCommand._selectFirebaseProject (package:flutterfire_cli/src/commands/config.dart:278:24)
<asynchronous suspension>
#8 ConfigCommand.run (package:flutterfire_cli/src/commands/config.dart:368:37)
<asynchronous suspension>
#9 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#10 main (file:///C:/Users/USER/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutterfire_cli-0.2.4/bin/flutterfire.dart:57:5)
<asynchronous suspension>
Would you please help me to solve this issue?
For those of us on windows, do not forget to check if you are running an old version which you may have configured the PATH to point to. This seemed to be the problem in my case. I resolved by removing the old windows binary, then did a fresh install using npm (a fresh/updated windows install may work too). :
npm install -g firebase-tools
followed by:
firebase logout
firebase login
then:
flutterfire configure
**** update ****
i resolve error by this step :
1 - re connect to network
2 - run dart pub global activate flutterfire_cli
3- run flutterfire configure
see Docs help you to get started
Add Firebase To Flutter App
hope this help you
same error here i used firebase in another project but in this project it give me this
Unhandled exception:
FormatException: Unexpected character (at line 5, character 1)
{
^
#0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)
#1 _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:848:48)
#2 _parseJson (dart:convert-patch/convert_patch.dart:35:10)
#3 JsonDecoder.convert (dart:convert/json.dart:612:36)
#4 runFirebaseCommand (package:flutterfire_cli/src/firebase.dart:95:25)
<asynchronous suspension>
#5 getApps (package:flutterfire_cli/src/firebase.dart:162:20)
<asynchronous suspension>
#6 findOrCreateFirebaseApp (package:flutterfire_cli/src/firebase.dart:257:34)
<asynchronous suspension>
#7 FirebaseAndroidOptions.forFlutterApp (package:flutterfire_cli/src/firebase/firebase_android_options.dart:47:25)
<asynchronous suspension>
#8 ConfigCommand.run (package:flutterfire_cli/src/commands/config.dart:377:24)
<asynchronous suspension>
#9 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#10 main (file:///home/abdalazeez/.pub-cache/hosted/pub.dartlang.org/flutterfire_cli-0.2.4/bin/flutterfire.dart:57:5)
<asynchronous suspension>
and this content file
try {
final flutterApp = await FlutterApp.load(Directory.current);
await FlutterFireCommandRunner(flutterApp).run(arguments); <=====the error happen here
} on FlutterFireException catch (err) {
if (utils.activeSpinnerState != null) {
try {
utils.activeSpinnerState!.done();
} catch (_) {}
}
stderr.writeln(err.toString());
exitCode = 1;
} catch (err) {
exitCode = 1;
rethrow;
}
Try installing the Firebase CLI using the standalone binary instead of NPM on Windows, or the install script on Mac.
following steps helped me:
update firebase cli
curl -sL firebase.tools | upgrade=true bash
call
firebase login --reauth
reference:
https://github.com/invertase/flutterfire_cli/issues/27
downloading and installing the node.js setup does the trick for me,
after installation, search for the node.js terminal , then run 'firebase login', after login successfully, then run 'dart pub global activate flutterfire_cli', after succesfully getting the flutterfire cli, then navigate to the folder where the flutter app you created is using the cd(change directory)
after navigating to the directory, then run 'flutterfire configure'
this would create a firebase project in your flutter app project. finish
install latest version of npm and then run command of flutter fire.
example: from any directory run: npm install -g npm#latest version
=> npm install -g npm#9.2.0
as of now latest version of npm is 9.2.0
Deleting the C:\Users\USERNAME.cache\firebase folder
Then re-running flutterfire configure worked for me after first trying the standalone binary and then nvm.
Since yesterday evening I've been unable to open my app in emulator. It worked fine till then.
Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart:1
√ Built build\app\outputs\flutter-apk\app-debug.apk.
It usually takes about 2 mins to open but it was just stuck there for like 15 mins. So I looked up for answers and the first one said to use gradlew clean and gradlew build. I did that and still was stuck but with another error.
Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart:1
Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_android-2.0.12\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Then I tried an answer from a similar question here that suggested to do flutter pub cache repair. Still no luck.
Then I tried another suggestion from an answer here to upgrade flutter. I hadn't upgraded flutter for a couple months since so I did that but still the issue persists.
I read from a comment to a question here that when they run the project using flutter run -v in terminal it opened up after about 20 mins. So I started it and because my laptop is like 6 years old running 6th gen i5 with 8gb ram I thought it might take a bit longer. So I left it there and now after about 2 hours my terminal is stuck at:
I hit the question character limit so I put the terminal's output in
an online notepad at: https://anotepad.com/notes/3jri4gpc
I just closed the emulator and the terminal added this to the above
[+7331895 ms] executing: C:\Users\hp\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell pm list packages com.example.myapp
[ +90 ms] adb.exe: device offline
[ +27 ms] ProcessException: Process exited abnormally:
adb.exe: device offline
Command: C:\Users\hp\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell pm list packages com.example.myapp
[ +3 ms] Installing APK.
[ +17 ms] Installing build\app\outputs\flutter-apk\app.apk...
[ +8 ms] executing: C:\Users\hp\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 install -t -r
D:\myapp\front\myapp\build\app\outputs\flutter-apk\app.apk
[ +114 ms] Performing Push Install
adb: error: failed to get feature set: device 'emulator-5554' not found
[ +6 ms] Installing build\app\outputs\flutter-apk\app.apk... (completed in 115ms)
[ +5 ms] Error: ADB exited with exit code -1
[ +4 ms] Performing Push Install
adb: error: failed to get feature set: device 'emulator-5554' not found
[ +1 ms] Warning: Failed to install APK.
[ +4 ms] Error launching application on Android SDK built for x86.
[ +9 ms] "flutter run" took 7,368,695ms.
[ +23 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:687:9)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
<asynchronous suspension>
#3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#4 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#5 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
<asynchronous suspension>
#8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10 main (package:flutter_tools/executable.dart:94:3)
<asynchronous suspension>
[ +172 ms] ensureAnalyticsSent: 163ms
[ +10 ms] Running shutdown hooks
[ +2 ms] Shutdown hooks complete
[ +2 ms] exiting with code 1
From [+7331895 ms] executing: in the first line after closing the emulator I can see that this was running for about 122 minutes.
I don't understand what's wrong here. Why did the emulator stop working normally all of a sudden?
How to make it work so that I can continue with my app development? Please help.
Yesterday i woke up and found my Visual studio misbehaving. I had to delete all my file in .graddle folder and then re-download them but it's giving the errors below, i have tried googling for solutions but all in vain.
I am using Graddle:
gradle-6.7-all.zip
I am using linux mint distro.
-Pfilesystem-scheme=org-dartlang-root assembleDebug
[+454406 ms] FAILURE: Build failed with an exception.
[ +7 ms] * What went wrong:
[ +1 ms] A problem occurred configuring root project 'android'.
[ +1 ms] > Could not resolve all artifacts for configuration ':classpath'.
[ +2 ms] > Could not download builder-4.1.0.jar (com.android.tools.build:builder:4.1.0)
[ +1 ms] > Could not get resource
'https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/4.1.0/builder-4.1.0.jar'.
[ +9 ms] > Premature end of Content-Length delimited message body (expected: 9,546,513; received: 4,456,416)
[ +2 ms] > Could not download kotlin-compiler-embeddable-1.3.50.jar
(org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.50)
[ +11 ms] > Could not get resource
'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.3.50/kotlin-compiler-embeddable-1.3.50.jar'.
[ +4 ms] > Premature end of Content-Length delimited message body (expected: 36,615,572; received: 4,456,416)
[ +1 ms] > Could not download fastutil-7.2.0.jar (it.unimi.dsi:fastutil:7.2.0)
[ +2 ms] > Could not get resource 'https://jcenter.bintray.com/it/unimi/dsi/fastutil/7.2.0/fastutil-7.2.0.jar'.
[ +5 ms] > Premature end of Content-Length delimited message body (expected: 17,309,408; received: 6,553,552)
[ +2 ms] * Try:
[ +2 ms] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run
with --scan to get full insights.
[ +3 ms] * Get more help at https://help.gradle.org
[ +1 ms] BUILD FAILED in 7m 33s
[ +627 ms] Running Gradle task 'assembleDebug'... (completed in 455.5s)
[ +10 ms] Exception: Gradle task assembleDebug failed with exit code 1
[ +4 ms] "flutter run" took 461,160ms.
[ +14 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:644:9)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)
<asynchronous suspension>
#3 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1009:27)
<asynchronous suspension>
#4 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#5 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#6 CommandRunner.runCommand (package:args/command_runner.dart:197:13)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)
<asynchronous suspension>
#8 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#9 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#10 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)
<asynchronous suspension>
#11 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
<asynchronous suspension>
#12 run.<anonymous closure> (package:flutter_tools/runner.dart:62:12)
<asynchronous suspension>
#13 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#14 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#15 runInContext (package:flutter_tools/src/context_runner.dart:73:10)
<asynchronous suspension>
#16 main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>
[ +260 ms] ensureAnalyticsSent: 252ms
[ +3 ms] Running shutdown hooks
[ ] Shutdown hook priority 4
[ +14 ms] Shutdown hooks complete
[ +1 ms] exiting with code 1
Folks,
I am re-building an already built flutter application upon changing of the laptop. However I have strangely observed that the dependencies that we mention in the pubspec, not all of them are getting compiled. Those ones which has native dependencies and eventually have android code base in the dependencies fail to compile. I am cluless how this is happening and where should i look forward to get this going. The only error I get is as below. The contentious dependencies were share and connectivity
warning: [options] source value 7 is obsolete and will be removed in a future release
[ +5 ms] warning: [options] target value 7 is obsolete and will be removed in a future release
[ +1 ms] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[ +1 ms] error: warnings found and -Werror specified
[ +190 ms] FAILURE: Build failed with an exception.
[ ] * What went wrong:
[ ] Execution failed for task ':share:compileDebugJavaWithJavac'.
[ +97 ms] > Compilation failed; see the compiler error output for details.
[ ] * Try:
[ ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full
insights.
[ +3 ms] * Get more help at https://help.gradle.org
[ +1 ms] BUILD FAILED in 1m 41s
[ +1 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[ +1 ms] Use '--warning-mode all' to show the individual deprecation warnings.
[ +5 ms] See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
[ ] 410 actionable tasks: 4 executed, 406 up-to-date
[ +794 ms] Running Gradle task 'assembleDebug'... (completed in 103.9s)
[ +9 ms] Exception: Gradle task assembleDebug failed with exit code 1
[ +4 ms] "flutter run" took 1,08,191ms.
[ +9 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:607:7)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:977:18)
<asynchronous suspension>
#3 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:836:33)
<asynchronous suspension>
#4 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart)
#5 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
#6 _rootRun (dart:async/zone.dart:1190:13)
#7 _CustomZone.run (dart:async/zone.dart:1093:19)
#8 _runZoned (dart:async/zone.dart:1630:10)
#9 runZoned (dart:async/zone.dart:1550:10)
#10 AppContext.run (package:flutter_tools/src/base/context.dart:149:18)
#11 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:825:20)
#12 CommandRunner.runCommand (package:args/command_runner.dart:197:27)
#13 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:335:21)
#14 _rootRunUnary (dart:async/zone.dart:1198:47)
#15 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#16 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#17 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#18 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#19 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#20 Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
#21 _rootRun (dart:async/zone.dart:1190:13)
#22 _CustomZone.run (dart:async/zone.dart:1093:19)
#23 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#24 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#25 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#26 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#27 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#28 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
[ +6 ms] ensureAnalyticsSent: 3ms
[ +3 ms] Running shutdown hooks
[ ] Shutdown hook priority 4
[ +12 ms] Shutdown hooks complete
[ +1 ms] exiting with code 1
I am using flutter 1.22.6 stable
dart 2.10.5
Gradle 6.5
I have tried it out with 1.22.3 and also with 1.20.4, still this is not taking me anywhere. All that it ends up is not compiling the dependencies having android code in it. gradlew assembleDebug --info and likes of it has resulted in me understanding that the java symbols are not created which eventually are not found by the compilation script, hence it is generating error.
things ive done so far:
run with --no-sound-null-safety and --verbose
find dependencies that complain and check for updates, then update to latest in pubspec
one dependency complained about android min sdk version in gradle.build, so i updated accordingly
now i can build to my test machine and work out the runtime bugs!
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Flutter