plugins { id 'com.android.application' } android { namespace 'com.xhai.iot' compileSdk 34 defaultConfig { applicationId "com.xhai.iot" minSdk 23 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 } } // 解决涂鸦SDK中 assets/res 合并冲突 packagingOptions { // 涂鸦SDK so 库冲突处理 pickFirst 'lib/*/libc++_shared.so' pickFirst 'lib/*/libyuv.so' pickFirst 'lib/*/libopenh264.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'] } } 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' // 涂鸦 SDK 依赖(来自 SDK 包 dependencies.txt) implementation 'com.alibaba:fastjson:1.1.67.android' implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.14.9' implementation('com.thingclips.smart:thingsmart:6.11.1') { // 排除幽灵 SNAPSHOT 组件(编译期注解,运行时不需要) exclude group: 'com.thingclips.smart', module: 'thingsmart-modularCampAnno' // 注意:不能排除 thingsmart-asynclib! // 6.11.1 的 ThingHomeListCache 运行时需要 com.thingclips.smart.asynclib.schedulers.ThreadEnv // 排除会导致点击"我的设备"时 NoClassDefFoundError 闪退 } // 注意:涂鸦 panel SDK (thingsmart-panel:6.11.1) 在公开 Maven 仓库不可用, // 需从涂鸦开发者平台私有仓库下载后本地集成。 // 当前通过反射调用 gotoPanelActivity,SDK 可用时自动生效,无需改代码。 // compileOnly 'com.thingclips.smart:thingsmart-panel:6.11.1' // 待私有仓库集成后启用 // 涂鸦扩展 SDK(提供配网/激活能力 ThingActivatorCoreKit) // 排除编译期注解 SNAPSHOT 组件(运行时不需要) implementation('com.thingclips.smart:thingsmart-expansion-sdk:6.11.1') { exclude group: 'com.thingclips.android.module', module: 'thingmodule-annotation' exclude group: 'com.thingclips.smart', module: 'thingsmart-modularCampAnno' } // 多Dex implementation 'androidx.multidex:multidex:2.0.1' }