我正在尝试将EBS付款集成到Android中,所以我有一个EBS SDK。
没有导入EBS SDK的情况下,我的应用程序可以正常运行,但是当我将SDK导入到项目中时,我的应用程序从第一个Activity中崩溃。我不知道这是什么问题..请帮助我..谢谢

Logcat详细信息

01-31 16:00:48.322 8929-8929/com.mypakagename E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                 Process: com.mypakagename, PID: 8929
                                                                                 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mypakagename/com.mypakagename.LoginRegisterActivity}: android.view.InflateException: Binary XML file line #10: Error inflating class android.support.v7.widget.CardView
                                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
                                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
                                                                                     at android.app.ActivityThread.access$800(ActivityThread.java:151)
                                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
                                                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                     at android.os.Looper.loop(Looper.java:135)
                                                                                     at android.app.ActivityThread.main(ActivityThread.java:5254)
                                                                                     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:903)
                                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
                                                                                  Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class android.support.v7.widget.CardView
                                                                                     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.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
                                                                                     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
                                                                                     at com.mypakagename.LoginRegisterActivity.onCreate(LoginRegisterActivity.java:40)
                                                                                     at android.app.Activity.performCreate(Activity.java:5990)
                                                                                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
                                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
                                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
                                                                                     at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                                                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                     at android.os.Looper.loop(Looper.java:135) 
                                                                                     at android.app.ActivityThread.main(ActivityThread.java:5254) 
                                                                                     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:903) 
                                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 
                                                                                  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.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) 
                                                                                     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
                                                                                     at com.mypakagename.LoginRegisterActivity.onCreate(LoginRegisterActivity.java:40) 
                                                                                     at android.app.Activity.performCreate(Activity.java:5990) 
                                                                                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 
                                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) 
                                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
                                                                                     at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                                                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                     at android.os.Looper.loop(Looper.java:135) 
                                                                                     at android.app.ActivityThread.main(ActivityThread.java:5254) 
                                                                                     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:903) 
                                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 
                                                                                  Caused by: java.lang.RuntimeException: Failed to resolve attribute at index 0
                                                                                     at android.content.res.TypedArray.getDrawable(TypedArray.java:747)
                                                                                     at android.widget.FrameLayout.<init>(FrameLayout.java:123)
                                                                                     at android.widget.FrameLayout.<init>(FrameLayout.java:111)
                                                                                     at android.widget.FrameLayout.<init>(FrameLayout.java:107)
                                                                                     at android.support.v7.widget.CardView.<init>(CardView.java:115)
                                                                                     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.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) 
                                                                                     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
                                                                                     at com.mypakagename.LoginRegisterActivity.onCreate(LoginRegisterActivity.java:40) 
                                                                                     at android.app.Activity.performCreate(Activity.java:5990) 
                                                                                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 
                                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) 
                                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
                                                                                     at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                                                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                     at android.os.Looper.loop(Looper.java:135) 
                                                                                     at android.app.ActivityThread.main(ActivityThread.java:5254) 
                                                                                     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:903) 
                                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)




build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.mypakagename"
        minSdkVersion 16
        targetSdkVersion 24
        versionCode 1
        versionName "1"
    }
    buildTypes {
        release {
            minifyEnabled false
            shrinkResources false
            zipAlignEnabled true
            debuggable false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'com.android.support:cardview-v7:24.2.1'
    compile 'com.android.support:recyclerview-v7:24.2.1'
    compile 'com.android.support:support-v4:24.2.1'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    compile 'com.facebook.android:facebook-android-sdk:4.0.0'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.android.gms:play-services-auth:10.0.1'
    compile project(path: ':payUMoneysdk')
    compile project(':EBS_LIVE')
}
apply plugin: 'com.google.gms.google-services'

最佳答案

i think you have same theme name in EBS library and your project library change name one of them will solve your issue.

关于android - EBS付款集成-Android,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41955387/

10-11 16:33