gpt4 book ai didi

java - 在我的应用程序中膨胀类 android.support.design.widget.NavigationView 时出错

转载 作者:行者123 更新时间:2023-12-03 06:25:36 25 4
gpt4 key购买 nike

我的应用程序有问题。
这是我得到的错误:

 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.justfashion/com.justfashion.ActivityMainWallet}: android.view.InflateException: Binary XML file line #91: Error inflating class android.support.design.widget.NavigationView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2521)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2595)
at android.app.ActivityThread.access$800(ActivityThread.java:178)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5631)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
Caused by: android.view.InflateException: Binary XML file line #91: Error inflating class android.support.design.widget.NavigationView
at android.view.LayoutInflater.createView(LayoutInflater.java:633)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.material.BaseActivity.setContentView(BaseActivity.java:46)
at com.justfashion.ActivityMainWallet.onCreate(ActivityMainWallet.java:121)
at android.app.Activity.performCreate(Activity.java:6092)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2468)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2595) 
at android.app.ActivityThread.access$800(ActivityThread.java:178) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470) 
at android.os.Handler.dispatchMessage(Handler.java:111) 
at android.os.Looper.loop(Looper.java:194) 
at android.app.ActivityThread.main(ActivityThread.java:5631) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754) 
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
at com.material.BaseActivity.setContentView(BaseActivity.java:46) 
at com.justfashion.ActivityMainWallet.onCreate(ActivityMainWallet.java:121) 
at android.app.Activity.performCreate(Activity.java:6092) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2468) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2595) 
at android.app.ActivityThread.access$800(ActivityThread.java:178) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470) 
at android.os.Handler.dispatchMessage(Handler.java:111) 
at android.os.Looper.loop(Looper.java:194) 
at android.app.ActivityThread.main(ActivityThread.java:5631) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754) 
Caused by: java.lang.NoClassDefFoundError: android.support.design.internal.NavigationMenuPresenter
at android.support.design.widget.NavigationView.<init>(NavigationView.java:80)
at android.support.design.widget.NavigationView.<init>(NavigationView.java:92)
at java.lang.reflect.Constructor.newInstance(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:288) 
at android.view.LayoutInflater.createView(LayoutInflater.java:607) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
at com.material.BaseActivity.setContentView(BaseActivity.java:46) 
at com.justfashion.ActivityMainWallet.onCreate(ActivityMainWallet.java:121) 
at android.app.Activity.performCreate(Activity.java:6092) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2468) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2595) 
at android.app.ActivityThread.access$800(ActivityThread.java:178) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470) 
at android.os.Handler.dispatchMessage(Handler.java:111) 
at android.os.Looper.loop(Looper.java:194) 
at android.app.ActivityThread.main(ActivityThread.java:5631) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372)

这是我的 XML 的 #91+ 行:
  <android.support.design.widget.NavigationView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/navigation_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:background="@color/md_white_1000"
app:headerLayout="@layout/nav_drawer_header"
app:menu="@menu/menu_drawer"
app:itemTextAppearance="@style/TextAppearance.AppCompat.Menu"
android:clipToPadding="false">

这是一个基本 Activity 错误行:
    @Override
public void setContentView(int layoutResID) {
super.setContentView(layoutResID);
initAppCompatDesign();
initViews();

和activitymainwallet一样:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
AppLovinSdk.initializeSdk(this);
HeyzapAds.start(getString(R.string.heyzap_app_id), this);
//HeyzapAds.startTestActivity(this);

当我更改我的 gradle (app) 文件中的某些内容时出现问题:
    apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
useLibrary 'org.apache.http.legacy'





defaultConfig {
applicationId "com.justfashion"
minSdkVersion 15
targetSdkVersion 23
multiDexEnabled true
}

signingConfigs {
release {
storeFile file("najnowszy.jks")
storePassword "asiunia"
keyAlias "production"
keyPassword "asiunia"
}
}

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

dependencies {

//compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.google.code.gson:gson:2.3.1'
compile files('libs/NativeXMonetizationSDK_v5.4.12.jar')
compile files('libs/Parse-1.3.8.jar')
compile files('libs/SuperRewards-3.1b.jar')
compile files('libs/TrialpayAndroidSdk.jar')
compile files('libs/acra-4.5.0.jar')
compile files('libs/adcolony.jar')
compile files('libs/adscendmedia1.0.1.jar')
compile files('libs/dagger-1.2.2.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/mediationsdk-6.2.2.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/personasdk1.1.jar')
compile files('libs/picasso-2.4.0.jar')
compile files('libs/tapjoyconnectlibrary.jar')
compile files('libs/vungle-publisher-adaptive-id-3.3.1.jar')
compile files('libs/chartboost.jar')
compile files('libs/applovin-sdk-6.1.5.jar')
compile files('libs/heyzap.jar')
compile files('libs/revmob.jar')
compile project(':appGradeLib')
//compile project(':sensiblefacebooksdk')
compile project(':googleplayserviceslib')
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:23.0.0'
compile files('libs/AdxmiCustomizedSdk_v1.2.0_2015-11-13.jar')
compile files('libs/AdxmiSdk_v5.4.0_2015-11-12.jar')
compile project(':unity-ads')
compile 'com.android.support:appcompat-v7:23.0.0'
compile files('libs/org.apache.http.legacy.jar')
}

我不记得我换了哪一个。 gradle有问题吗?非常感谢你!

最佳答案

尝试:
compile 'com.android.support:support-v4:23.0.0'
需要 v4 支持库来实例化 NavigationView这是抽屉导航 UI 的一部分。

关于java - 在我的应用程序中膨胀类 android.support.design.widget.NavigationView 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40285037/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com