[
https://issues.apache.org/jira/browse/CB-800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13277257#comment-13277257
]
Joe Bowser edited comment on CB-800 at 5/16/12 11:22 PM:
---------------------------------------------------------
OK, I do have a test case.
Run the test project. You will notice that under the current implementation, we
have a null pointer exception. I need to figure out what would cause this null
pointer exception:
int id = getResources().getIdentifier("cordova", "xml",
this.mCtx.getActivity().getPackageName());
Here's the extremely long stack trace:
{code}
java.lang.RuntimeException: Unable to start activity
ComponentInfo{org.apache.cordova.test/org.apache.cordova.test.CordovaWebViewTestActivity}:
android.view.InflateException: Binary XML file line #25: Error inflating class
org.apache.cordova.CordovaWebView
E/AndroidRuntime(22755): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
E/AndroidRuntime(22755): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
E/AndroidRuntime(22755): at
android.app.ActivityThread.access$600(ActivityThread.java:123)
E/AndroidRuntime(22755): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
E/AndroidRuntime(22755): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(22755): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(22755): at
android.app.ActivityThread.main(ActivityThread.java:4424)
E/AndroidRuntime(22755): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime(22755): at
java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(22755): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime(22755): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime(22755): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(22755): Caused by: android.view.InflateException: Binary XML
file line #25: Error inflating class org.apache.cordova.CordovaWebView
E/AndroidRuntime(22755): at
android.view.LayoutInflater.createView(LayoutInflater.java:606)
E/AndroidRuntime(22755): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
E/AndroidRuntime(22755): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
E/AndroidRuntime(22755): at
android.view.LayoutInflater.inflate(LayoutInflater.java:489)
E/AndroidRuntime(22755): at
android.view.LayoutInflater.inflate(LayoutInflater.java:396)
E/AndroidRuntime(22755): at
android.view.LayoutInflater.inflate(LayoutInflater.java:352)
E/AndroidRuntime(22755): at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
E/AndroidRuntime(22755): at
android.app.Activity.setContentView(Activity.java:1835)
E/AndroidRuntime(22755): at
org.apache.cordova.test.CordovaWebViewTestActivity.onCreate(CordovaWebViewTestActivity.java:37)
E/AndroidRuntime(22755): at
android.app.Activity.performCreate(Activity.java:4465)
E/AndroidRuntime(22755): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
E/AndroidRuntime(22755): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
E/AndroidRuntime(22755): ... 11 more
E/AndroidRuntime(22755): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime(22755): at
java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime(22755): at
java.lang.reflect.Constructor.newInstance(Constructor.java:417)
E/AndroidRuntime(22755): at
android.view.LayoutInflater.createView(LayoutInflater.java:586)
E/AndroidRuntime(22755): ... 22 more
E/AndroidRuntime(22755): Caused by: java.lang.NullPointerException
E/AndroidRuntime(22755): at
org.apache.cordova.CordovaWebView.loadConfiguration(CordovaWebView.java:589)
E/AndroidRuntime(22755): at
org.apache.cordova.CordovaWebView.<init>(CordovaWebView.java:110)
E/AndroidRuntime(22755): ... 25 more
{code}
For some reason it works under the example app that I put in GitHub earlier,
but it doesn't work in the test.
was (Author: bowserj):
OK, I do have a test case.
Run the test project. You will notice that under the current implementation, we
have a null pointer exception. I need to figure out what would cause this null
pointer exception:
int id = getResources().getIdentifier("cordova", "xml",
this.mCtx.getActivity().getPackageName());
Here's the extremely long stack trace:
{code}
java.lang.RuntimeException: Unable to start activity
ComponentInfo{org.apache.cordova.test/org.apache.cordova.test.CordovaWebViewTestActivity}:
android.view.InflateException: Binary XML file line #25: Error inflating class
org.apache.cordova.CordovaWebView
E/AndroidRuntime(22755): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
E/AndroidRuntime(22755): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
E/AndroidRuntime(22755): at
android.app.ActivityThread.access$600(ActivityThread.java:123)
E/AndroidRuntime(22755): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
E/AndroidRuntime(22755): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(22755): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(22755): at
android.app.ActivityThread.main(ActivityThread.java:4424)
E/AndroidRuntime(22755): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime(22755): at
java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(22755): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime(22755): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime(22755): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(22755): Caused by: android.view.InflateException: Binary XML
file line #25: Error inflating class org.apache.cordova.CordovaWebView
E/AndroidRuntime(22755): at
android.view.LayoutInflater.createView(LayoutInflater.java:606)
E/AndroidRuntime(22755): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
E/AndroidRuntime(22755): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
E/AndroidRuntime(22755): at
android.view.LayoutInflater.inflate(LayoutInflater.java:489)
E/AndroidRuntime(22755): at
android.view.LayoutInflater.inflate(LayoutInflater.java:396)
E/AndroidRuntime(22755): at
android.view.LayoutInflater.inflate(LayoutInflater.java:352)
E/AndroidRuntime(22755): at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
E/AndroidRuntime(22755): at
android.app.Activity.setContentView(Activity.java:1835)
E/AndroidRuntime(22755): at
org.apache.cordova.test.CordovaWebViewTestActivity.onCreate(CordovaWebViewTestActivity.java:37)
E/AndroidRuntime(22755): at
android.app.Activity.performCreate(Activity.java:4465)
E/AndroidRuntime(22755): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
E/AndroidRuntime(22755): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
E/AndroidRuntime(22755): ... 11 more
E/AndroidRuntime(22755): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime(22755): at
java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime(22755): at
java.lang.reflect.Constructor.newInstance(Constructor.java:417)
E/AndroidRuntime(22755): at
android.view.LayoutInflater.createView(LayoutInflater.java:586)
E/AndroidRuntime(22755): ... 22 more
E/AndroidRuntime(22755): Caused by: java.lang.NullPointerException
E/AndroidRuntime(22755): at
org.apache.cordova.CordovaWebView.loadConfiguration(CordovaWebView.java:589)
E/AndroidRuntime(22755): at
org.apache.cordova.CordovaWebView.<init>(CordovaWebView.java:110)
E/AndroidRuntime(22755): ... 25 more
{/code}
For some reason it works under the example app that I put in GitHub earlier,
but it doesn't work in the test.
> Fix preferences for the CordovaWebView
> --------------------------------------
>
> Key: CB-800
> URL: https://issues.apache.org/jira/browse/CB-800
> Project: Apache Cordova
> Issue Type: Sub-task
> Components: Android
> Affects Versions: 1.8.0
> Reporter: Joe Bowser
> Assignee: Joe Bowser
> Fix For: 1.8.0
>
>
> The CordovaWebView used to handle preferences and whitelisting, however with
> the recent re-write of Preferences, we lost that capability. We need it back
> before we can release CordovaWebView.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira