我在Android Studio中使用類路徑'com.android.tools.build:gradle-experimental:0.4.0'和gradle 2.8創建了一個工作應用程序。構建:gradle-experimental:0.4.0包括可穿戴應用程序
正如谷歌文檔提到的,包括您與您的APK穿戴式應用,你需要穿應用程序申報到手機應用程序gradle這個文件的依賴是這樣的:
dependencies {
//other dependencies
//wearApp project(':Wear')
wearApp project(path: ':Wear', configuration: 'google')
}
,但我得到的錯誤在哪裏我包括我的錯誤消息磨損應用行:
Gradle sync failed: Gradle DSL method not found: 'wearApp()'
這是因爲實驗gradle這個插件是不承認這個命令(這是標準的gradle產出)...
問題是,包含Wear應用程序和gradle-experimental的命令是什麼:0.4.0插件?
**更新
添加這也搖籃:
android.buildTypes {
debug {
debuggable = true
embedMicroApp = true // this should enable the WEAR command, idk...
}
release {
minifyEnabled = false
proguardFiles.add(file('proguard-rules.txt'))
}
}
在你的build.gradle中google是'productFlavor'嗎? – String
是的。我已經檢查過了。 Wear是適用於可穿戴設備的模塊/應用程序的名稱,構建風格是Google。 –
我甚至在我的gradle * pleace chekc中添加了更新後的答案 –