首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >项目“:nordic_nrf_mesh”评估中出现的一个问题

项目“:nordic_nrf_mesh”评估中出现的一个问题
EN

Stack Overflow用户
提问于 2022-10-05 09:02:42
回答 1查看 45关注 0票数 -1

我有一个问题,当我在颤振上运行应用程序时,它在终端上给出了这个错误。

我想做的是扫描最近的蓝牙设备,从该设备获取uuid和节点,然后控制它--例如:控制灯

代码语言:javascript
复制
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

这是我要扫描的功能

代码语言:javascript
复制
 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

代码语言:javascript
复制
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文件添加到我的颤栗中。

请帮帮我

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-14 09:14:35

更新:我在github上打开了一个问题,得到了awswer,现在它对我来说很好。

https://github.com/OZEO-DOOZ/nrf_mesh_plugin/issues/249

对任何人来说,这个错误都应该被欺骗吗?

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73958108

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档