Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2467] Ti.Map: Exception thrown when targeting Android P

GitHub Issuen/a
TypeBug
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 7.5.0
Fix Version/sn/a
ComponentsMap
Labelsandroid, map
ReporterHans Knöchel
AssigneeYordan Banev
Created2018-10-28T10:43:48.000+0000
Updated2018-11-22T00:41:51.000+0000

Description

When using Ti.Map on Android P, an error is thrown:
[ERROR] TiExceptionHandler: (main) [13088,13088]
[ERROR] TiExceptionHandler:     dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
[ERROR] TiExceptionHandler:     java.lang.ClassLoader.loadClass(ClassLoader.java:379)
[ERROR] TiExceptionHandler:     dhd.loadClass(:com.google.android.gms@12862026@12.8.62 (040700-199405334):3)
[ERROR] TiExceptionHandler:     java.lang.ClassLoader.loadClass(ClassLoader.java:312)
[ERROR] TiExceptionHandler:     el.b(:com.google.android.gms.dynamite_mapsdynamite@12862026@12.8.62 (040700-199405334):3)
[ERROR] TiExceptionHandler:     ek.a(:com.google.android.gms.dynamite_mapsdynamite@12862026@12.8.62 (040700-199405334):4)
[ERROR] TiExceptionHandler:     em.a(:com.google.android.gms.dynamite_mapsdynamite@12862026@12.8.62 (040700-199405334):51)
[ERROR] TiExceptionHandler:     com.google.maps.api.android.lib6.drd.ap.a(:com.google.android.gms.dynamite_mapsdynamite@12862026@12.8.62 (040700-199405334):11)
[ERROR] TiExceptionHandler:     dw.a(:com.google.android.gms.dynamite_mapsdynamite@12862026@12.8.62 (040700-199405334):16)
[ERROR] TiExceptionHandler:     dw.run(:com.google.android.gms.dynamite_mapsdynamite@12862026@12.8.62 (040700-199405334):61)
Following the [Android bug tracker](https://issuetracker.google.com/issues/79478779), this is a known issue and the workaround is to add the following to the manifest:
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
I can confirm the fix works fine for Titanium as well.

Comments

  1. Hans Knöchel 2018-10-28

    PR: https://github.com/appcelerator-modules/ti.map/pull/249
  2. Hans Knöchel 2018-10-28

    Update: It seems like this surfaced another issue in the SDK. The uses-library tag cannot be properly merged into the final AndroidManifest:
       	<uses-library>[object Object]</uses-library>
       
    For now, the above fix needs to be applied manually to the project. Once the CLI is fixed, the Ti.Map PR can be reviewed.
  3. Joshua Quick 2018-11-09

    [~hknoechel], regarding the CLI issue, I believe you're running into this: [MOD-2263]
  4. Jan Vennemann 2018-11-13

    Merged the PR from [~hknoechel]. Waiting for MOD-2458, MOD-2457 and possibly [#254](https://github.com/appcelerator-modules/ti.map/pull/254) to draft a new Android release.
  5. Joe Falcone 2018-11-21

    BTW, the workaround goes into the portion of the manifest and is processed correctly for 7.5.0 in Studio.
  6. Joshua Quick 2018-11-22

JSON Source