Lutaaya Huzaifah Lutaaya Huzaifah - 2 months ago 140
Android Question

Please configure your build for VectorDrawableCompat while using Firebase UI

I'm facing this error:

Caused by: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.


But this error came after adding the Firebase UI dependency:

compile 'com.firebaseui:firebase-ui:0.4.3'


I have seen this and this post, but nothing seems to work for me, even I have no Vector Drawables in my project, but I'm wondering why it's giving me this error message. Below is my logcat:

10-03 04:58:29.699 1256-1270/system_process E/WindowManager: Starting window AppWindowToken{b13967c8 token=Token{b1990890 ActivityRecord{b1778df8 u0 pixsor.app.huzykamz.pixoradmin/.MainActivity t8}}} timed out
10-03 05:03:21.954 1256-1326/system_process A/ActivityManager: Service ServiceRecord{b199ac38 u0 pixsor.app.huzykamz.pixoradmin/com.google.android.gms.measurement.AppMeasurementService} in process ProcessRecord{b12b8bd0 21551:pixsor.app.huzykamz.pixoradmin/u0a62} not same as in map: null
10-03 05:06:42.187 25698-25698/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-03 05:06:42.187 25698-25698/? E/android.os.Debug: failed to load memtrack module: -2
10-03 05:06:50.057 25715-25715/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-03 05:06:50.057 25715-25715/? E/android.os.Debug: failed to load memtrack module: -2
10-03 05:06:51.257 25725-25725/pixsor.app.huzykamz.pixoradmin E/FirebaseCrash: Failed to initialize crash reporting
com.google.firebase.crash.internal.zzg$zza: com.google.android.gms.internal.zzsb$zza: No acceptable module found. Local version is 0 and remote version is 0.
at com.google.firebase.crash.internal.zzg.zzbq(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.<init>(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.google.firebase.FirebaseApp.zza(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.zzek(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1591)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:4774)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4369)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4309)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: com.google.android.gms.internal.zzsb$zza: No acceptable module found. Local version is 0 and remote version is 0.
at com.google.android.gms.internal.zzsb.zza(Unknown Source)
at com.google.firebase.crash.internal.zzg.zzbq(Unknown Source) 
at com.google.firebase.crash.FirebaseCrash.<init>(Unknown Source) 
at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.google.firebase.FirebaseApp.zza(Unknown Source) 
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
at com.google.firebase.FirebaseApp.zzek(Unknown Source) 
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1591) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1562) 
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
at android.app.ActivityThread.installProvider(ActivityThread.java:4774) 
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4369) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4309) 
at android.app.ActivityThread.access$1500(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5001) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
at dalvik.system.NativeStart.main(Native Method) 
10-03 05:06:52.017 25725-25725/pixsor.app.huzykamz.pixoradmin E/AndroidRuntime: FATAL EXCEPTION: main
Process: pixsor.app.huzykamz.pixoradmin, PID: 25725
java.lang.RuntimeException: Unable to start activity ComponentInfo{pixsor.app.huzykamz.pixoradmin/pixsor.app.huzykamz.pixoradmin.MainActivity}: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:692)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:186)
at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:77)
at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:83)
at android.support.v7.app.AppCompatDelegateImplV7.<init>(AppCompatDelegateImplV7.java:146)
at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:28)
at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:41)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:193)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:173)
at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:511)
at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
at pixsor.app.huzykamz.pixoradmin.MainActivity.onCreate(MainActivity.java:33)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5001) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
at dalvik.system.NativeStart.main(Native Method) 
10-03 05:07:00.247 1256-1270/system_process E/WindowManager: Starting window AppWindowToken{b1464090 token=Token{b1324070 ActivityRecord{b12a1f80 u0 pixsor.app.huzykamz.pixoradmin/.MainActivity t9}}} timed out
10-03 05:11:52.681 1256-1439/system_process A/ActivityManager: Service ServiceRecord{b199c5d0 u0 pixsor.app.huzykamz.pixoradmin/com.google.android.gms.measurement.AppMeasurementService} in process ProcessRecord{b11b7fc0 25725:pixsor.app.huzykamz.pixoradmin/u0a62} not same as in map: null


This is my gradle .

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
// vectorDrawables.useSupportLibrary = true
applicationId "pixsor.app.huzykamz.pixoradmin"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"

// multiDexEnabled true
}
buildTypes {
release {
// minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}




dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.firebase:firebase-crash:9.4.0'
compile 'com.google.firebase:firebase-auth:9.4.0'
compile 'com.google.firebase:firebase-storage:9.4.0'
compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.android.support:recyclerview-v7:23.0.+'
compile 'com.firebaseui:firebase-ui:0.4.3'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
}
apply plugin: 'com.google.gms.google-services'


The error shows on this line in onCreate Method;

super.onCreate(savedInstanceState);


This is my onCreate Method.

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
mDatabase = FirebaseDatabase.getInstance().getReference().child("Blog");
mDatabase.keepSynced(true);

mRecyclerview =(RecyclerView)findViewById(R.id.mRecyclerview);
mRecyclerview.hasFixedSize();
mRecyclerview.setLayoutManager(new LinearLayoutManager(this));


FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(MainActivity.this, PostActivity.class));
}
});
}


Why is this happening , and how can i fix it .

Answer

Try adding this in your gradle , but check your gradle version .

for Gradle2.0+ plugin

android {
  defaultConfig {
    vectorDrawables.useSupportLibrary = true
    ...
  }
}

for Gradle plugin before 2.0

android {
  defaultConfig {
    generatedDensities = []
    ...  
  }

  aaptOptions {
   additionalParameters "--no-version-vectors"
  }
}
Comments