Error inflating class android.support.v7.widget.ActionBarContainer


Android studio 编译出来的messaging apk运行总是crash;


而我用eclipse编译出来就没有问题,花费我3个小时才解决。


个人觉得Android studio 导入jar要比eclipse难以掌握,出现jar包错误总是很难排查。


这次的错误提示如下:

{CSDN:CODE:
10-29 16:49:47.410 11531 11531 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #27: Binary XML file line #27: Error inflating class android.support.v7.widget.ActionBarContainer


10-29 16:49:47.410 11531 11531 E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:539)


10-29 16:49:47.410 11531 11531 E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:423)


10-29 16:49:47.410 11531 11531 E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:374)


10-29 16:49:47.410 11531 11531 E AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:403)


10-29 16:49:47.410 11531 11531 E AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:320)


10-29 16:49:47.410 11531 11531 E AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:281)


10-29 16:49:47.410 11531 11531 E AndroidRuntime: at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143)


10-29 16:49:47.410 11531 11531 E AndroidRuntime: at com.android.messaging.ui.conversationlist.ConversationListActivity.onCreate(ConversationListActivity.java:43)


10-29 16:49:47.410 11531 11531 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6324)


10-29 16:49:47.410 11531 11531 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)


10-29 16:49:47.410 11531 11531 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2407)


10-29 16:49:47.410 11531 11531 E AndroidRuntime: ... 9 more}


而我的gradle.builde配置如下:

dependencies {

compile 'com.android.support:multidex:1.0.0'
compile files('libs/android-common-framesequence.jar')
compile files('libs/android-common.jar')
compile files('libs/android-support-v7-palette.jar')
compile files('libs/com.android.vcard.jar')
compile files('libs/guava.jar')
compile files('libs/org.apache.http.legacy.jar')
compile files('libs/libphonenumber.jar')
compile files('libs/telephony-common.jar')
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:recyclerview-v7:+'

compile project(':frameworks.opt.photoviewer')
}
 
  
更改后
 
  
dependencies {

    compile 'com.android.support:multidex:1.0.0'
    compile files('libs/android-common-framesequence.jar')
    compile files('libs/android-common.jar')
    compile files('libs/android-support-v7-palette.jar')
    compile files('libs/com.android.vcard.jar')
    compile files('libs/guava.jar')
    compile files('libs/org.apache.http.legacy.jar')
    compile files('libs/libphonenumber.jar')
    compile files('libs/telephony-common.jar')
    //compile 'com.android.support:appcompat-v7:+'
    //compile 'com.android.support:recyclerview-v7:+'
    compile project(':frameworks.support.v7.appcompat')
    compile project(':frameworks.support.v7.recyclerview')

    compile project(':frameworks.opt.photoviewer')
}
 
  

你可能感兴趣的:(error)