在从'com.android.tools.build:gradle:2.3.3'切换到3.0.1之后,我遇到了运行时错误:clearInterval(interval);
。没有其他更改。
如果我把旧的
"java.lang.UnsupportedOperationException: Can't convert value at index 1 to dimension: type=0x1d"
一切正常。奇怪!
完整的堆栈跟踪:
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
问题xml文件:
android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class com.mobidevelop.spl.widget.SplitPaneLayout
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class com.mobidevelop.spl.widget.SplitPaneLayout
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at com.ashomok.imagetotext.ocr_result.tab_fragments.TextFragment.onCreateView(TextFragment.java:66)
at android.app.Fragment.performCreateView(Fragment.java:2611)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1276)
at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2415)
at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2194)
at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2148)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2049)
at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:798)
at android.support.v13.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:151)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1236)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1084)
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1614)
at android.view.View.measure(View.java:22002)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
at android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:714)
at android.support.design.widget.HeaderScrollingViewBehavior.onMeasureChild(HeaderScrollingViewBehavior.java:91)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onMeasureChild(AppBarLayout.java:1361)
at android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:784)
at android.view.View.measure(View.java:22002)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
at android.view.View.measure(View.java:22002)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:806)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:685)
at android.view.View.measure(View.java:22002)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at android.view.View.measure(View.java:22002)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:806)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:685)
at android.view.View.measure(View.java:22002)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at com.android.internal.policy.DecorView.onMeasure(DecorView.java:721)
at android.view.View.measure(View.java:22002)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2410)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1498)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1751)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1386)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6733)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:723)
at android.view.Choreographer.doFrame(Choreographer.java:658)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 1 to dimension: type=0x1d
at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:730)
at com.mobidevelop.spl.widget.SplitPaneLayout.extractAttributes(SplitPaneLayout.java:86)
at com.mobidevelop.spl.widget.SplitPaneLayout.<init>(SplitPaneLayout.java:74)
... 63 more
Test running failed: Instrumentation run failed due to 'Process crashed.'
反编译源代码:
<?xml version="1.0" encoding="utf-8"?>
<com.mobidevelop.spl.widget.SplitPaneLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:spl="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
spl:orientation="vertical"
spl:splitterBackground="@color/colorAccent"
spl:splitterPosition="33%"
spl:splitterSize="12dp"
android:id="@+id/split_pane_layout">
<include layout="@layout/split_pane_content" />
</com.mobidevelop.spl.widget.SplitPaneLayout>
dimens.xml包含所有数据且没有错误。有什么想法吗?
答案 0 :(得分:1)
现在已经很晚了,但这就是我如何让它发挥作用。
Gradle问题是较新的gradle版本会以某种方式混淆并找不到维度值。所以我最终分配了我自己的版本,克隆了它,更新了Gradle,编译器,修复了问题...并将其作为this guide之后的本地项目的库添加。
如果你这样做,应该修复,或者你可以克隆我的fixed version。如果出现错误,请尝试在库的gradle文件中注释掉 chisq.test(observed, p=estimated)
行。