Android SDK 3 (Ver 1.5) broken with b4a Ver 1.6

brucegs13

Member
Licensed User
Longtime User
You helped us use Android SDK 3 (Ver 1.5) with Basic4Android by hacking the XML Manifest and making it read only.

Our original post is here: http://www.b4x.com/forum/basic4andr...42-android-version-1-5-api-3-a.html#post46765

We are using SDK level 8. Our App was working fine for my client who has over 50 push to talk Motorola I1's running android version 1.5

After upgrading to Basic4Android Version 1.6 we are receiving the following error:

B4X:
activity.loadlayout("layoutname")java.lang.nullpointerException

We receive this error when we call any layout so basically the app is broken and we need help

We did experiment and we don't get the error if we have a layout with no views (not a great solution! ha ha).

We started a new hello world project with no layout (just a messagebox) and it worked fine.

Thanks in advance ....
 

Attachments

  • crash.JPG
    crash.JPG
    44 KB · Views: 268
Last edited:

eps

Expert
Licensed User
Longtime User
I would generate the code with debugging on and see what B4A returns as an error. It might also be worth looking at the log...
 

brucegs13

Member
Licensed User
Longtime User
Is this the correct log you are asking for?

B4X:
>>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
CheckJNI is ON
--- registering native functions ---
Starting activity: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} flags=0x10000000 comp={myproj.helloworld/myproj.helloworld.main} }
Shutting down VM
DestroyJavaVM waiting for non-daemon threads to exit
DestroyJavaVM shutting VM down
 HeapWorker thread shutting down
HeapWorker thread has shut down
JDWP shutting down net...
VM cleaning up
LinearAlloc 0x0 used 637060 of 4194304 (15%)
Start proc myproj.helloworld for activity myproj.helloworld/.main: pid=890 uid=10020 gids={}
** Activity (main) Create, isFirst = true **
 Could not find method android.content.Intent.parseUri, referenced from method anywheresoftware.b4a.objects.IntentWrapper.Initialize2
 VFY: unable to resolve static method 93: Landroid/content/Intent;.parseUri (Ljava/lang/String;I)Landroid/content/Intent;
 VFY:  rejecting opcode 0x71 at 0x0000
 VFY:  rejected Lanywheresoftware/b4a/objects/IntentWrapper;.Initialize2 (Ljava/lang/String;I)V
 Verifier rejected class Lanywheresoftware/b4a/objects/IntentWrapper;
Unable to match class for part: 'Lanywheresoftware/b4a/objects/IntentWrapper;'

 java.lang.NoSuchMethodException
   at java.lang.Class.getDeclaredMethods(Native Method)
   at java.lang.ClassCache.getDeclaredPublicMethods(ClassCache.java:166)
   at java.lang.ClassCache.getDeclaredMethods(ClassCache.java:179)
   at java.lang.ClassCache.findAllMethods(ClassCache.java:249)
   at java.lang.ClassCache.getFullListOfMethods(ClassCache.java:223)
   at java.lang.ClassCache.getAllPublicMethods(ClassCache.java:204)
   at java.lang.Class.getMethod(Class.java:1006)
   at anywheresoftware.b4a.DynamicBuilder.build(DynamicBuilder.java:18)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:85)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:67)
   at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:169)
   at myproj.helloworld.main._activity_create(main.java:208)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:521)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:105)
    at myproj.helloworld.main.afterFirstLayout(main.java:84)
   at myproj.helloworld.main.access$100(main.java:16)
   at myproj.helloworld.main$WaitForLayout.run(main.java:72)
   at android.os.Handler.handleCallback(Handler.java:587)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:123)
   at android.app.ActivityThread.main(ActivityThread.java:3948)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:521)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
   at dalvik.system.NativeStart.main(Native Method)
main_activity_create (B4A line: 15)
 Activity.LoadLayout("test") 'Load the layout file.

 java.lang.NullPointerException
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:85)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:121)
   at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:67)
   at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:169)
   at myproj.helloworld.main._activity_create(main.java:208)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:521)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:105)
   at myproj.helloworld.main.afterFirstLayout(main.java:84)
   at myproj.helloworld.main.access$100(main.java:16)
   at myproj.helloworld.main$WaitForLayout.run(main.java:72)
   at android.os.Handler.handleCallback(Handler.java:587)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:123)
   at android.app.ActivityThread.main(ActivityThread.java:3948)
   at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:521)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
   at dalvik.system.NativeStart.main(Native Method)
java.lang.NullPointerException
 Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@4361c498 (uid=10020 pid=890)
 Client not active, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4360d0d8
 Displayed activity myproj.helloworld/.main: 5124 ms
 GC freed 623 objects / 34144 bytes in 245ms
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is the correct log. The error is related to Intent.parseUri that is used internally and is only available from Android 1.6. I'm not sure why it throws an error at that point. Are you doing anything with intents?

I believe that you will need to stay with Basic4android v1.5 if you need to target Android 1.5. Officially only Android 1.6 and above are supported.
 

brucegs13

Member
Licensed User
Longtime User
Nope we are not doing anything with intents.

I know Android 1.5 is not offically supported but your software is all we have to work with at the moment.

How much would you charge me to patch b4a 1.6 to get around this Intent.parseUri?

Thanks
 
Top