During migration from Android Studio 0.9 to 1.0, I had to change the clause
buildTypes {
release {
- runProguard true
+ minifyEnabled true
}
as recommended here.
My app is running a standard Sync Adapter
public class SyncAdptr extends AbstractThreadedSyncAdapter {
private static Context mCtx;
public SyncAdptr(Context ctx, boolean autoInit) {
super(ctx, autoInit); mCtx = ctx;
}
static void syncStart(Account gooAcct, String authority) {
...
ContentResolver.setSyncAutomatically(gooAcct, authority, true);
...
}
...
}
as a service:
public class SyncService extends Service {
private static final Object sSyncAdapterLock = new Object();
private static SyncAdptr sAndyScanSyncAdapter = null;
@Override
public void onCreate() {
synchronized (sSyncAdapterLock) {
if (sAndyScanSyncAdapter == null) {
sAndyScanSyncAdapter = new SyncAdptr(getApplicationContext(), true);
}
}
}
@Override
public IBinder onBind(Intent intent) {
return sAndyScanSyncAdapter.getSyncAdapterBinder();
}
}
It is a pretty standard boilerplate code that always worked.
By adding the 'minifyEnabled' clause as stated above, the synchronization stopped working with no error indication. I have tested it by removing the clause; the APK's size remained about the same as my debug version and sync was working. As soon as I plugged the 'minifyEnabled' in, the APK shrunk significantly (as expected) but the sync adapter quit again.
Any opinions? Suggestions?
UPDATE (3 months later):
I have progressed to 'Android Studio 1.1.0 AI-135.1740770 02/18/2015', but still no difference. The 'minifyEnabled = true' has an effect that the service never starts. Anybody knows where to find 'ProgGuard configuration dump' as suggesed in the comments?