我编译了源码里的SampleBrowserPlugin,然后安装,插件可以在浏览器中运行
但是当我用JS调用时,浏览器直接Crash,即使调用不存在的方法也Crash
查看Callstack Crash在libwebcore.so
在代码里面打log,发现pluginHasProperty pluginHasMethod这些方法还未调用

解决方案 »

  1.   

    在Google Code发现也有人遇到过类似的问题
    - Problem description
    Segfault
    - Steps to reproduce the problem
    1. Download eclair source code
    2. make
    3. make SampleBrowserPlugin
    4. adb install out/target/product/generic/data/app/SampleBrowserPlugin.apk
    5. use the file test.html as following to test the plugin:
    <html>
    <head>
    <title>Test Plugin</title>
    </head>
    <body>
    <object type="application/x-testbrowserplugin" height=50 width=250 
    id="testPlugin">
        <param name="DrawingModel" value="Bitmap" />
        <param name="PluginType" value="Animation" />
    </object>
    <script language="Javascript">
    var obj = document.getElementById("testPlugin");
    document.write(obj.testfile);
    </script>
    </body>
    </html>
    http://code.google.com/p/android/issues/detail?id=6172
      

  2.   

    Hi, I have installed the plugin in emulator. But when i call the 
    functions of plugin from javascript, there is always a segment fault 
    error. 
    Why? 只有人提问  没人回答
      

  3.   

    eclair2.1的source code编出来的apk  运行在eclair2.1的emulator上
    应该不存在兼容性问题吧。。~
      

  4.   

    哎  资料太少  国外网站有被墙
    已经决定绕过Browser Plugin了
    结贴
      

  5.   

    我来回答你们的问题,这个sample plugin只能跑在Froyo(Android 2.2)机器上,我测试是成功的。需要用Froyo的ToolChaim来编译。Eclair版本手机,运行时会crash。