这里的错误:
无法实例化以下类 – androID.support.v7.Widget.AppCompatTextVIEw
java.lang.NullPointerExceptionat androID.content.res.Resources_Delegate.getValue(Resources_Delegate.java:788)at androID.content.res.Resources.getValue(Resources.java:1286)at androID.support.v4.content.res.ResourcesCompat.loadFont(ResourcesCompat.java:212)at androID.support.v4.content.res.ResourcesCompat.getFont(ResourcesCompat.java:206)at androID.support.v7.Widget.TintTypedArray.getFont(TintTypedArray.java:119)at androID.support.v7.Widget.AppCompatTextHelper.updateTypefaceAndStyle(AppCompatTextHelper.java:208)at androID.support.v7.Widget.AppCompatTextHelper.loadFromAttributes(AppCompatTextHelper.java:152)at androID.support.v7.Widget.AppCompatTextHelperV17.loadFromAttributes(AppCompatTextHelperV17.java:38)at androID.support.v7.Widget.AppCompatTextVIEw.<init>(AppCompatTextVIEw.java:81)at androID.support.v7.Widget.AppCompatTextVIEw.<init>(AppCompatTextVIEw.java:71)at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)at java.lang.reflect.Constructor.newInstance(Constructor.java:423)at org.jetbrains.androID.uiprevIEw.VIEwLoader.createNewInstance(VIEwLoader.java:475)at org.jetbrains.androID.uiprevIEw.VIEwLoader.loadClass(VIEwLoader.java:250)at org.jetbrains.androID.uiprevIEw.VIEwLoader.loadClass(VIEwLoader.java:213)at com.androID.tools.IDea.rendering.LayoutlibCallbackImpl.loadClass(LayoutlibCallbackImpl.java:193)at androID.vIEw.BrIDgeInflater.loadCustomVIEw(BrIDgeInflater.java:333)at androID.vIEw.BrIDgeInflater.onCreateVIEw(BrIDgeInflater.java:152)at androID.vIEw.LayoutInflater.onCreateVIEw(LayoutInflater.java:717)at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:785)at androID.vIEw.BrIDgeInflater.createVIEwFromTag(BrIDgeInflater.java:222)at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:727)at androID.vIEw.LayoutInflater.rInflate_Original(LayoutInflater.java:858)at androID.vIEw.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:834)at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:492)at com.androID.layoutlib.brIDge.bars.Custombar.<init>(Custombar.java:95)at com.androID.layoutlib.brIDge.bars.Statusbar.<init>(Statusbar.java:67)at com.androID.layoutlib.brIDge.impl.Layout.createStatusbar(Layout.java:224)at com.androID.layoutlib.brIDge.impl.Layout.<init>(Layout.java:146)at com.androID.layoutlib.brIDge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:301)at com.androID.layoutlib.brIDge.BrIDge.createSession(BrIDge.java:429)at com.androID.IDe.common.rendering.Layoutlibrary.createSession(Layoutlibrary.java:368)at com.androID.tools.IDea.rendering.RenderTask.compute(RenderTask.java:567)at com.androID.tools.IDea.rendering.RenderTask.compute(RenderTask.java:549)at com.intellij.openAPI.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:863)at com.androID.tools.IDea.rendering.RenderTask.createRenderSession(RenderTask.java:549)at com.androID.tools.IDea.rendering.RenderTask.lambda$inflate(RenderTask.java:680)at java.util.concurrent.FutureTask.run(FutureTask.java:266)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745)
我的朋友:
apply plugin: 'com.androID.application'androID { compileSdkVersion 26 buildToolsversion "26.0.1" defaultConfig { applicationID "com.al285790.time2cook" minSdkVersion 15 targetSdkVersion 26 multIDexEnabled true versionCode 1 versionname "1.0" testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner" } buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'),'proguard-rules.pro' } }}dependencIEs { compile filetree(dir: 'libs',include: ['*.jar']) androIDTestCompile('com.androID.support.test.espresso:espresso-core:2.2.2',{ exclude group: 'com.androID.support',module: 'support-annotations' }) compile 'com.androID.support:appcompat-v7:26.0.1' compile 'com.androID.support:palette-v7:26.0.1' compile 'com.androID.support:design:26.0.1' compile 'com.Google.firebase:firebase-database:11.0.2' compile 'com.Google.firebase:firebase-core:9.6.1' compile 'com.Google.firebase:firebase-storage:11.0.2' compile 'com.Google.firebase:firebase-auth:11.0.2' compile 'com.github.bumptech.glIDe:glIDe:3.7.0' compile 'com.firebaseui:firebase-ui-storage:1.2.0' compile 'com.androID.support.constraint:constraint-layout:1.0.2' compile('com.mikepenz:materialdrawer:5.9.5@aar') { transitive = true } testCompile 'junit:junit:4.12'}apply plugin: 'com.Google.gms.Google-services'
编辑:添加了一些我的xml代码
<?xml version="1.0" enCoding="utf-8"?><androID.support.design.Widget.CoordinatorLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:tools="http://schemas.androID.com/tools" xmlns:app="http://schemas.androID.com/apk/res-auto" androID:layout_wIDth="match_parent" androID:layout_height="match_parent"> <androID.support.design.Widget.AppbarLayout androID:ID="@+ID/appbar" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content"> <androID.support.v7.Widget.Toolbar androID:ID="@+ID/toolbar" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:layout_weight="1"></androID.support.v7.Widget.Toolbar> </androID.support.design.Widget.AppbarLayout> <androID.support.v4.Widget.nestedScrollVIEw androID:layout_wIDth="match_parent" androID:layout_height="match_parent" app:layout_behavior="androID.support.design.Widget.AppbarLayout$ScrollingVIEwBehavior"> <androID.support.v4.Widget.nestedScrollVIEw androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" app:layout_behavior="@string/appbar_scrolling_vIEw_behavior" tools:context="com.al285790.time2cook.recipeInfo.RecipeInfoActivity"> <linearLayout androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:orIEntation="vertical" androID:scrollbars="none"> <TextVIEw androID:ID="@+ID/recipenameText" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:textSize="24sp" androID:textStyle="bold" /> <ImageVIEw androID:ID="@+ID/photoRecipe" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:scaleType="fitCenter" app:srcCompat="@drawable/cho" /> <TextVIEw androID:ID="@+ID/textVIEw10" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:text="Dificulty" androID:textSize="24sp" androID:textStyle="bold" /> <linearLayout androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:orIEntation="horizontal"> <ratingbar androID:ID="@+ID/ratingbarDificulty" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:layout_gravity="center" androID:isIndicator="true" androID:numStars="5" androID:stepSize="1" /> <button androID:ID="@+ID/button8" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:onClick="givelike" androID:text="liKE!" /> </linearLayout> <TextVIEw androID:ID="@+ID/IngredIEnts" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:text="IngredIEnts" androID:textSize="24sp" androID:textStyle="bold" /> <androID.support.v7.Widget.RecyclerVIEw androID:ID="@+ID/superList" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" /> <TextVIEw androID:ID="@+ID/textVIEw9" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:text="Steps" androID:textSize="24sp" androID:textStyle="bold" /> <androID.support.v7.Widget.RecyclerVIEw androID:ID="@+ID/stepsList" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" /> </linearLayout> </androID.support.v4.Widget.nestedScrollVIEw> </androID.support.v4.Widget.nestedScrollVIEw></androID.support.design.Widget.CoordinatorLayout>解决方法 我也收到了这个错误,并尝试通过多次清理,重建和使缓存无效来修复它.
为我修复的是将res / values / styles.xml中的父主题更改为使用Base的父主题.
< style name =“Apptheme”parent =“Base.theme.AppCompat.light.DarkActionbar”>
根据答案here.
总结以上是内存溢出为你收集整理的无法使用android.support.v7.widget.AppCompatTextView实例化以下类全部内容,希望文章能够帮你解决无法使用android.support.v7.widget.AppCompatTextView实例化以下类所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)