Comments (10)
If you're inheriting your base style from Theme.MaterialComponets to use the new MaterialComponets theme, you need to add the new design library as a dependency to your project.
from colorful.
But I am using this version now: com.android.support:design:28.0.0-alpha1
, because "28.0.0-alpha1" version contains "material-components"
from colorful.
The material componets theme is still very much alpha as far as Google is concerned, hence the -alpha denotation. I recommend matching the version you're using to the version Colorful is using.
implementation 'com.google.android.material:material:1.0.0-alpha1'
the sdk28 version is depending on P. I don't plan on moving Colorful's SDK to android P until P's apis are marked stable in DP3.
from colorful.
Hi, I tested it, when I change the support library version from 28.0.0-alpha1 to 27.1.1 and add the com.google.android.material:material:1.0.0-alpha1
library, I get an error
The error is fixed when I change the support library version from 27.1.1 to 28-alpha1 and delete the com.google.android.material:material:1.0.0-alpha1
library
from colorful.
When I remove exclude group: 'com.google.android.material', module: 'material'
, the above error will appear again.
api (com.github.garretyoder:Colorful:2.3.2) {
exclude group: 'com.google.android.material', module: 'material'
}
If do not delete, the above error will not appear, but the log will have the following error.
AppCompatDelegate: Failed to instantiate custom view inflater android.support.design.theme.MaterialComponentsViewInflater . Falling back to default.
java.lang.ClassNotFoundException: Invalid name: android.support.design.theme.MaterialComponentsViewInflater
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at android.support.v7.app.AppCompatDelegateImplV9.createView(AppCompatDelegateImplV9.java:1014)
at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1092)
from colorful.
@garretyoder com.android.support
and com.google.android.material
cannot add at the same time.
I created a new project and tried to add it at the same time, occurred an error.
from colorful.
If I remove material
library, and change support library version to 28.0.0-alpha1
, now can run, but the log shows the following error
- If I change
Theme.MaterialComponents.Light.DarkActionBar
toTheme.AppCompat.Light.DarkActionBar
, the error will not appear. - Or if I click on refactoring to AndroidX after, Now I use
Theme.MaterialComponents.Light.DarkActionBar
, the error log will also not appear.
So fixing the following error I found two solutions:
- Support library use
28.0.0-alpha1
version , and useBaseTheme.THEME_APPCOMPAT
instead ofBaseTheme.THEME_MATERIAL
orBaseTheme.THEME_MATERIAL_COMPONETS
- Refactoring to AndroidX, and use
BaseTheme.THEME_APPCOMPAT
orBaseTheme.THEME_MATERIAL
orBaseTheme.THEME_MATERIAL_COMPONETS
Error log
AppCompatDelegate: Failed to instantiate custom view inflater android.support.design.theme.MaterialComponentsViewInflater . Falling back to default.
java.lang.ClassNotFoundException: Invalid name: android.support.design.theme.MaterialComponentsViewInflater
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at android.support.v7.app.AppCompatDelegateImplV9.createView(AppCompatDelegateImplV9.java:1014)
at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1092)
from colorful.
Refactoring to AndroidX will fix the issue. I might make another release later today to try to enable some build magic to support the material components theme without relying on the new design library until it's marked stable.
from colorful.
I have rolled back support for the material componets theme in the stable branch as it's bound to androidx and android P, and will cause build errors when not targeting android P. If you wish to use the material componets theme, I've moved it into a new branch called 'android-p' where you can build it.
from colorful.
Ok.
from colorful.
Related Issues (20)
- Not working after app restart HOT 4
- Use custom color HOT 11
- Load style resources by name not by id
- "setPrimaryColor" and "setCustomThemeOverride" conflict HOT 12
- Disabled override how to use light/dark theme HOT 1
- Request to add color HOT 3
- Colorful has error when start strict mode HOT 7
- Some times primaryColor and accentColor are not used HOT 9
- Sample code for use without kotlin HOT 5
- Compile issue error: style attribute 'attr/colorSecondary HOT 11
- Does Proguard settings mentioned in document?
- Material Drawer Theming Support? HOT 3
- Migrate to AndroidX HOT 1
- How to customize views in theme?
- ThemeEditor public apply method needs null check
- startSupportActionMode works not propertly with Colorful
- ERROR: Failed to resolve: com.github.garretyoder:Colorful:2.3.4 HOT 1
- R styles not found on API 19 HOT 1
- App bar and Statusbar need same color HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colorful.