I have the issue with Huawei maps after introducing product flavours and issue is referenced to the fact that agconnect-services.json can't be located
E/HMSSDK_AGCUtils: Get client/cp_id failed: java.io.FileNotFoundException: agconnect-services.json
So everything was working fine until product flavours are introduced.
The configuration of product flavours are following:
flavorDimensions "provider"
productFlavors {
huawei {
dimension "provider"
}
google {
dimension "provider"
}
}
sourceSets {
huawei {
java {
srcDirs 'src/huawei/java'
}
res {
srcDirs 'src/huawei/res'
}
}
google {
java {
srcDirs 'src/google/java'
}
res {
srcDirs 'src/google/res'
}
}
}
if (getGradle().getStartParameter().getTaskRequests().toString().contains("Huawei"))
{
apply plugin: 'com.huawei.agconnect'
}
classpath 'com.huawei.agconnect:agcp:1.6.3.300'
So the package name keeps the same nothing is changing for flavour. I tried positioning .json file to app/src/huawei
but nothing helped.
I tried positioning .json file to app/src/huawei, app/src/debugHuawei, app/src/debugHuawei, app/, app/src/huaweiDebug, app/src/debug/huawei but didn't help.
Thanks in advance