Android Question Leadbolt Error "java.lang.ClassCastException"

hasexxl1988

Active Member
Licensed User
Longtime User
Hello,
I have B4A in the version 6.5, and wanted to test Leadbolt times again.
Apptracker: Version 8.0
ApptrackerB4A: Version 2.2

Now I always get the error:

Line 39 is: AppTracker.startSession(True)

B4X:
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 39 (Main)
java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String
    at android.app.SharedPreferencesImpl.getString(SharedPreferencesImpl.java:225)
    at com.apptracker.android.track.AppTracker.i(a:755)
    at com.apptracker.android.track.AppTracker.startSession(a:91)
    at com.apptracker.android.track.AppTracker.startSession(a:168)
    at com.apptracker.android.track.AppTracker.startSession(a:89)
    at com.apptracker.b4a.android.AppTrackerB4A.startSession(AppTrackerB4A.java:67)
    at com.lbtest.main._activity_create(main.java:399)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:340)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    at com.lbtest.main.afterFirstLayout(main.java:102)
    at com.lbtest.main.access$000(main.java:17)
    at com.lbtest.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6688)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
** Activity (main) Resume **

The error I get in the B4A Example of Leadbolt (https://help.leadbolt.com/using-b4a-android/) as well as in my app.

Maybe someone has experience or is the error in the current Library of Leadbolt? I used it once in times, at that time everything worked perfectly.

I have done everything as described by Leadbolt in the manual.

Someone has perhaps an idea? : /
 
Last edited:

eps

Expert
Licensed User
Longtime User
Can you post some more of your code please, i.e. the lines before 39?

Your error says :

Error occurred on line: 39 (Main)
java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String

It looks like something is miscast - or maybe missing before that statement? It seems to want a Boolean, it looks like you've supplied a Boolean but then it complains about it being cast to a String...

I'll give the SDK and demo a whirl and see if anything pops out..
 
Upvote 0

hasexxl1988

Active Member
Licensed User
Longtime User
Can you post some more of your code please, i.e. the lines before 39?

Your error says :

Error occurred on line: 39 (Main)
java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String

It looks like something is miscast - or maybe missing before that statement? It seems to want a Boolean, it looks like you've supplied a Boolean but then it complains about it being cast to a String...

I'll give the SDK and demo a whirl and see if anything pops out..
B4X:
#Region  Project Attributes
    #ApplicationLabel: TestApp
    #VersionCode: 1
    #VersionName: 1.0
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: True
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim AppTracker As AppTrackerB4A
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Main")
    AppTracker.Initialize("MYID")
    AppTracker.startSession(True)
    AppTracker.loadModuleToCache("inapp")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

And the Mainfest File:

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="19"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
AddApplicationText(
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize"
          android:name="com.apptracker.android.module.AppModuleActivity"
          android:hardwareAccelerated="false">
</activity>
<service android:name="com.apptracker.android.track.AppTrackerService" />)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
 
Upvote 0

eps

Expert
Licensed User
Longtime User
I guess you've downloaded Leadbolt again and updated your libraries?

AppTracker is version 8.00

ApptrackerB4A is version 2.20

?
 
Upvote 0

hasexxl1988

Active Member
Licensed User
Longtime User
I guess you've downloaded Leadbolt again and updated your libraries?

AppTracker is version 8.00

ApptrackerB4A is version 2.20

?

Yes is this Version

LIBS.jpg
 
Upvote 0

eps

Expert
Licensed User
Longtime User
I had a quick look at the B4A library definition and the startSession expects a Boolean so something isn't quite right
 
Upvote 0

eps

Expert
Licensed User
Longtime User
I don't get an error using the demo code...

How are you debugging? Rapid Debugger or Legacy (is that still in 6.5?) I'm on 6.8
 
Upvote 0

hasexxl1988

Active Member
Licensed User
Longtime User
I don't get an error using the demo code...

How are you debugging? Rapid Debugger or Legacy (is that still in 6.5?) I'm on 6.8
i have try with the 6.8 Trail Version. Same Error. Tested with Rapid and Legacy.

Have you Java JDK 32 or 64 Bit?
What a Operating System?
Android Version for Compiling?

I have Windows 10 Pro x64, Java JDK 64 Bit and Android Plattform 14 and 19 tested.
 
Upvote 0

hasexxl1988

Active Member
Licensed User
Longtime User
I have now tested it with the 32 bit version of java JDK, and get the following error:

B4X:
LogCat connected to: B4A-Bridge: samsung SM-G935F
--------- beginning of main
** Activity (main) Resume **
Connected to B4A-Bridge (Wifi)
** Activity (main) Pause, UserClosed = true **
Installing file.
PackageAdded: package:b4a.example
Copying updated assets files (2)
** Activity (main) Create, isFirst = true **
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppRequestTask.H(k:372)
    at com.apptracker.android.request.AppRequest$AppRequestTask.doInBackground(k:244)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
** Activity (main) Resume **
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:318)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
    at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:263)
    at com.apptracker.android.track.AppTracker.a(a:1202)
    at com.apptracker.android.track.AppTracker.isInternetAvailable(a:865)
    at com.apptracker.android.request.AppRequest$AppCrashTask.H(k:252)
    at com.apptracker.android.request.AppRequest$AppCrashTask.doInBackground(k:98)
    at android.os.AsyncTask$2.call(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 3 more
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Hi

I use Windows 7 Pro, 64 bit

You haven't defined True as a variable anywhere have you? It just looks really odd that it is treating it as a String and not a Boolean.

In the demo supplied by LeadBolt it sets the minsdk to 8.. but that *shouldn't* make a difference... (worth trying tho)

You've definitely not got an old version of the library hanging around somewhere or in your project directory?

Maybe Zip you project (using the menu option) and post here? or are you definitely generating the demo code from the leadbolt website?
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Hmm... Try uninstalling and reinstalling your App - somewhere something has been sending a string to that LeadBolt code - assuming the error is still being generated at the startSession call and was passed a string or a string called the same name as one of the Booleans passed to that or another LeadBolt function.

ETA : just saw this from Erel on another thread..

1. Are you testing it on a real device?
2. Have you set #DebuggerForceStandardAssets to True?

Maybe try these two.. I guess you're on a real device..?
 
Last edited:
Upvote 0

hasexxl1988

Active Member
Licensed User
Longtime User
Hmm... Try uninstalling and reinstalling your App - somewhere something has been sending a string to that LeadBolt code - assuming the error is still being generated at the startSession call and was passed a string or a string called the same name as one of the Booleans passed to that or another LeadBolt function.
i have tryed my testapp an the Leadbolt Example App with Same Errors :/

EDIT:

I tried it with the "Release" Status. Since the App then goes normally on the smartphone, only in the Debug mode comes the Error.
 

Attachments

  • TestApp LB.zip
    7.7 KB · Views: 129
Last edited:
Upvote 0
Top