Karl
Karl

Reputation: 11

How to run the Thingsboard mobile app flutter/dart source code in the first place?

Following the guide in their website, I came accross many problems trying to run the codes.

I followed the guide in this website to the step 5: run the app.

The first problem was

Execution failed for task ':gradle:compileGroovy'. BUG! exception in phase 'semantic analysis' in source unit 'D:\flutter\flutter\packages\flutter_tools\gradle\src\main\groovy\app_plugin_loader.groovy' Unsupported class file major version 65 .

I searched and found it might be due to incompatible versions between Java and gradle. I tried a lower version of Java (18) used by the flutter the match the Gradle version of the source code (7.5.1), by flutter config --jdk-dir='D:\jdk18'.

After that, there were more lines of output but these occurred:

/C:/Users/18042/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_slidable-3.1.1/lib/src/notifications_old.dart:88:23: Error: The method 'hashValues' isn't defined for the class 'SlidableRatioNotification'.

  • 'SlidableRatioNotification' is from 'package:flutter_slidable/src/notifications_old.dart' ('/C:/Users/18042/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_slidable-3.1.1/lib/src/notifications_old.dart'). Try correcting the name to the name of an existing method, or defining a method named 'hashValues'. int get hashCode => hashValues(tag, ratio); ^^^^^^^^^^ Target kernel_snapshot_program failed: Exception 2

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'. Process 'command 'D:\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1

2: Task failed with an exception.

What went wrong: java.lang.StackOverflowError (no error message)

Error: Gradle task assembleDebug failed with exit code 1

I also tried to raise the Gradle version from 7.5.1 to 8.5 but

FAILURE: Build failed with an exception.

Where: Build file 'D:\myCodes\ThingsBoardMobileProject\flutter_thingsboard_app\android\build.gradle' line: 13

What went wrong: A problem occurred evaluating root project 'android'. A problem occurred configuring project ':app'. Could not create task ':app:copyFlutterAssetsDebug'. Could not create task ':app:mergeDebugAssets'. Cannot use @TaskAction annotation on method IncrementalTask.taskAction$gradle_core() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.

BUILD FAILED in 27s Error: Gradle task assembleDebug failed with exit code 1

The Java version of my Android Studio is 21. I am not sure whether it matters. I would like to know how you run the codes in the first place. Thank you

Upvotes: 1

Views: 166

Answers (0)

Related Questions