morgan44 / backport-android-bluetooth

Automatically exported from code.google.com/p/backport-android-bluetooth
0 stars 0 forks source link

Class not found exception on Eclair #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. just this line triggers a failure: BluetoothAdapter bluetooth =
BluetoothAdapter.getDefaultAdapter();

What is the expected output? What do you see instead?
Expected no output, got a Force Close

What version of the product are you using? On what operating system?
Eclair 2.0.1 Moto Droid

Please provide any additional information below.
Stack trace:

03-04 00:34:14.322: ERROR/ServiceLocator(19142):
java.lang.ClassNotFoundException: android.bluetooth.IBluetoothDevice$Stub
in loader dalvik.system.PathClassLoader@44baf150
03-04 00:34:14.322: ERROR/ServiceLocator(19142):     at
dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
03-04 00:34:14.322: ERROR/ServiceLocator(19142):     at
java.lang.ClassLoader.loadClass(ClassLoader.java:573)
03-04 00:34:14.322: ERROR/ServiceLocator(19142):     at
java.lang.ClassLoader.loadClass(ClassLoader.java:532)
03-04 00:34:14.322: ERROR/ServiceLocator(19142):     at
backport.android.bluetooth.ServiceLocator.getServiceStubClass(ServiceLocator.jav
a:109)
03-04 00:34:14.322: ERROR/ServiceLocator(19142):     at
backport.android.bluetooth.ServiceLocator.getServiceStubInternal(ServiceLocator.
java:143)
03-04 00:34:14.322: ERROR/ServiceLocator(19142):     at
backport.android.bluetooth.ServiceLocator.getServiceStub(ServiceLocator.java:62)
03-04 00:34:14.322: ERROR/ServiceLocator(19142):     at
backport.android.bluetooth.IBluetoothDeviceLocator.get(IBluetoothDeviceLocator.j
ava:41)
03-04 00:34:14.322: ERROR/ServiceLocator(19142):     at
backport.android.bluetooth.BluetoothAdapter.getDefaultAdapter(BluetoothAdapter.j
ava:399)

second error stack trace:

03-04 00:35:06.549: ERROR/AndroidRuntime(19142):
java.lang.NoClassDefFoundError: android.bluetooth.IBluetoothDevice
03-04 00:35:06.549: ERROR/AndroidRuntime(19142):     at
backport.android.bluetooth.IBluetoothDeviceLocator.get(IBluetoothDeviceLocator.j
ava:41)
03-04 00:35:06.549: ERROR/AndroidRuntime(19142):     at
backport.android.bluetooth.BluetoothAdapter.getDefaultAdapter(BluetoothAdapter.j
ava:399)

Original issue reported on code.google.com by patrick....@gmail.com on 4 Mar 2010 at 5:35

GoogleCodeExporter commented 9 years ago
backport-android-bluetooth is a backport of 2.0(or higher) bluetooth API.
you don't need this project.

Original comment by esma...@gmail.com on 4 Apr 2010 at 11:01

GoogleCodeExporter commented 9 years ago
Thanks for the update, though I think there was a misunderstanding on my part 
as to
the intended usage. 

To be clear, I was in fact trying to code for *both* Android 2.0 and earlier 
version,
not just Eclair.  What I misunderstood is that you need to still use reflection 
or an
interface to separate the two scenarios.  However, it would be nice not to have 
to
separate them, though that isn't a huge deal.  I do suggest that you update the
documentation at the very least to reflect that you can't simply use the 
backport for
both eclair *and* previous version of Android.

Anyways, thanks for coding this, it has worked well in my other tests.

Original comment by patrick....@gmail.com on 7 Apr 2010 at 10:24

GoogleCodeExporter commented 9 years ago
see issue 6, perhaps a new issue should be opened? i.e support both 1.x and 2.x

Original comment by dario.nycjava@gmail.com on 8 Apr 2010 at 7:48