Android应用程序崩溃为Android版本4或更小 - React-Native

时间:2017-03-08 07:20:35

标签: react-native react-native-android react-native-fbsdk

我有一个本机应用程序,其中我在第一页使用社交登录按钮,即在登录页面,当我在Android版本大于4运行我的应用程序然后它工作如果Android版本小于4该应用程序崩溃在我已经在操作系统版本:4.4.2,4.4.4和4.3中进行了测试,它在所有上述版本中都崩溃了。我的登录按钮代码段。

<LoginButton
                        publishPermissions={["publish_actions"]}
                        onLoginFinished={
                        (error, result) => {
                        if (error) {
                        alert("login failed");
                        alert("login has error: " + result.error);
                        } else if (result.isCancelled) {
                        alert("login is cancelled.");
                        } else {
                         alert("success");
                         }
                         )
                        }
                        }
                        }
/>

我正在使用的版本“react-native-fbsdk”:“^ 0.4.0”, react-native --version
react-native-cli:2.0.1 反应原生:0.38.0

来自crashlytics的崩溃报告

#0. Crashed: main: 0 0 0x0000000000000000
       at android.content.res.Resources.loadDrawable(Resources.java:2136)
       at android.content.res.Resources.getDrawable(Resources.java:715)
       at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:374)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:200)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
       at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:723)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
       at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:100)
       at com.facebook.login.widget.LoginButton.configureButton(LoginButton.java:586)
       at com.facebook.FacebookButtonBase.<init>(FacebookButtonBase.java:64)
       at com.facebook.login.widget.LoginButton.<init>(LoginButton.java:195)
       at com.facebook.reactnative.androidsdk.RCTLoginButton.<init>(RCTLoginButton.java:50)
       at com.facebook.reactnative.androidsdk.FBLoginButtonManager.createViewInstance(FBLoginButtonManager.java:56)
       at com.facebook.reactnative.androidsdk.FBLoginButtonManager.createViewInstance(FBLoginButtonManager.java:37)
       at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:46)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:218)
       at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:148)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:890)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:863)
       at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
       at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:131)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:759)
       at android.view.Choreographer.doCallbacks(Choreographer.java:574)
       at android.view.Choreographer.doFrame(Choreographer.java:543)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
       at android.os.Handler.handleCallback(Handler.java:733)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5118)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
       at dalvik.system.NativeStart.main(NativeStart.java)

--

Fatal Exception: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020052
       at android.content.res.Resources.loadDrawable(Resources.java:2136)
       at android.content.res.Resources.getDrawable(Resources.java:715)
       at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:374)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:200)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
       at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:723)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
       at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:100)
       at com.facebook.login.widget.LoginButton.configureButton(LoginButton.java:586)
       at com.facebook.FacebookButtonBase.<init>(FacebookButtonBase.java:64)
       at com.facebook.login.widget.LoginButton.<init>(LoginButton.java:195)
       at com.facebook.reactnative.androidsdk.RCTLoginButton.<init>(RCTLoginButton.java:50)
       at com.facebook.reactnative.androidsdk.FBLoginButtonManager.createViewInstance(FBLoginButtonManager.java:56)
       at com.facebook.reactnative.androidsdk.FBLoginButtonManager.createViewInstance(FBLoginButtonManager.java:37)
       at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:46)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:218)
       at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:148)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:890)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:863)
       at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
       at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:131)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:759)
       at android.view.Choreographer.doCallbacks(Choreographer.java:574)
       at android.view.Choreographer.doFrame(Choreographer.java:543)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
       at android.os.Handler.handleCallback(Handler.java:733)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5118)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
       at dalvik.system.NativeStart.main(NativeStart.java)
Caused by org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector
       at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:933)
       at android.graphics.drawable.Drawable.createFromXml(Drawable.java:877)
       at android.content.res.Resources.loadDrawable(Resources.java:2132)
       at android.content.res.Resources.getDrawable(Resources.java:715)
       at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:374)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:200)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
       at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:723)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
       at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:100)
       at com.facebook.login.widget.LoginButton.configureButton(LoginButton.java:586)
       at com.facebook.FacebookButtonBase.<init>(FacebookButtonBase.java:64)
       at com.facebook.login.widget.LoginButton.<init>(LoginButton.java:195)
       at com.facebook.reactnative.androidsdk.RCTLoginButton.<init>(RCTLoginButton.java:50)
       at com.facebook.reactnative.androidsdk.FBLoginButtonManager.createViewInstance(FBLoginButtonManager.java:56)
       at com.facebook.reactnative.androidsdk.FBLoginButtonManager.createViewInstance(FBLoginButtonManager.java:37)
       at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:46)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:218)
       at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:148)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:890)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:863)
       at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
       at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:131)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:759)
       at android.view.Choreographer.doCallbacks(Choreographer.java:574)
       at android.view.Choreographer.doFrame(Choreographer.java:543)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
       at android.os.Handler.handleCallback(Handler.java:733)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5118)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
       at dalvik.system.NativeStart.main(NativeStart.java)

1 个答案:

答案 0 :(得分:0)

React Native支持的最低版本是Android 4.1(API 16)

此处有更多详情 - https://github.com/facebook/react-native#react-native---