0

I am dealing with android version 28, Firebase 16.

implementing a bottomNavView returns me the following error:

The following classes could not be instantiated: 
- android.support.design.widget.BottomNavigationView

I tried changing my AppTheme style to Base.Theme but doesnt resolve it.

My gradle app:

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'

//add library
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-database:16.0.6'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'



}

apply plugin: 'com.google.gms.google-services'

My style.xml file

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

My gradle project:

classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
Shaii
  • 13
  • 1
  • 7
  • Try https://stackoverflow.com/questions/26575815/the-following-classes-could-not-be-instantiated-android-support-v7-widget-too. – ADM Jan 30 '19 at 11:11
  • post complete error log. – karan Jan 30 '19 at 11:17
  • @KaranMer are you sure I can post it here? because the log is so long and nothing highlighted in red. – Shaii Jan 30 '19 at 11:34
  • you can edit your question with the log output – karan Jan 30 '19 at 11:34
  • @KaranMer Thank you so much guys. I just updated the android studio and it worked ! but I have no idea why it was an error. I guess a bug? – Shaii Jan 30 '19 at 12:09

1 Answers1

0

Try to go to "File -> Invalidate caches / Restart" and invalidate and restart, maybe this helps.

  • Thank you so much. I just updated the android studio and it worked ! but I have no idea why it was an error. I guess a bug? – Shaii Jan 30 '19 at 12:09
  • I don't know for sure what is the problem, the ide stores some cache and maybe something goes wrong there. I always clean the project, invalidate the cache and sync the project with the gradle if i have any error where the ide can't understand or find a class (if i know it's not my mistake). – Alexander Cavalheiro Becker Jan 30 '19 at 12:21