我有一个问题,当我在颤振上运行应用程序时,它在终端上给出了这个错误。
我想做的是扫描最近的蓝牙设备,从该设备获取uuid和节点,然后控制它--例如:控制灯
FAILURE: Build failed with an exception.
Where:
Build file 'C:%user%\flutter.pub-cache\hosted\pub.dartlang.org\nordic_nrf_mesh-0.12.0\android\build.gradle' line: 44
What went wrong:
A problem occurred evaluating project ':nordic_nrf_mesh'.
Project with path ':mesh' could not be found in project ':nordic_nrf_mesh'.
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.第44行来自我的C:%user%\flutter.pub-cache\hosted\pub.dartlang.org\nordic_nrf_mesh-0.12.0\android\build.gradle中的nordic_nrf_mesh库
我不知道怎么修
我想要做的就是使用nordicNrfMesh.scanForUnprovisionedNodes
这是我要扫描的功能
Future<void> _scanUnprovisionned() async {
_serviceData.clear();
setState(() {
_devices.clear();
});
widget.nordicNrfMesh.scanForUnprovisionedNodes().listen((event) {});
_scanSubscription =
widget.nordicNrfMesh.scanForUnprovisionedNodes().listen((device) async {
if (_devices.every((d) => d.id != device.id)) {
final deviceUuid = Uuid.parse(
getDeviceUuid(device.serviceData[meshProvisioningUuid]!.toList()));
debugPrint('deviceUuid: $deviceUuid');
debugPrint('deviceName: ${device.name}');
debugPrint('deviceDeviceId: ${device.id}');
debugPrint('deviceManfac: ${device.manufacturerData.toString()}');
debugPrint('deviceRssi: ${device.rssi.toString()}');
_serviceData[device.id] = deviceUuid;
_devices.add(device);
setState(() {});
}
});
setState(() {
isScanning = true;
});
return Future.delayed(const Duration(seconds: 10)).then((_) => _stopScan());
}这是我的build.gralde
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 32
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.dienquang.flutter_nrfmesh_app"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 23
targetSdkVersion 32
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}我还将Android Mesh-Library文件添加到我的颤栗中。
请帮帮我
发布于 2022-10-14 09:14:35
更新:我在github上打开了一个问题,得到了awswer,现在它对我来说很好。
https://github.com/OZEO-DOOZ/nrf_mesh_plugin/issues/249
对任何人来说,这个错误都应该被欺骗吗?
https://stackoverflow.com/questions/73958108
复制相似问题