Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16261] CLI: AndroidManifest.xml not updated to reflect map v2 API key (custom build)

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-03-23T02:34:37.000+0000
Affected Version/sn/a
Fix Version/s2014 Sprint 02, 2014 Sprint 02 Core, Release 3.2.1, Release 3.3.0
ComponentsCLI
LabelssupportTeam, triage
ReporterEduardo Gomez
AssigneeChris Barber
Created2014-01-21T01:01:46.000+0000
Updated2017-03-21T22:06:07.000+0000

Description

Issue description

After following these instruction to implement Google Maps v2 http://docs.appcelerator.com/titanium/3.0/#!/guide/Google_Maps_v2_for_Android the developer When trying out to see the map this is seen in the crash report:
TiApplication: (main) [47657,47657] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.onforce.OnForce/org.appcelerator.titanium.TiActivity}: java.lang.RuntimeException: API key not found.  Check that <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml; Titanium 3.2.0,2014/01/08 17:01,dd79e01
[ERROR] :  TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.onforce.OnForce/org.appcelerator.titanium.TiActivity}: java.lang.RuntimeException: API key not found.  Check that <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml
[ERROR] :  TiApplication:   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2194)
[ERROR] :  TiApplication:   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2229)
[ERROR] :  TiApplication:   at android.app.ActivityThread.access$600(ActivityThread.java:139)
[ERROR] :  TiApplication:   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
[ERROR] :  TiApplication:   at android.os.Handler.dispatchMessage(Handler.java:99)
[ERROR] :  TiApplication:   at android.os.Looper.loop(Looper.java:154)
[ERROR] :  TiApplication:   at android.app.ActivityThread.main(ActivityThread.java:4944)
[ERROR] :  TiApplication:   at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR] :  TiApplication:   at java.lang.reflect.Method.invoke(Method.java:511)
[ERROR] :  TiApplication:   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
[ERROR] :  TiApplication:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
[ERROR] :  TiApplication:   at dalvik.system.NativeStart.main(Native Method)
[ERROR] :  TiApplication: Caused by: java.lang.RuntimeException: API key not found.  Check that <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml
[ERROR] :  TiApplication:   at maps.af.ay.a(Unknown Source)
[ERROR] :  TiApplication:   at maps.af.ay.a(Unknown Source)
[ERROR] :  TiApplication:   at maps.af.al.a(Unknown Source)
[ERROR] :  TiApplication:   at maps.af.be.a(Unknown Source)
[ERROR] :  TiApplication:   at maps.af.bd.a(Unknown Source)
[ERROR] :  TiApplication:   at cmj.onTransact(SourceFile:107)
[ERROR] :  TiApplication:   at android.os.Binder.transact(Binder.java:297)
[ERROR] :  TiApplication:   at com.google.android.gms.maps.internal.IMapFragmentDelegate$a$a.onCreateView(Unknown Source)
[ERROR] :  TiApplication:   at com.google.android.gms.maps.SupportMapFragment$a.onCreateView(Unknown Source)
[ERROR] :  TiApplication:   at com.google.android.gms.dynamic.a$4.b(Unknown Source)
[ERROR] :  TiApplication:   at com.google.android.gms.dynamic.a.a(Unknown Source)
[ERROR] :  TiApplication:   at com.google.android.gms.dynamic.a.onCreateView(Unknown Source)
[ERROR] :  TiApplication:   at com.google.android.gms.maps.SupportMapFragment.onCreateView(Unknown Source)
[ERROR] :  TiApplication:   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:871)
[ERROR] :  TiApplication:   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1083)
[ERROR] :  TiApplication:   at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:635)
[ERROR] :  TiApplication:   at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1431)
[ERROR] :  TiApplication:   at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:523)
[ERROR] :  TiApplication:   at org.appcelerator.titanium.TiBaseActivity.onStart(TiBaseActivity.java:1048)
[ERROR] :  TiApplication:   at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1195)
[ERROR] :  TiApplication:   at android.app.Activity.performStart(Activity.java:4541)
[ERROR] :  TiApplication:   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2167)
Note that it complains that it doesn't have this tag: {quote} {quote}

Steps to reproduce

1) Please find the SDK uploaded here: https://www.dropbox.com/s/g6ont6pqn9586d5/onforce-3.2.0-osx.zip 2) To generate the build use packaging command (-T dist-playstore): - titanium build -T dist-playstore --platform android -L OnForce -f -K ./tools/onforce.keystore -O ./tools/ 3) Watch packaged APK. Browse Androidmanifest.xml contents. API key not listed into generated file.

Attachments

FileDateSize
AndroidManifest.js2014-01-22T21:22:20.000+000019106

Comments

  1. Chris Barber 2014-01-31

    I tested this with Titanium SDK 3.2.0.GA and the attached TravisTestApp project and it adds the API key to the final AndroidManifest.xml file as expected. I don't know what "3.2.0.onforce" is, but it is not supported. We only support official GA releases.
  2. Michael Gangolf 2014-02-20

    I'm facing the same error on OSX with 3.2.1GA SDK! I've put all map-v2 lines into the tiapp.xml but it doesn't appear in AndroidManifest.xml Edit: sorry, fixed this already. I had multiple entries in the tiapp.xml and it was overwriting the map-key. Joining them into one fixed the problem!
  3. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced and due to the above comments.

JSON Source