plugins { id 'com.android.application' id 'com.google.dagger.hilt.android' } android { namespace 'com.xhai.iot' compileSdk 34 defaultConfig { applicationId "com.xhai.iot" minSdk 24 targetSdk 34 versionCode 1 versionName "1.0.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" // 多包名支持(涂鸦SDK需要) multiDexEnabled true // 配置 ABI(涂鸦SDK依赖较多,按需裁剪) ndk { abiFilters 'armeabi-v7a', 'arm64-v8a' } } // Java 8 支持 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } // 签名配置(必须与涂鸦平台登记的 keystore SHA256 一致) signingConfigs { release { storeFile file("xhai_iot.jks") storePassword "xhai123456" keyAlias "xhai" keyPassword "xhai123456" } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } debug { minifyEnabled false signingConfig signingConfigs.release } } // 全局排除:涂鸦摄像头/RTSP 模块(面板 RN 容器会注册这些包,但 // thingsmart-mediaplayer:4.5.0-rc.1 缺 MediaPlayerListener 类导致 // create_react_context 崩溃。我们不需要摄像头功能,直接排除。) configurations.all { exclude group: 'com.thingclips.smart.rnplugin', module: 'trctrtspmediamanager' exclude group: 'com.thingclips.smart.rnplugin', module: 'trctrtspmediaplayermanager' exclude group: 'com.thingclips.smart.rnplugin', module: 'trctcameramanager' exclude group: 'com.thingclips.smart.rnplugin', module: 'trctcameraviewmanager' exclude group: 'com.thingclips.smart.rnplugin', module: 'trctcameraaudiomanager' exclude group: 'com.thingclips.smart.rnplugin', module: 'trctcameramessagemanager' exclude group: 'com.thingclips.smart.rnplugin', module: 'trctcameramessagemediaplayermanager' exclude group: 'com.thingclips.smart.rnplugin', module: 'trctcameraplayer' exclude group: 'com.thingclips.smart.rnplugin', module: 'trctcameratimelineviewmanager' } // 解决涂鸦SDK中 assets/res 合并冲突 packagingOptions { // 涂鸦SDK so 库冲突处理 pickFirst 'lib/*/libc++_shared.so' pickFirst 'lib/*/libyuv.so' pickFirst 'lib/*/libopenh264.so' pickFirst 'lib/*/libgnustl_shared.so' pickFirst 'lib/*/libv8android.so' pickFirst 'lib/*/libv8wrapper.so' pickFirst 'lib/*/liblog.so' pickFirst 'lib/*/libbytehook.so' pickFirst 'lib/*/libxdl.so' pickFirst 'lib/*/libsqlcipher.so' resources { excludes += ['META-INF/DEPENDENCIES', 'META-INF/LICENSE', 'META-INF/LICENSE.txt', 'META-INF/license.txt', 'META-INF/NOTICE', 'META-INF/NOTICE.txt', 'META-INF/notice.txt', 'META-INF/ASL2.0', 'META-INF/INDEX.LIST', 'META-INF/versions/**'] } } lint { abortOnError false } } dependencies { // 本地 AAR 依赖 implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar']) // AndroidX implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.11.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.recyclerview:recyclerview:1.3.2' // 网络请求(对接 iotsaas 后端) implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:converter-gson:2.9.0' implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' // Gson implementation 'com.google.code.gson:gson:2.10.1' // 图片加载(用于加载涂鸦设备图标) implementation 'com.github.bumptech.glide:glide:4.16.0' // 二维码扫码(中控屏会员自助绑定 P4):自带 CaptureActivity,无需声明额外权限/Activity implementation 'com.journeyapps:zxing-android-embedded:4.3.0' // 涂鸦 SDK 依赖(升级至 7.8.0 + UI BizBundle) implementation 'com.alibaba:fastjson:1.1.67.android' implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.14.9' // 涂鸦主 SDK 7.8.0 implementation('com.thingclips.smart:thingsmart:7.8.0') { // 排除幽灵 SNAPSHOT 组件(编译期注解,运行时不需要) exclude group: 'com.thingclips.smart', module: 'thingsmart-modularCampAnno' } // 涂鸦 UI BizBundle(设备控制面板 + 家庭服务) // BOM 统一管理各 BizBundle 版本 api enforcedPlatform('com.thingclips.smart:thingsmart-BizBundlesBom:7.8.14') // 设备控制业务包(RN 容器,原生面板核心) implementation 'com.thingclips.smart:thingsmart-bizbundle-panel' // 基础扩展能力 implementation('com.thingclips.smart:thingsmart-bizbundle-basekit') { exclude group: 'com.thingclips.smart', module: 'thingplugin-annotation' } // 涂鸦业务扩展能力 implementation 'com.thingclips.smart:thingsmart-bizbundle-bizkit' // 设备控制相关能力 implementation 'com.thingclips.smart:thingsmart-bizbundle-devicekit' // 家庭服务(面板必需) implementation 'com.thingclips.smart:thingsmart-bizbundle-family' // 小程序业务包(提供 AbsMiniAppConfigInjectService 注入服务, // 面板 RN 容器依赖 MiniAppConfig,缺失会导致 ThingRCTSmartPanelActivity.onCreate NPE 崩溃) implementation 'com.thingclips.smart:thingsmart-bizbundle-miniapp' // 涂鸦扩展 SDK(提供配网/激活能力) implementation('com.thingclips.smart:thingsmart-expansion-sdk:7.8.0') { exclude group: 'com.thingclips.android.module', module: 'thingmodule-annotation' exclude group: 'com.thingclips.smart', module: 'thingsmart-modularCampAnno' } // 涂鸦 Matter 配网能力(设备委任 API:CommissioningParameters / MatterActivatorCallback 等) // 主 thingsmart aar 不含这些类,需显式引入 matterlib-api(编译期类型)与 matterlib(运行期实现) implementation 'com.thingclips.smart:thingsmart-matterlib-api:7.8.0' implementation 'com.thingclips.smart:thingsmart-matterlib:7.8.0' // Hilt(BizBundle 依赖注入) implementation 'com.google.dagger:hilt-android:2.58' annotationProcessor 'com.google.dagger:hilt-android-compiler:2.58' // 多Dex implementation 'androidx.multidex:multidex:2.0.1' }