今天在运行项目的时候AS报错,找了好久也没发现问题在哪【捂脸】。。。最后发现是多渠道打包的问题,我的多渠道是这样写的:
productFlavors {
Test {}
// '360'{}
// Xiaomi{}
// Yingyongbao{}
// Huawei{}
// Oppo{}
// Vivo{}
// Baidu{}
// Flyme{}
}
productFlavors中是不能直接已Test开头的,否则就报错:Cannot add task 'reportSourceSetTransformTest' as a task with that name already exists.
解决方法:把productFlavors中的Test改为其他的就行了。
productFlavors {
Develop{}//不能直接命名为Test 否则报错:Cannot add task 'reportSourceSetTransformTest' as a task with that name already exists
...
}