HI all, Im looking for so help quite fast! as I have to have a show a customer my progress!
I was working with windows 7, using java jdk1.8.0_65 and im not exactly sure what Android Api, as I just install one I feel will work best (I have no idea as to how you would decide which one to use)
I use OKHTTP.
Now I have Windows 8 & java jdk1.8.0_65 and using Api 21, everything is setup and I compile my project, it works until I try either of the following!
running the above I get a crash and the log reads
This relates to
The next problem is Adsense loads an ad and this causes a crash
As I understand it everything is the same! except maybe the API but I have tried a few and its allways the same?
Can someone please help.
Thanks
Aidy
I was working with windows 7, using java jdk1.8.0_65 and im not exactly sure what Android Api, as I just install one I feel will work best (I have no idea as to how you would decide which one to use)
I use OKHTTP.
Now I have Windows 8 & java jdk1.8.0_65 and using Api 21, everything is setup and I compile my project, it works until I try either of the following!
B4X:
Dim check As HttpJob
check.Initialize("checkcredits", Me)
check.Download2("http://private.php", Array As String("action","cr","mac", MACaddress))
check.Release
running the above I get a crash and the log reads
Error occurred on line: 45 (HttpUtils2Service)
java.io.FileNotFoundException: /data/data/com.aidymp.aidymatic/cache/4: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:456)
at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:370)
at com.aidymp.aidymatic.httputils2service._hc_responsesuccess(httputils2service.java:188)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:668)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:334)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:244)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:132)
at anywheresoftware.b4a.BA$3.run(BA.java:334)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
at libcore.io.IoBridge.open(IoBridge.java:442)
... 20 more
** Activity (main) Resume **
java.io.FileNotFoundException: /data/data/com.aidymp.aidymatic/cache/4: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:456)
at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:370)
at com.aidymp.aidymatic.httputils2service._hc_responsesuccess(httputils2service.java:188)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:668)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:334)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:244)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:132)
at anywheresoftware.b4a.BA$3.run(BA.java:334)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
at libcore.io.IoBridge.open(IoBridge.java:442)
... 20 more
** Activity (main) Resume **
This relates to
B4X:
Sub hc_ResponseSuccess (Response As OkHttpResponse, TaskId As Int)
' ********** Modified code *************
Dim cs As CountingOutputStream
cs.Initialize(File.OpenOutput(TempFolder, TaskId, False)) ' ******* THIS LINE GIVES THE ERROR!!!
Dim j As HttpJob = TaskIdToJob.Get(TaskId)
If j.Tag <> Null And j.Tag Is JobTag Then
Dim jt As JobTag = j.Tag
jt.CountingStream = cs
jt.Total = Response.ContentLength
If jt.Data.url = "" Then
Log("Job cancelled before downloaded started")
cs.Close
End If
Response.GetAsynchronously("response", cs , _
True, TaskId)
'**************************************
Else
' ************* TEST CODE
Dim job As HttpJob = TaskIdToJob.Get(TaskId)
job.Tag = Response.StatusCode
Response.GetAsynchronously("response", File.OpenOutput(TempFolder, TaskId, False), _
True, TaskId)
End If
End Sub
The next problem is Adsense loads an ad and this causes a crash
main_btn_disclaimer_click (java line: 842)
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/SimpleArrayMap;
at com.google.android.gms.ads.internal.zzq.<init>(Unknown Source)
at com.google.android.gms.ads.internal.zzq.<init>(Unknown Source)
at com.google.android.gms.ads.internal.zzb.<init>(Unknown Source)
at com.google.android.gms.ads.internal.zzc.<init>(Unknown Source)
at com.google.android.gms.ads.internal.zzf.<init>(Unknown Source)
at com.google.android.gms.ads.internal.client.zze.zza(Unknown Source)
at com.google.android.gms.ads.internal.client.zzz.zzdb(Unknown Source)
at com.google.android.gms.ads.internal.client.zzz.zzda(Unknown Source)
at com.google.android.gms.ads.internal.client.zzz.zza(Unknown Source)
at com.google.android.gms.ads.BaseAdView.loadAd(Unknown Source)
at com.google.android.gms.ads.AdView.loadAd(Unknown Source)
at anywheresoftware.b4a.admobwrapper.AdViewWrapper.LoadAd(AdViewWrapper.java:118)
at com.aidymp.aidymatic.main._btn_disclaimer_click(main.java:842)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.SimpleArrayMap" on path: DexPathList[[zip file "/data/app/com.aidymp.aidymatic-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 29 more
Suppressed: java.lang.ClassNotFoundException: android.support.v4.util.SimpleArrayMap
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 30 more
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/SimpleArrayMap;
at com.google.android.gms.ads.internal.zzq.<init>(Unknown Source)
at com.google.android.gms.ads.internal.zzq.<init>(Unknown Source)
at com.google.android.gms.ads.internal.zzb.<init>(Unknown Source)
at com.google.android.gms.ads.internal.zzc.<init>(Unknown Source)
at com.google.android.gms.ads.internal.zzf.<init>(Unknown Source)
at com.google.android.gms.ads.internal.client.zze.zza(Unknown Source)
at com.google.android.gms.ads.internal.client.zzz.zzdb(Unknown Source)
at com.google.android.gms.ads.internal.client.zzz.zzda(Unknown Source)
at com.google.android.gms.ads.internal.client.zzz.zza(Unknown Source)
at com.google.android.gms.ads.BaseAdView.loadAd(Unknown Source)
at com.google.android.gms.ads.AdView.loadAd(Unknown Source)
at anywheresoftware.b4a.admobwrapper.AdViewWrapper.LoadAd(AdViewWrapper.java:118)
at com.aidymp.aidymatic.main._btn_disclaimer_click(main.java:842)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.SimpleArrayMap" on path: DexPathList[[zip file "/data/app/com.aidymp.aidymatic-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 29 more
Suppressed: java.lang.ClassNotFoundException: android.support.v4.util.SimpleArrayMap
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 30 more
As I understand it everything is the same! except maybe the API but I have tried a few and its allways the same?
Can someone please help.
Thanks
Aidy