Android Question App Crashing (Solved)

Roger Daley

Well-Known Member
Licensed User
Hi All,

A problem.
Existing App updated for Runtime Permissions.

Install App OK.
Attempt to open App and it crashes, it does not report line numbers etc.
This occurs in release and debug modes. Also the same result if a fresh install or installing over existing [working] App.

The App installs OK a Galaxy Note 3 [Android 5] and a LG V20 [Android 8].
The problem occurs on a Galaxy Tab A [Android 9].
I suspect a timing issue due to the Tab A running faster but I really have no idea.

I am working my way through using Log() to narrow down where exactly it is crashing.
Can someone please tell what the crash info from the Log means. Crash info and code below.

I know this isn't much to go on but if someone can translate the LOG to SIMPLE i would appreciate it.

Regards Roger

Sub Activity_PermissionResult (Permission As String, Result As Boolean)

End Sub

Sub mFragment_Ready
Log(" Start of mFragment_Ready") 
    gmap = mFragment.GetMap
'   '*****Added as part of Map upgrade 10 Aug 19                  
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)  

'**** Requests permission but crashes before user responds
    gmap.MyLocationEnabled = Result

   If gmap.IsInitialized = False Then
        ToastMessageShow("Error initializing map.", True)
       ' Do stuff
       ' More stuff
Log(" End of mFragment_Ready Sub")
End Sub

Logger connected to: samsung SM-T510
--------- beginning of main
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Start of mFragment_Ready
** Activity (main) Pause, UserClosed = false **
No wakelock.
--------- beginning of system
--------- beginning of crash
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion;
at ce.b:) (100304-269183835):3)
at cb.a:) (100304-269183835):3)
at cd.a:) (100304-269183835):14)
at (100304-269183835):4)
at bf.a:) (100304-269183835):22)
at (100304-269183835):8)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.ProtocolVersion" on path: DexPathList[[zip file "/data/user_de/0/"],nativeLibraryDirectories=[/data/user_de/0/!/lib/armeabi-v7a, /data/user_de/0/!/lib/armeabi, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(
at java.lang.ClassLoader.loadClass(
at ad.loadClass:) (100304-269183835):4)
at java.lang.ClassLoader.loadClass(
... 6 more

Roger Daley

Well-Known Member
Licensed User
Hi Erel,

Manifest below.

" android:value="AIzaSyAn4mAf8Nqha2H5oHHYvbCx9Ge37??????"/>)" is dummy for this reply only

'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:

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")

CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, Themes.DarkTheme)
'End of default text.

AddManifestText( <permission
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>)

AddApplicationText( <meta-data
android:value="@integer/google_play_services_version" /> )


Regards Roger


Licensed User
i dont see any addpermission?

also i´m missing

      android:required="false" />
The last is the source of your problem

Go again over the googlemap tutorial and also go again over the runtimepermissions tutorial.

Roger Daley

Well-Known Member
Licensed User
Thankyou DonManfred,

Once again you've come to the rescue. The "AddApplicationText" code was indeed the problem, I'm surprised that the App was working on the earlier devices without it, but that's computers for you.
Reading back over the Maps Tutorial, the "AddApplicationText" hits you in the face when you know what you are looking for. That of course is where you have the advantage, you know what you are talking about. I could have read that 6 times with out the penny dropping.

You wrote that you did not see any "addpermission".
The manifest has the line:
was there a different addpermission that I have missed?

Thanks again
Regards Roger