Xamarin Android 12 - Initial Crash - xamarin.android

I just worked on my Xamarin Forms App and released the next version for iOS.
Then I went back to the Android version, assuming it would work perfectly well (as android has always been doing for me).
Now this is what happens:
[QXPerf] Couldn't load BLASTBufferQueue Class
[QXPerf] Couldn't find UndequeuedBufferCount functions
[Looper] PerfMonitor longMsg : seq=4 plan=10:19:09.074 late=5792ms wall=2177ms running=0ms h=android.app.ActivityThread$H w=159 procState=-1
[Looper] PerfMonitor looperActivity : package=de.myapp.app/crc643873299c977c4ba1.MainActivity time=2177ms latency=5792ms running=0ms procState=-1 historyMsgCount=1 (msgIndex=1 wall=5790ms seq=3 late=1ms h=android.app.ActivityThread$H w=110)
[Looper] PerfMonitor looperActivity : package=de.myapp.app/crc643873299c977c4ba1.MainActivity time=0ms latency=7970ms running=0ms procState=-1 historyMsgCount=2 (msgIndex=1 wall=5790ms seq=3 late=1ms h=android.app.ActivityThread$H w=110) (msgIndex=2 wall=2177ms seq=4 late=5792ms h=android.app.ActivityThread$H w=159)
**System.NullReferenceException:** 'Object reference not set to an instance of an object.'
[MIUIScout App] Enter APP_SCOUT_WARNING State
[MIUIScout App] Event:APP_SCOUT_WARNING Thread:main backtrace:
[MIUIScout App] at mono.java.lang.RunnableImplementor.n_run(Native Method)
[MIUIScout App] at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
[MIUIScout App] at android.os.Handler.handleCallback(Handler.java:938)
[MIUIScout App] at android.os.Handler.dispatchMessage(Handler.java:99)
[MIUIScout App] at android.os.Looper.loopOnce(Looper.java:210)
[MIUIScout App] at android.os.Looper.loop(Looper.java:299)
[MIUIScout App] at android.app.ActivityThread.main(ActivityThread.java:8085)
[MIUIScout App] at java.lang.reflect.Method.invoke(Native Method)
[MIUIScout App] at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
[MIUIScout App] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)
[MIUIScout App] Enter APP_SCOUT_HANG state
[MIUIScout App] Event:APP_SCOUT_HANG Thread:main backtrace:
[MIUIScout App] at mono.java.lang.RunnableImplementor.n_run(Native Method)
[MIUIScout App] at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
[MIUIScout App] at android.os.Handler.handleCallback(Handler.java:938)
[MIUIScout App] at android.os.Handler.dispatchMessage(Handler.java:99)
[MIUIScout App] at android.os.Looper.loopOnce(Looper.java:210)
[MIUIScout App] at android.os.Looper.loop(Looper.java:299)
[MIUIScout App] at android.app.ActivityThread.main(ActivityThread.java:8085)
[MIUIScout App] at java.lang.reflect.Method.invoke(Native Method)
[MIUIScout App] at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
[MIUIScout App] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)
I have absolutely no Idea where this comes from or how I could get around it.
Anybody out there, who knows what to do?
Greetings Maurice

Try catch does not solve the problem , it just stop the crash .
It seems a problem with Xamarin.Essentials.Preferences in Android 12 , see the issue here : https://github.com/xamarin/Essentials/issues/1991 .
For that you can seek another way to replace Preferences , or implement Shared Preferences by yourself.

The issue has been caused by a cast using Xamarin.Essentials.Preferences.Get("Key", false);
surrounding it with try{ }catch(Exception e) lets the App start as requestet.

Related

app crashes on startup after adding Ionic cordova-plugin-facebook4

app getting crashed after adding cordova-facebook4-plugin
I/System.out: Error adding plugin org.apache.cordova.facebook.ConnectPlugin.
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: io.ionic.starter, PID: 16951
java.lang.RuntimeException: Unable to start activity ComponentInfo{io.ionic.starter/io.ionic.starter.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CordovaPlugin.privateInitialize(java.lang.String, org.apache.cordova.CordovaInterface, org.apache.cordova.CordovaWebView, org.apache.cordova.CordovaPreferences)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2723)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2784)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1523)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6238)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:933)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CordovaPlugin.privateInitialize(java.lang.String, org.apache.cordova.CordovaInterface, org.apache.cordova.CordovaWebView, org.apache.cordova.CordovaPreferences)' on a null object reference
at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:171)
at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97)
at org.apache.cordova.PluginManager.init(PluginManager.java:86)
at com.getcapacitor.cordova.MockCordovaWebViewImpl.init(MockCordovaWebViewImpl.java:62)
at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:80)
at com.getcapacitor.BridgeActivity.init(BridgeActivity.java:64)
at io.ionic.starter.MainActivity.onCreate(MainActivity.java:16)
at android.app.Activity.performCreate(Activity.java:6857)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2676)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2784) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1523) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:163) 
at android.app.ActivityThread.main(ActivityThread.java:6238) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:933) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823) 
I/Process: Sending signal. PID: 16951 SIG: 9
Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'

Why is Android-SliceViewer failing with

I am attempting to follow this google codelab
Creating Android Slices
When I enter the following adb command
adb shell am start -a android.intent.action.VIEW -d slice-content://com.android.example.slicecodelab/temperature
The Slice Viewer crashes as follows:-
2019-03-19 10:16:05.704 8343-8583/com.example.android.sliceviewer E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
Process: com.example.android.sliceviewer, PID: 8343
java.lang.NullPointerException: name == null
at java.lang.Enum.valueOf(Enum.java:242)
at android.graphics.PorterDuff$Mode.valueOf(PorterDuff.java:178)
at androidx.core.graphics.drawable.IconCompat.onPostParceling(IconCompat.java:757)
at androidx.core.graphics.drawable.IconCompatParcelizer.read(IconCompatParcelizer.java:19)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1369)
at androidx.slice.SliceItemHolderParcelizer.read(SliceItemHolderParcelizer.java:12)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1369)
at androidx.slice.SliceItemParcelizer.read(SliceItemParcelizer.java:15)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readArray(VersionedParcel.java:1342)
at androidx.versionedparcelable.VersionedParcel.readArray(VersionedParcel.java:1311)
at androidx.slice.SliceParcelizer.read(SliceParcelizer.java:13)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1369)
at androidx.slice.SliceItemHolderParcelizer.read(SliceItemHolderParcelizer.java:12)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1369)
at androidx.slice.SliceItemParcelizer.read(SliceItemParcelizer.java:15)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.VersionedParcel.readArray(VersionedParcel.java:1342)
at androidx.versionedparcelable.VersionedParcel.readArray(VersionedParcel.java:1311)
at androidx.slice.SliceParcelizer.read(SliceParcelizer.java:13)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.versionedparcelable.VersionedParcel.readFromParcel(VersionedParcel.java:1440)
at androidx.versionedparcelable.VersionedParcel.readVersionedParcelable(VersionedParcel.java:1386)
at androidx.versionedparcelable.ParcelImpl.<init>(ParcelImpl.java:37)
at androidx.versionedparcelable.ParcelImpl$1.createFromParcel(ParcelImpl.java:61)
at androidx.versionedparcelable.ParcelImpl$1.createFromParcel(ParcelImpl.java:58)
at android.os.Parcel.readParcelable(Parcel.java:2860)
at android.os.Parcel.readValue(Parcel.java:2754)
at android.os.Parcel.readArrayMapInternal(Parcel.java:3123)
at android.os.BaseBundle.initializeFromParcelLocked(BaseBundle.java:273)
at android.os.BaseBundle.unparcel(BaseBundle.java:226)
at android.os.Bundle.getParcelable(Bundle.java:939)
at androidx.slice.compat.SliceProviderCompat.bindSlice(SliceProviderCompat.java:320)
2019-03-19 10:16:05.704 8343-8583/com.example.android.sliceviewer E/AndroidRuntime: at androidx.slice.compat.SliceProviderCompat.bindSlice(SliceProviderCompat.java:378)
at androidx.slice.SliceViewManagerCompat.bindSlice(SliceViewManagerCompat.java:65)
at androidx.slice.widget.SliceLiveData$SliceLiveDataImpl$1.run(SliceLiveData.java:291)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
In fact whatever Android Slice tutorial I attempt to use the Slice Viewer fails in the exact same way
Are android Slices not ready for use?
What Am I dong wrong?
How can I fix Slice Viewer?
UPDATE
Ive raised an Issue (Issue 128658881) and Google are fixing this.
Slice-viewer app crashes on Devices below API 28 when we try to display icons in slice. The app doesn't crash on Pie.
This issue is described here

android-youtube-api makes error when playing youtube contents with ad

android-youtube-api makes error when playing youtube contents with ad.
Version of youtube apk is latest : 11.04.56
AndroidVer: KitKat(4.4.4)
Status: contents with advertisement, click play button in YouTubePlayerSupportFragment.
this is error log below...
02-29 13:04:41.573 27114-27114/? E/YouTubeAndroidPlayerAPI: MEDIA_AD_PLAY_REQUESTED VideoStageEvent received by AdStatsClientManager without an AdReporter being constructed.
02-29 13:04:42.168 27114-27114/? E/YouTubeAndroidPlayerAPI: Trying to do interaction logging without setting an InteractionLogger
02-29 13:04:42.183 29397-29397/? E/dalvikvm: Could not find class 'tc', referenced from method sz.<clinit>
02-29 13:04:42.188 29397-29397/? E/dalvikvm: Could not find class 'tb', referenced from method sz.<clinit>
02-29 13:04:42.188 29397-29397/? E/dalvikvm: Could not find class 'td', referenced from method sz.<clinit>
02-29 13:04:42.188 29397-29397/? E/dalvikvm: Could not find class 'ta', referenced from method sz.<clinit>
02-29 13:04:42.198 29397-29397/? A/AndroidRuntime: FATAL EXCEPTION: Thread[main,5,main]
02-29 13:04:42.208 29397-29397/? A/AndroidRuntime: Process: com.sec.android.app.aaaaa, PID: 29397, Version: 4.1.01-5
java.lang.NoClassDefFoundError: tc
at sz.<clinit>(SourceFile:145)
at ipw.e(SourceFile:250)
at bom.run(SourceFile:74)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5752)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
02-29 13:04:42.218 29397-29397/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.sec.android.app.aaaaa, PID: 29397
java.lang.NoClassDefFoundError: tc
at sz.<clinit>(SourceFile:145)
at ipw.e(SourceFile:250)
at bom.run(SourceFile:74)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5752)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)

Unable to create a new instance eventlistener in Omnifaces?

I am trying to use Converters Features of Omnifaces. My development environment as below:
-primefaces 3.5
-jsf 2.0
-spring 3.5
-Jboss Seam 2.3
This environment is ok and there is no configuration error. When I add new omnifaces-1.6.3.jar to WEB-INF\lib, Unable to deployed the application..
....
14:14:59,563 INFO [org.springframework.jdbc.datasource.DriverManagerDataSource] (MSC service thread 1-2) Loaded JDBC driver: com.mysql.jdbc.Driver
14:14:59,565 INFO [org.springframework.web.context.ContextLoader] (MSC service thread 1-2) Root WebApplicationContext: initialization completed in 98 ms
14:14:59,595 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-2) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401) for context '/cycfm'
14:15:00,215 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-2) Critical error during deployment: : com.sun.faces.config.ConfigurationExcept
ion:
Source Document: vfs:/C:/java/JBoss-7.1.1/standalone/deployments/cycfm.war/WEB-INF/lib/omnifaces-1.6.3.jar/META-INF/faces-config.xml
Cause: Unable to create a new instance of 'org.omnifaces.eventlistener.InvokeActionEventListener': java.lang.UnsupportedOperationException
at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:293) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.processor.LifecycleConfigProcessor.addPhaseListeners(LifecycleConfigProcessor.java:132) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:111) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_25]
Caused by: java.lang.UnsupportedOperationException
at javax.faces.application.Application.subscribeToEvent(Application.java:1812) [jboss-jsf-api_2.1_spec-2.0.5.Final.jar:2.0.5.Final]
at javax.faces.application.ApplicationWrapper.subscribeToEvent(ApplicationWrapper.java:709) [jboss-jsf-api_2.1_spec-2.0.5.Final.jar:2.0.5.Final]
at org.omnifaces.util.Events.subscribeToEvent(Events.java:180) [omnifaces-1.6.3.jar:1.6.3]
at org.omnifaces.eventlistener.InvokeActionEventListener.<init>(InvokeActionEventListener.java:65) [omnifaces-1.6.3.jar:1.6.3]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_25]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.6.0_25]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.reflect.Constructor.newInstance(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.Class.newInstance0(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.Class.newInstance(Unknown Source) [rt.jar:1.6.0_25]
at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:268) [jsf-impl-2.1.7-jbossorg-2.jar:]
... 14 more
14:15:00,227 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/cycfm]] (MSC service thread 1-2) Exception sending context initialized event to liste
ner instance of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException:
Source Document: vfs:/C:/java/JBoss-7.1.1/standalone/deployments/cycfm.war/WEB-INF/lib/omnifaces-1.6.3.jar/META-INF/faces-config.xml
Cause: Unable to create a new instance of 'org.omnifaces.eventlistener.InvokeActionEventListener': java.lang.UnsupportedOperationException
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292) [jsf-impl-2.1.7-jbossorg-2.jar:]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_25]
...
Is there configuration in web.xml or faces-config.xml to use Ominifaces. I think, there is no problem in my page and backing bean.
mypage.xhtml
<h:form>
<p>
<b>Last selected item:</b> <h:outputText id="selected_item" value="#{ChartBean.selectedEntity.value}" />
</p>
<h:panelGrid columns="2">
<h:outputLabel for="iterator" value="Items with iterator: " />
<h:selectOneMenu id="iterator" value="#{ChartBean.selectedEntity}" converter="omnifaces.SelectItemsIndexConverter">
<f:selectItem itemValue="#{null}" itemLabel="Choose item" noSelectionOption="true" />
<f:selectItems value="#{ChartBean.exampleEntities}" var="entity" itemLabel="#{entity.value}" itemValue="#{entity}" />
<f:ajax render="selected_item" />
</h:selectOneMenu>
</h:panelGrid>
<p>
<b>Selected items</b>:
<ui:fragment rendered="#{not empty ChartBean.selectedEntity}">
<ui:repeat value="#{ChartBean.selectedEntity}" var="entity" varStatus="loop">
#{entity.value}#{loop.last ? '' : ', '}
</ui:repeat>
</ui:fragment>
<h:outputText value="[no selection made]" rendered="#{empty ChartBean.selected}"/>
</p>
<p>
<b>Choose a city, then press Select</b>:
<p:pickList value="#{ChartBean.dualListModel}" var="entity" itemValue="#{entity}" itemLabel="#{entity.value}">
<o:converter converterId="omnifaces.ListIndexConverter" list="#{ChartBean.exampleEntities}" />
</p:pickList>
</p>
<p>
<h:commandButton value="Select">
<f:ajax execute="#form" render="#form"/>
</h:commandButton>
</p>
</h:form>
ChartBean.java
#Name("ChartBean")
public class ChartBean implements Serializable {
private List<ExampleEntity> exampleEntities;
private DualListModel<ExampleEntity> dualListModel;
private ExampleEntity selectedEntity;
#PostConstruct
public void init() {
exampleEntities = new ArrayList<ExampleEntity>();
exampleEntities.add(new ExampleEntity(1L, "Amsterdam"));
exampleEntities.add(new ExampleEntity(2L, "Frankfurt"));
exampleEntities.add(new ExampleEntity(3L, "London"));
dualListModel = new DualListModel<ExampleEntity>(exampleEntities, new ArrayList<ExampleEntity>());
}
public List<ExampleEntity> getExampleEntities() {
return exampleEntities;
}
public ExampleEntity getSelectedEntity() {
return selectedEntity;
}
public void setSelectedEntity(ExampleEntity selectedEntity) {
this.selectedEntity = selectedEntity;
}
public DualListModel<ExampleEntity> getDualListModel() {
return dualListModel;
}
public void setDualListModel(DualListModel<ExampleEntity> dualListModel) {
this.dualListModel = dualListModel;
}
public List<ExampleEntity> getSelectedModel() {
return dualListModel.getTarget();
}
}
Update :
I got one point, when I use omnifaces-1.4.1.jar there is no deployment error. But I cannot use omnifaces.ListIndexConverter.
Update : New Jar file omnifaces-1.7-20131127.003718-16.jar
16:54:31,484 INFO [org.springframework.jdbc.datasource.DriverManagerDataSource] (MSC service thread 1-1) Loaded JDBC driver: com.mysql.jdbc.Driver
16:54:31,484 INFO [org.springframework.web.context.ContextLoader] (MSC service thread 1-1) Root WebApplicationContext: initialization completed in 93 ms
16:54:31,843 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401) for context '/cycfm'
16:54:32,919 INFO [org.omnifaces.application.OmniApplicationFactory] (MSC service thread 1-1) init: org.jboss.seam.jsf.SeamApplicationFactory#1c121b6
16:54:33,515 INFO [org.omnifaces.application.OmniApplicationFactory] (MSC service thread 1-1) set: com.sun.faces.application.ApplicationImpl#a95d88, false
16:54:33,515 INFO [org.omnifaces.application.OmniApplication] (MSC service thread 1-1) init: com.sun.faces.application.ApplicationImpl#a95d88
16:54:33,780 INFO [org.omnifaces.application.OmniApplicationFactory] (MSC service thread 1-1) get: org.omnifaces.application.OmniApplication#d9fc12
16:54:33,780 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Critical error during deployment: : com.sun.faces.config.ConfigurationExcept
ion:
Source Document: vfs:/D:/java/JBoss-7.1.1/standalone/deployments/cycfm.war/WEB-INF/lib/omnifaces-1.7-20131127.003718-16.jar/META-INF/faces-config.xml
Cause: Unable to create a new instance of 'org.omnifaces.eventlistener.InvokeActionEventListener': java.lang.UnsupportedOperationException
at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:293) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.processor.LifecycleConfigProcessor.addPhaseListeners(LifecycleConfigProcessor.java:132) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:111) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_25]
Caused by: java.lang.UnsupportedOperationException
at javax.faces.application.Application.subscribeToEvent(Application.java:1812) [jboss-jsf-api_2.1_spec-2.0.5.Final.jar:2.0.5.Final]
at javax.faces.application.ApplicationWrapper.subscribeToEvent(ApplicationWrapper.java:709) [jboss-jsf-api_2.1_spec-2.0.5.Final.jar:2.0.5.Final]
at org.omnifaces.util.Events.subscribeToEvent(Events.java:180) [omnifaces-1.7-20131127.003718-16.jar:1.7-SNAPSHOT-20131126]
at org.omnifaces.eventlistener.InvokeActionEventListener.<init>(InvokeActionEventListener.java:65) [omnifaces-1.7-20131127.003718-16.jar:1.7-SNAPSHOT-20131126]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_25]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.6.0_25]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.reflect.Constructor.newInstance(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.Class.newInstance0(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.Class.newInstance(Unknown Source) [rt.jar:1.6.0_25]
at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:268) [jsf-impl-2.1.7-jbossorg-2.jar:]
... 14 more
16:54:33,796 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/cycfm]] (MSC service thread 1-1) Exception sending context initialized event to liste
ner instance of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException:
Source Document: vfs:/D:/java/JBoss-7.1.1/standalone/deployments/cycfm.war/WEB-INF/lib/omnifaces-1.7-20131127.003718-16.jar/META-INF/faces-config.xml
Cause: Unable to create a new instance of 'org.omnifaces.eventlistener.InvokeActionEventListener': java.lang.UnsupportedOperationException
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292) [jsf-impl-2.1.7-jbossorg-2.jar:]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_25]
Caused by: com.sun.faces.config.ConfigurationException:
Source Document: vfs:/D:/java/JBoss-7.1.1/standalone/deployments/cycfm.war/WEB-INF/lib/omnifaces-1.7-20131127.003718-16.jar/META-INF/faces-config.xml
Cause: Unable to create a new instance of 'org.omnifaces.eventlistener.InvokeActionEventListener': java.lang.UnsupportedOperationException
at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:293) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.processor.LifecycleConfigProcessor.addPhaseListeners(LifecycleConfigProcessor.java:132) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:111) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:]
... 8 more
Caused by: java.lang.UnsupportedOperationException
at javax.faces.application.Application.subscribeToEvent(Application.java:1812) [jboss-jsf-api_2.1_spec-2.0.5.Final.jar:2.0.5.Final]
at javax.faces.application.ApplicationWrapper.subscribeToEvent(ApplicationWrapper.java:709) [jboss-jsf-api_2.1_spec-2.0.5.Final.jar:2.0.5.Final]
at org.omnifaces.util.Events.subscribeToEvent(Events.java:180) [omnifaces-1.7-20131127.003718-16.jar:1.7-SNAPSHOT-20131126]
at org.omnifaces.eventlistener.InvokeActionEventListener.<init>(InvokeActionEventListener.java:65) [omnifaces-1.7-20131127.003718-16.jar:1.7-SNAPSHOT-20131126]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_25]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.6.0_25]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.reflect.Constructor.newInstance(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.Class.newInstance0(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.Class.newInstance(Unknown Source) [rt.jar:1.6.0_25]
at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:268) [jsf-impl-2.1.7-jbossorg-2.jar:]
... 14 more
16:54:33,812 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Error listenerStart
16:54:33,812 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Context [/cycfm] startup failed due to previous errors
16:54:33,827 SEVERE [javax.faces] (MSC service thread 1-1) Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFa
ctory. Attempting to find backup.
16:54:33,827 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Unexpected exception when attempting to tear down the Mojarra runtime: java.
lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1011) [jboss-jsf-api_2.1_spec-2.0.5.Final.jar:2.0.5.Final]
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-jsf-api_2.1_spec-2.0.5.Final.jar:2.0.5.Final]
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:131) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:328) [jsf-impl-2.1.7-jbossorg-2.jar:]
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3489) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3999) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3917) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_25]

Emgu CV for Android throwing Exception Java.Lang.UnsatisfiedLinkError

I am using Mono for Android and followed the instructions mentioned on this page: http://file.emgu.com/wiki/index.php/Emgu_CV_for_Android but when I run the application on the emulator, it throws the following exception:
Java.Lang.UnsatisfiedLinkError has been thrown Cannot load library:
find_library[1199]: 37 'libopencv_highgui.so' failed to load
previously
Java.Lang.UnsatisfiedLinkError: Cannot load library:
find_library[1199]: 37 'libopencv_highgui.so' failed to load
previously at Android.Runtime.JNIEnv.CallStaticVoidMethod (IntPtr
jclass, IntPtr jmethod, Android.Runtime.JValue[] parms) [0x00023] in
/Users/builder/data/lanes/monodroid-mac-monodroid-4.2.4-branch/9f7cbd60/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:973
at Java.Lang.JavaSystem.LoadLibrary (System.String libName)
[0x00034] in
/Users/builder/data/lanes/monodroid-mac-monodroid-4.2.4-branch/9f7cbd60/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Java.Lang.JavaSystem.cs:253
at Emgu.CV.CvInvoke..cctor () [0x00000] in :0
--- End of managed exception stack trace ---
java.lang.UnsatisfiedLinkError: Cannot load library:
find_library[1199]: 37 'libopencv_highgui.so' failed to load
previously
at java.lang.Runtime.loadLibrary(Runtime.java:370)
at java.lang.System.loadLibrary(System.java:535)
at
mono.android.view.View_OnClickListenerImplementor.n_onClick(Native
Method)
at
mono.android.view.View_OnClickListenerImplementor.onClick(View_OnClickListenerImplementor.java:29)
at android.view.View.performClick(View.java:3511)
at android.view.View$PerformClick.run(View.java:14105)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Here is a screenshot of OpenCV-2.4.2 reference

Resources