Hi Victor,
I don't know if you are facing the same problem I had, when I was trying
Felix on Android 8.1, targeting API 27, a couple month ago.
I have dexified my test-bundle with this
<https://github.com/luoqii/felix-on-android/blob/master/dexify.sh> script.
Felix does start and the bundle gets successfully installed
(context.installBundle(url, is)).
But when I try to start the bundle I get following exception:

*Opening an oat file without a class loader. Are you using the deprecated
DexFile APIs?*

The DexFile is being used by Felix in
Class org.apache.felix.framework.BundleWiringImpl (1342) and I have read
<https://developer.android.com/reference/dalvik/system/DexFile.html> that
the DexFile class is deprecated since Android API 26.
But although deprecated, I checked that this class is still part of the API
27, so this felix code should actually still work.
Here is the error log:
03-30 09:29:08.647: W/System.err(6351):
java.lang.reflect.InvocationTargetException
03-30 09:29:08.647: W/System.err(6351):  at
java.lang.reflect.Method.invoke(Native Method)
03-30 09:29:08.647: W/System.err(6351):  at
javafxports.android.DalvikLauncher$1.run(DalvikLauncher.java:188)
03-30 09:29:08.648: W/System.err(6351):  at
java.lang.Thread.run(Thread.java:764)
03-30 09:29:08.648: W/System.err(6351): Caused by:
java.lang.RuntimeException: Exception in Application init method
03-30 09:29:08.648: W/System.err(6351):  at
com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:912)
03-30 09:29:08.648: W/System.err(6351):  at
com.sun.javafx.application.LauncherImpl.lambda$launchApplication$138(LauncherImpl.java:182)
03-30 09:29:08.648: D/vndksupport(2155): Loading /vendor/lib64/hw/
gralloc.hikey960.so from current namespace instead of sphal namespace.
03-30 09:29:08.648: W/System.err(6351):  at
com.sun.javafx.application.LauncherImpl.access$lambda$1(Unknown Source:8)
03-30 09:29:08.648: W/System.err(6351):  at
com.sun.javafx.application.LauncherImpl$$Lambda$2.run(Unknown Source:13)
03-30 09:29:08.648: W/System.err(6351):  ... 1 more
03-30 09:29:08.648: W/System.err(6351): Caused by:
org.osgi.framework.BundleException: Activator start error in bundle
com.indsp.playground.helloworldbundle.HelloWorld [1].
03-30 09:29:08.648: W/System.err(6351):  at
org.apache.felix.framework.Felix.activateBundle(Felix.java:2289)
03-30 09:29:08.648: W/System.err(6351):  at
org.apache.felix.framework.Felix.startBundle(Felix.java:2145)
03-30 09:29:08.648: W/System.err(6351):  at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
03-30 09:29:08.648: W/System.err(6351):  at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
03-30 09:29:08.648: W/System.err(6351):  at
com.indsp.playground.osgimobiledemo.osgijavafxdemo.OsgiApplication.init(OsgiApplication.java:60)
03-30 09:29:08.648: W/System.err(6351):  at
com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:841)
03-30 09:29:08.648: W/System.err(6351):  ... 4 more
03-30 09:29:08.648: W/System.err(6351): Caused by:
java.lang.UnsupportedOperationException: can't load this type of class file
03-30 09:29:08.648: W/System.err(6351):  at
java.lang.ClassLoader.defineClass(ClassLoader.java:591)
03-30 09:29:08.648: W/System.err(6351):  at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2375)
03-30 09:29:08.649: W/System.err(6351):  at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2159)
03-30 09:29:08.649: W/System.err(6351):  at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1578)
03-30 09:29:08.649: W/System.err(6351):  at
org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
03-30 09:29:08.649: W/System.err(6351):  at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
03-30 09:29:08.649: W/System.err(6351):  at
java.lang.ClassLoader.loadClass(ClassLoader.java:312)
03-30 09:29:08.649: W/System.err(6351):  at
org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1404)
03-30 09:29:08.649: W/System.err(6351):  at
org.apache.felix.framework.Felix.createBundleActivator(Felix.java:4505)
03-30 09:29:08.649: W/System.err(6351):  at
org.apache.felix.framework.Felix.activateBundle(Felix.java:2220)
03-30 09:29:08.649: W/System.err(6351):  ... 9 more

I am interested to see the error logs you get.
Thanks,
Jorg


Am Mo., 8. Okt. 2018 um 17:57 Uhr schrieb Victor Manso Morente <
vicma...@gmail.com>:

> You can explain me how I can do it or if you have an example of an android
> application.
>
> Thank you very much
>
> El lun., 8 oct. 2018 16:40, Bruce Jackson <bruce.jack...@thingstream.io>
> escribió:
>
> > I haven’t tried this recently, but last time I did, I just downloaded the
> > felix jar from the main download page and included it as a library into
> my
> > Android application.
> >
> > > On 8 Oct 2018, at 16:36, Victor Manso Morente <vicma...@gmail.com>
> > wrote:
> > >
> > > Hi Bruce
> > >
> > > I can't download It and I can't try It.
> > >
> > > Because I try to do an application to embed Apache felix in Android to
> > run
> > > a gateway of osgi.
> > >
> > > Thanks.
> > >
> > > El lun., 8 oct. 2018 15:36, Bruce Jackson <
> bruce.jack...@thingstream.io>
> > > escribió:
> > >
> > >> Hi Victor
> > >>
> > >> When you say "doesn't work" what do you mean? Have you got some logs
> you
> > >> can send?
> > >>
> > >> Thanks
> > >>
> > >> Bruce
> > >>
> > >> On Mon, 8 Oct 2018 at 14:54, Victor Manso Morente <vicma...@gmail.com
> >
> > >> wrote:
> > >>
> > >>> Hi,
> > >>>
> > >>> I need your help about *Apache Felix Framework and Google Android*
> > >>>
> > >>> I have seen the page:
> > >>>
> > >>>
> > >>>
> > >>
> >
> http://felix.apache.org/documentation/subprojects/apache-felix-framework/apache-felix-framework-and-google-android.html
> > >>>
> > >>> But the project zip file osgi-android.zip
> > >>> <
> > >>>
> > >>
> >
> http://felix.apache.org/documentation/subprojects/apache-felix-framework/apache-felix-framework-and-google-android.html
> > >>>> ,
> > >>> doesn't work.
> > >>>
> > >>> Can you help me?
> > >>>
> > >>> Thank you very much.
> > >>>
> > >>> Best  regards,
> > >>> Víctor
> > >>>
> > >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> > For additional commands, e-mail: users-h...@felix.apache.org
> >
> >
>

Reply via email to