今天早上收到一个包,解压缩后要在Android Studio里头打开,发现了下图的报错:
整体project架构如下图
BluetoothLightDemo\build.gradle 内容如下:
整体project架构如下图
BluetoothLightDemo\build.gradle 内容如下:
apply plugin: "com.android.application" android { compileSdkVersion "Google Inc.:Google APIs:23" buildToolsVersion "23.0.3" defaultConfig { applicationId "com.telink.bluetooth.light" minSdkVersion 18 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } productFlavors { } } repositories { flatDir { dirs "libs" } } dependencies { //compile(name: "libTelinkLight", ext: "aar") compile "com.android.support:support-v4:23.1.1" compile project(":BluetoothLightLib") //compile project(":BluetoothStorageLib") }
BluetoothLightLib\build.gradle 内容如下:
apply plugin: "com.android.library" android { compileSdkVersion "Google Inc.:Google APIs:23" buildToolsVersion "23.0.3" defaultConfig { minSdkVersion 18 targetSdkVersion 23 versionCode 1 versionName "1.9" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } productFlavors { } } dependencies { compile "com.android.support:support-v13:23.1.1" }
搜了一下,还是无解。
有高手知道应该怎么解决呢?
解决方案
10
更新 sdk
10
Demo改为.
apply plugin: “com.android.application”
lib 不需要修改
apply plugin: “com.android.application”
lib 不需要修改