android - Compile error building project with multiple flavors and Play Services -
when trying build play services enabled project multiple flavors, compile errors. think might related package names not matching, not sure. have hints doing wrong?
i using newer gradle plugin allows (per gh issue)
i seeing error when try build multiple flavors:
error:(115, 50) error: cannot find symbol variable global_tracker
i double checked package names match expectation, wonder if still not correct.
my build.gradle looks this:
productflavors { app1 { applicationid "com.examplea.app" manifestplaceholders = [domain:"examplea"] } imore { applicationid "com.exampleb.app" manifestplaceholders = [domain:"exampleb"] } crackberry { applicationid "com.examplec.app" manifestplaceholders = [domain:"examplec"] }
an example of 1 of google-services.json files (which located @ main/src/examplea) is:
{ "project_info": { "project_id": "", "project_number": "", "name": "" }, "client": [ { "client_info": { "mobilesdk_app_id": "1:10908349452:android:bb075abfhadshfjd", "client_id": "android:com.examplea.app", "client_type": 1, "android_client_info": { "package_name": "com.examplea.app" } }, "oauth_client": [], "api_key": [], "services": { "analytics_service": { "status": 1 }, "cloud_messaging_service": { "status": 1, "apns_config": [] }, "appinvite_service": { "status": 1, "other_platform_oauth_client": [] }, "google_signin_service": { "status": 1 }, "ads_service": { "status": 1 } } } ] }
i figured out issue, flavors didn't have google analytics config info, apparently plugin wasn't generating config files variant.
i double checked each of flavor's google-services.json files, , realized of them had analytics info (like this):
"analytics_service": { "status": 2, "analytics_property": { "tracking_id": "ua-10xxxxx6-1" } },
while others had (which incorrect):
"analytics_service": { "status": 1 }
i made sure both consistent (and had analytics config info), , resolved build issues.
Comments
Post a Comment