大家,
我使用cordova 3.6.3创建了一个带有单个元素的HelloWorld应用程序,我在两个Android版本中构建并测试它:KitKat和L.
在KitKat上运行时效果很好,但在L上单击select元素时会崩溃。
有没有人遇到类似的事情?有人知道如何解决这个问题吗?
更多信息:
我修改的唯一文件是index.html:
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Hello World</title>
</head>
<body>
<div style="width: 100%">
<select>
<option value="1">Opt1</option>
<option value="2">Opt2</option>
<option value="3">Opt3</option>
</select>
</div>
<div class="app">
<h1>Apache Cordova</h1>
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
</body>
</html>
崩溃时的logcat输出:
D/InputTransport( 629): Input channel constructed: name='2106db22 br.eti.earruda.app.helloworld/br.eti.earruda.app.helloworld.HelloCordova (server)', fd=407
D/InputTransport( 629): Input channel constructed: name='2106db22 br.eti.earruda.app.helloworld/br.eti.earruda.app.helloworld.HelloCordova (client)', fd=409
D/WindowManager( 629): new Window{2106db22 u0 br.eti.earruda.app.helloworld/br.eti.earruda.app.helloworld.HelloCordova} type 2 flags = 25296898 user 0
D/InputDispatcher( 629): Focus left window: Window{323f5035 u0 br.eti.earruda.app.helloworld/br.eti.earruda.app.helloworld.HelloCordova}
D/InputDispatcher( 629): Focus entered window: Window{2106db22 u0 br.eti.earruda.app.helloworld/br.eti.earruda.app.helloworld.HelloCordova}
D/InputTransport( 629): Input channel destroyed: name='2106db22 br.eti.earruda.app.helloworld/br.eti.earruda.app.helloworld.HelloCordova (client)', fd=409
E/SMD ( 303): DCD ON
D/InputTransport(13007): Input channel constructed: name='2106db22 br.eti.earruda.app.helloworld/br.eti.earruda.app.helloworld.HelloCordova (client)', fd=151
W/ResourceType(13007): No package identifier when getting value for resource number 0x00000000
D/AndroidRuntime(13007): Shutting down VM
E/AndroidRuntime(13007): FATAL EXCEPTION: main
E/AndroidRuntime(13007): Process: br.eti.earruda.app.helloworld, PID: 13007
E/AndroidRuntime(13007): android.content.res.Resources$NotFoundException: Resource ID #0x0
E/AndroidRuntime(13007): at android.content.res.Resources.getValue(Resources.java:2103)
E/AndroidRuntime(13007): at android.content.res.Resources.loadXmlResourceParser(Resources.java:3494)
E/AndroidRuntime(13007): at android.content.res.Resources.getLayout(Resources.java:1919)
E/AndroidRuntime(13007): at android.view.LayoutInflater.inflate(LayoutInflater.java:413)
E/AndroidRuntime(13007): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:371)
E/AndroidRuntime(13007): at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
E/AndroidRuntime(13007): at com.android.org.chromium.content.browser.input.SelectPopupAdapter.getView(SelectPopupAdapter.java:56)
E/AndroidRuntime(13007): at android.widget.AbsListView.obtainView(AbsListView.java:2520)
E/AndroidRuntime(13007): at android.widget.ListView.measureHeightOfChildren(ListView.java:1275)
E/AndroidRuntime(13007): at android.widget.ListView.onMeasure(ListView.java:1187)
E/AndroidRuntime(13007): at android.view.View.measure(View.java:18084)
E/AndroidRuntime(13007): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5714)
E/AndroidRuntime(13007): at android.widget.FrameLayout.onMeasure(FrameLayout.java:410)
E/AndroidRuntime(13007): at android.view.View.measure(View.java:18084)
E/AndroidRuntime(13007): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5714)
E/AndroidRuntime(13007): at android.widget.FrameLayout.onMeasure(FrameLayout.java:410)
E/AndroidRuntime(13007): at android.view.View.measure(View.java:18084)
E/AndroidRuntime(13007): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5714)
E/AndroidRuntime(13007): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
E/AndroidRuntime(13007): at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
E/AndroidRuntime(13007): at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
E/AndroidRuntime(13007): at android.view.View.measure(View.java:18084)
E/AndroidRuntime(13007): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5714)
E/AndroidRuntime(13007): at android.widget.FrameLayout.onMeasure(FrameLayout.java:410)
E/AndroidRuntime(13007): at android.view.View.measure(View.java:18084)
E/AndroidRuntime(13007): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5714)
E/AndroidRuntime(13007): at android.widget.FrameLayout.onMeasure(FrameLayout.java:410)
E/AndroidRuntime(13007): at android.view.View.measure(View.java:18084)
E/AndroidRuntime(13007): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5714)
E/AndroidRuntime(13007): at android.widget.FrameLayout.onMeasure(FrameLayout.java:410)
E/AndroidRuntime(13007): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2792)
E/AndroidRuntime(13007): at android.view.View.measure(View.java:18084)
E/AndroidRuntime(13007): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2193)
E/AndroidRuntime(13007): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1236)
E/AndroidRuntime(13007): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1493)
E/AndroidRuntime(13007): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1146)
E/AndroidRuntime(13007): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6465)
E/AndroidRuntime(13007): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
E/AndroidRuntime(13007): at android.view.Choreographer.doCallbacks(Choreographer.java:590)
E/AndroidRuntime(13007): at android.view.Choreographer.doFrame(Choreographer.java:560)
E/AndroidRuntime(13007): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
E/AndroidRuntime(13007): at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(13007): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(13007): at android.os.Looper.loop(Looper.java:145)
E/AndroidRuntime(13007): at android.app.ActivityThread.main(ActivityThread.java:5529)
E/AndroidRuntime(13007): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(13007): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(13007): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1379)
E/AndroidRuntime(13007): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1174)
W/ActivityManager( 629): Force finishing activity br.eti.earruda.app.helloworld/.HelloCordova
提前致谢。