11-06 15:28:51.968: E/AndroidRuntime(3270): java.lang.NoSuchMethodError: android.support.v4.view.ViewGroupCompat.getLayoutMode
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.support.v7.widget.GridLayout$Bounds.include(GridLayout.java:2155)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.support.v7.widget.GridLayout$Axis.computeGroupBounds(GridLayout.java:1203)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.support.v7.widget.GridLayout$Axis.getGroupBounds(GridLayout.java:1212)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.support.v7.widget.GridLayout$Axis.createLinks(GridLayout.java:1221)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.support.v7.widget.GridLayout$Axis.getForwardLinks(GridLayout.java:1247)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.support.v7.widget.GridLayout$Axis.createArcs(GridLayout.java:1372)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.support.v7.widget.GridLayout$Axis.getArcs(GridLayout.java:1405)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.support.v7.widget.GridLayout$Axis.computeLocations(GridLayout.java:1576)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.support.v7.widget.GridLayout$Axis.getLocations(GridLayout.java:1597)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.support.v7.widget.GridLayout$Axis.getMeasure(GridLayout.java:1618)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.support.v7.widget.GridLayout$Axis.getMeasure(GridLayout.java:1626)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.support.v7.widget.GridLayout.onMeasure(GridLayout.java:957)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.View.measure(View.java:8313)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.HorizontalScrollView.measureChildWithMargins(HorizontalScrollView.java:1279)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.HorizontalScrollView.onMeasure(HorizontalScrollView.java:361)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.View.measure(View.java:8313)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1274)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.ScrollView.onMeasure(ScrollView.java:354)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.View.measure(View.java:8313)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1017)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.LinearLayout.measureVertical(LinearLayout.java:386)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.View.measure(View.java:8313)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.View.measure(View.java:8313)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.LinearLayout.measureVertical(LinearLayout.java:531)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.View.measure(View.java:8313)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.View.measure(View.java:8313)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.View.measure(View.java:8313)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.ViewRoot.performTraversals(ViewRoot.java:845)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.view.ViewRoot.handleMessage(ViewRoot.java:1865)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.os.Handler.dispatchMessage(Handler.java:99)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.os.Looper.loop(Looper.java:130)
11-06 15:28:51.968: E/AndroidRuntime(3270): at android.app.ActivityThread.main(ActivityThread.java:3687)
11-06 15:28:51.968: E/AndroidRuntime(3270): at java.lang.reflect.Method.invokeNative(Native Method)
11-06 15:28:51.968: E/AndroidRuntime(3270): at java.lang.reflect.Method.invoke(Method.java:507)
11-06 15:28:51.968: E/AndroidRuntime(3270): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
11-06 15:28:51.968: E/AndroidRuntime(3270): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
11-06 15:28:51.968: E/AndroidRuntime(3270): at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:8)
确保使用的是v4支持库的正确(最新)版本。直到我意识到我使用旧的v4支持库(缺少此API 18方法)之前,我遇到了同样的错误。
答案 1 :(得分:4)
这意味着您在API 18以下的设备中调用方法getLayoutMode,并且该方法仅在API 18中添加,如您在documentation中所见。