Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15615] Android: Project built with google API key fails with error "API key not found"

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-11-02T00:57:35.000+0000
Affected Version/sRelease 3.2.0
Fix Version/s2013 Sprint 22, 2013 Sprint 22 Core, Release 3.2.0
ComponentsAndroid
Labelsmodule_androidmapv2, qe-3.2.0, qe-testadded, triage
ReporterLokesh Choudhary
AssigneeChris Barber
Created2013-10-30T21:26:16.000+0000
Updated2014-02-26T19:15:48.000+0000

Description

Description:

1.Use the "Mapv2module test" from titanium mobile tests internal/Feature tests/AndroidMapv2 2.Build the app for device.

Actual Result:

1.We get errors like below:
[ERROR] TiApplication: (main) [192,192] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcelerator.mapmod/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,2013/10/29 15:04,3bf03a3
[ERROR] TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcelerator.mapmod/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:2246)
[ERROR] TiApplication: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2296)
[ERROR] TiApplication: 	at android.app.ActivityThread.access$700(ActivityThread.java:151)
[ERROR] TiApplication: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281)
[ERROR] TiApplication: 	at android.os.Handler.dispatchMessage(Handler.java:99)
[ERROR] TiApplication: 	at android.os.Looper.loop(Looper.java:137)
[ERROR] TiApplication: 	at android.app.ActivityThread.main(ActivityThread.java:5293)
[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:1102)
[ERROR] TiApplication: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
[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.ag.bb.a(Unknown Source)
[ERROR] TiApplication: 	at maps.ag.bb.a(Unknown Source)
[ERROR] TiApplication: 	at maps.ag.an.a(Unknown Source)
[ERROR] TiApplication: 	at maps.ag.bh.a(Unknown Source)
[ERROR] TiApplication: 	at maps.ag.bg.a(Unknown Source)
[ERROR] TiApplication: 	at bob.onTransact(SourceFile:107)
[ERROR] TiApplication: 	at android.os.Binder.transact(Binder.java:310)
[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.internal.bb$4.b(Unknown Source)
[ERROR] TiApplication: 	at com.google.android.gms.internal.bb.a(Unknown Source)
[ERROR] TiApplication: 	at com.google.android.gms.internal.bb.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:1181)
[ERROR] TiApplication: 	at android.app.Activity.performStart(Activity.java:5260)
[ERROR] TiApplication: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2219)

Expected Result:

1.we should not get any errors & the app should launch & run normally

Comments

  1. Lokesh Choudhary 2013-10-31

    Based on conversation with Eric updating the severity to blocker.
  2. Chris Barber 2013-11-01

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/4898
  3. Lokesh Choudhary 2013-11-06

    Verified the fix. We do not get any API key error while building. Closing. Environment: Appcel Studio : 3.2.0.201311050207 Ti SDK : 3.2.0.v20131104164843 Mac OSX : 10.8.5 Alloy : 1.3.0 CLI - 3.2.0 Device: Samsung Galaxy S4 running android 4.2.2

JSON Source