# API KEY ERROR

**URL:** <https://forums.fusetools.com/t/api-key-error/3761>\
**Category:** Bug Reports\
**Created:** [March 13, 2017, 7:37pm UTC](https://forums.fusetools.com/t/api-key-error/3761 "2017-03-13T19:37:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rodrigo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/rodrigo/32/117_2.png) [@Rodrigo](https://forums.fusetools.com/u/Rodrigo)\
**Post date:** [March 13, 2017, 7:37pm UTC](https://forums.fusetools.com/t/api-key-error/3761/1 "2017-03-13T19:37:14Z")

</div>

Hi, i have an issue with MapView and its with the API Key, i don’t know what its going on, i write like the example says but the Android preview show to me an ERROR: java.lang.IllegalStateException: A required meta-data tag in your app’s AndroidManifest.xml does not exist.

---

<div class="post-metadata">

**Author:** ![Remi\_Pedersen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/remi_pedersen/32/432_2.png) [@Remi\_Pedersen](https://forums.fusetools.com/u/Remi_Pedersen)\
**Post date:** [March 14, 2017, 8:27am UTC](https://forums.fusetools.com/t/api-key-error/3761/2 "2017-03-14T08:27:19Z")

</div>

Please post the entire log output you get when trying to build.

---

<div class="post-metadata">

**Author:** ![Rodrigo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/rodrigo/32/117_2.png) [@Rodrigo](https://forums.fusetools.com/u/Rodrigo)\
**Post date:** [March 14, 2017, 7:50pm UTC](https://forums.fusetools.com/t/api-key-error/3761/3 "2017-03-14T19:50:52Z")

</div>

This is the log output i get:

```auto
LOG: Uno.Exception: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
       at Android.Base.JNI.TryGetException(Android.Base.Primitives.JNIEnvPtr,[string])
       at Android.Base.JNI.CheckException(Android.Base.Primitives.JNIEnvPtr,[string])
       at Android.Base.JNI.CheckException(Android.Base.Primitives.JNIEnvPtr)
       at Android.Base.Wrappers.JavaObjectHelper.JObjectToJWrapper(Android.Base.Primitives.ujobject,bool)
       at Fuse.Controls.MapView.CreateNativeView()
       at Fuse.Controls.Control.InjectTemplate()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.LayoutControl.OnRooted()
       at Fuse.Controls.Panel.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Visual.OnRooted()
       at Fuse.Elements.Element.OnRooted()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.LayoutControl.OnRooted()
       at Fuse.Controls.NativeViewHost.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Visual.OnRooted()
       at Fuse.Elements.Element.OnRooted()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.LayoutControl.OnRooted()
       at Fuse.Controls.Panel.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Visual.OnRooted()
       at Fuse.Elements.Element.OnRooted()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.ScrollViewBase.OnRooted()
       at Fuse.Controls.ScrollView.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Visual.OnRooted()
       at Fuse.Elements.Element.OnRooted()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.LayoutControl.OnRooted()
       at Fuse.Controls.Panel.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Visual.OnRooted()
       at Fuse.Elements.Element.OnRooted()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.LayoutControl.OnRooted()
       at Fuse.Controls.Panel.OnRooted()
       at Fuse.Controls.EdgeNavigator.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Visual.OnRooted()
       at Fuse.Elements.Element.OnRooted()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.LayoutControl.OnRooted()
       at Fuse.Controls.Panel.OnRooted()
       at Fuse.Controls.Page.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Node.Relate(Fuse.Visual,Fuse.Node)
       at Fuse.Visual.OnAdded(Fuse.Node)
       at Fuse.Visual.Insert(int,Fuse.Node)
       at Fuse.Visual.Add(Fuse.Node)
       at Fuse.Controls.Navigator.Prepare(Fuse.Controls.Navigator.NavPage,string&,string&,Fuse.Navigation.RoutingOperation,Fuse.Visual&,bool&)
       at Fuse.Controls.Navigator.Fuse.Navigation.IRouterOutlet.Goto(string&,string&,Fuse.Navigation.NavigationGotoMode,Fuse.Navigation.RoutingOperation,string,Fuse.Visual&)
       at Fuse.Navigation.Router.SetRouteImpl(Fuse.Visual,Fuse.Navigation.Route,Fuse.Navigation.NavigationGotoMode,Fuse.Navigation.RoutingOperation,string,Fuse.Navigation.IRouterOutlet&)
       at Fuse.Navigation.Router.SetRoute(Fuse.Navigation.Route,Fuse.Navigation.NavigationGotoMode,Fuse.Navigation.RoutingOperation,string,[bool])
       at Fuse.Navigation.Router.Modify(Fuse.Navigation.ModifyRouteHow,Fuse.Navigation.Route,Fuse.Navigation.NavigationGotoMode,string)
       at Fuse.Navigation.Router.Push(Fuse.Navigation.Route,[string])
       at Fuse.Navigation.Router.Push(Fuse.Scripting.Context,Fuse.Navigation.Router,object[])
       at Fuse.Scripting.ScriptMethod`1.CallClosure.Run()
       at Fuse.UpdateManager.ProcessPostActionsImpl()
       at Fuse.UpdateManager.ProcessPostActions()
       at Fuse.UpdateManager.Update()
       at Outracks.Simulator.Application.OnUpdate()
       at Fuse.App.OnTick(object,Uno.Platform.TimerEventArgs)
       at Uno.Platform.Display.OnTick(Uno.Platform.TimerEventArgs)
       at Uno.Platform.AndroidDisplay.OnFrameCallback(double,double)
LOG: InternalError: Failed to properly reset. Try exiting Fuse and restarting.: Incomplete or duplicate unrooting: Fuse.Controls.Page, Name: state/state in Outracks.Simulator.GeneratedApplication</usr/local/share/uno/Packages/Outracks.Simulator.Client.Uno/0.1.0/$.uno:94>
ERROR: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
    Uno.Exception occured.
       at Android.Base.JNI.TryGetException(Android.Base.Primitives.JNIEnvPtr,[string])
       at Android.Base.JNI.CheckException(Android.Base.Primitives.JNIEnvPtr,[string])
       at Android.Base.JNI.CheckException(Android.Base.Primitives.JNIEnvPtr)
       at Android.Base.Wrappers.JavaObjectHelper.JObjectToJWrapper(Android.Base.Primitives.ujobject,bool)
       at Fuse.Controls.MapView.CreateNativeView()
       at Fuse.Controls.Control.InjectTemplate()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.LayoutControl.OnRooted()
       at Fuse.Controls.Panel.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Visual.OnRooted()
       at Fuse.Elements.Element.OnRooted()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.LayoutControl.OnRooted()
       at Fuse.Controls.NativeViewHost.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Visual.OnRooted()
       at Fuse.Elements.Element.OnRooted()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.LayoutControl.OnRooted()
       at Fuse.Controls.Panel.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Visual.OnRooted()
       at Fuse.Elements.Element.OnRooted()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.ScrollViewBase.OnRooted()
       at Fuse.Controls.ScrollView.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Visual.OnRooted()
       at Fuse.Elements.Element.OnRooted()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.LayoutControl.OnRooted()
       at Fuse.Controls.Panel.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Visual.OnRooted()
       at Fuse.Elements.Element.OnRooted()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.LayoutControl.OnRooted()
       at Fuse.Controls.Panel.OnRooted()
       at Fuse.Controls.EdgeNavigator.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Visual.OnRooted()
       at Fuse.Elements.Element.OnRooted()
       at Fuse.Controls.Control.OnRooted()
       at Fuse.Controls.LayoutControl.OnRooted()
       at Fuse.Controls.Panel.OnRooted()
       at Fuse.Controls.Page.OnRooted()
       at Fuse.Node.RootInternalImpl(Fuse.Visual)
       at Fuse.Node.RootInternal(Fuse.Visual)
       at Fuse.Node.Relate(Fuse.Visual,Fuse.Node)
       at Fuse.Visual.OnAdded(Fuse.Node)
       at Fuse.Visual.Insert(int,Fuse.Node)
       at Fuse.Visual.Add(Fuse.Node)
       at Fuse.Controls.Navigator.Prepare(Fuse.Controls.Navigator.NavPage,string&,string&,Fuse.Navigation.RoutingOperation,Fuse.Visual&,bool&)
       at Fuse.Controls.Navigator.Fuse.Navigation.IRouterOutlet.Goto(string&,string&,Fuse.Navigation.NavigationGotoMode,Fuse.Navigation.RoutingOperation,string,Fuse.Visual&)
       at Fuse.Navigation.Router.SetRouteImpl(Fuse.Visual,Fuse.Navigation.Route,Fuse.Navigation.NavigationGotoMode,Fuse.Navigation.RoutingOperation,string,Fuse.Navigation.IRouterOutlet&)
       at Fuse.Navigation.Router.SetRoute(Fuse.Navigation.Route,Fuse.Navigation.NavigationGotoMode,Fuse.Navigation.RoutingOperation,string,[bool])
       at Fuse.Navigation.Router.Modify(Fuse.Navigation.ModifyRouteHow,Fuse.Navigation.Route,Fuse.Navigation.NavigationGotoMode,string)
       at Fuse.Navigation.Router.Push(Fuse.Navigation.Route,[string])
       at Fuse.Navigation.Router.Push(Fuse.Scripting.Context,Fuse.Navigation.Router,object[])
       at Fuse.Scripting.ScriptMethod`1.CallClosure.Run()
       at Fuse.UpdateManager.ProcessPostActionsImpl()
       at Fuse.UpdateManager.ProcessPostActions()
       at Fuse.UpdateManager.Update()
       at Outracks.Simulator.Application.OnUpdate()
       at Fuse.App.OnTick(object,Uno.Platform.TimerEventArgs)
       at Uno.Platform.Display.OnTick(Uno.Platform.TimerEventArgs)
       at Uno.Platform.AndroidDisplay.OnFrameCallback(double,double)

```

---

<div class="post-metadata">

**Author:** ![Baggers](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/baggers/32/665_2.png) [@Baggers](https://forums.fusetools.com/u/Baggers)\
**Post date:** [March 15, 2017, 8:58am UTC](https://forums.fusetools.com/t/api-key-error/3761/4 "2017-03-15T08:58:22Z")

</div>

Hi Rodrigo, I’ll jump into this too. Could you post your `unoproj` file. Usually the reason for the gms stuff not being set is Uno not seeing the api key in your `unoproj`

---

<div class="post-metadata">

**Author:** ![Rodrigo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/rodrigo/32/117_2.png) [@Rodrigo](https://forums.fusetools.com/u/Rodrigo)\
**Post date:** [March 15, 2017, 9:39pm UTC](https://forums.fusetools.com/t/api-key-error/3761/5 "2017-03-15T21:39:09Z")

</div>

Hey Chris, This my unoproj:  
{  
“RootNamespace”:“Zeo.Pettz”,  
“Android”:{  
“Package”: “com.Zeo.Pettz”,  
“PreviewPackage”: “com.Zeo.Pettz.preview”,  
“Geo”:{  
“com.google.android.geo.API\_KEY”:“AIzaSyB6SayIseHqfozDaLGyTd1FCqOEi2ZKMjo”  
}  
},  
“Packages”: [  
“Fuse.Maps”,  
“Fuse”,  
“FuseJS”,  
“Fuse.GeoLocation”  
],  
“Includes”: [  
“_",  
"Modules/_”,  
“Pages/\*.js:Bundle”  
]  
}

---

<div class="post-metadata">

**Author:** ![Rodrigo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/rodrigo/32/117_2.png) [@Rodrigo](https://forums.fusetools.com/u/Rodrigo)\
**Post date:** [March 15, 2017, 9:44pm UTC](https://forums.fusetools.com/t/api-key-error/3761/6 "2017-03-15T21:44:31Z")

</div>

> **Rodrigo wrote:**
> 
> Hey Chris, This my unoproj:
> 
> {  
> “RootNamespace”:“Zeo.Pettz”,  
> “Android”:{  
> “Package”: “com.Zeo.Pettz”,  
> “PreviewPackage”: “com.Zeo.Pettz.preview”,  
> “Geo”:{  
> “com.google.android.geo.API\_KEY”:“AIzaSyB6SayIseHqfozDaLGyTd1FCqOEi2ZKMjo”  
> }  
> },  
> “Packages”: [  
> “Fuse.Maps”,  
> “Fuse”,  
> “FuseJS”,  
> “Fuse.GeoLocation”  
> ],  
> “Includes”: [  
> “_",  
> "Modules/_”,  
> “Pages/\*.js:Bundle”  
> ]  
> }

---

<div class="post-metadata">

**Author:** ![Baggers](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/baggers/32/665_2.png) [@Baggers](https://forums.fusetools.com/u/Baggers)\
**Post date:** [March 16, 2017, 10:07am UTC](https://forums.fusetools.com/t/api-key-error/3761/7 "2017-03-16T10:07:33Z")

</div>

Cool, I see the problem, the way you have added the api-key is incorrect. Have a peek at documentation here: [https://www.fusetools.com/docs/fuse/controls/mapview](https://www.fusetools.com/docs/fuse/controls/mapview)

Here is the important section:

```auto
Google Maps requires a valid Google Maps API key. Follow Google's 
documentation to get one set up. Once you have your key it must be 
added to your project file, as shown below

 "Android": {
   "Geo": {
        "ApiKey": "your_key_here"
    }
}

```

In your `unoproj` you have:

```auto
  "Android": {
    "Geo": {
      "com.google.android.geo.API_KEY": "AIzaSyB6SayIseHqfozDaLGyTd1FCqOEi2ZKMjo"
    },
    "PreviewPackage": "com.Zeo.Pettz.preview",
    "Package": "com.Zeo.Pettz"
  }

```

So try changing `com.google.android.geo.API_KEY` to `ApiKey`

I hope this helps!

---

<div class="post-metadata">

**Author:** ![Rodrigo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/rodrigo/32/117_2.png) [@Rodrigo](https://forums.fusetools.com/u/Rodrigo)\
**Post date:** [March 17, 2017, 5:20am UTC](https://forums.fusetools.com/t/api-key-error/3761/8 "2017-03-17T05:20:13Z")

</div>

thank’s a lot, i’ll try this

---

<div class="post-metadata">

**Author:** ![Rodrigo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/rodrigo/32/117_2.png) [@Rodrigo](https://forums.fusetools.com/u/Rodrigo)\
**Post date:** [March 17, 2017, 9:43pm UTC](https://forums.fusetools.com/t/api-key-error/3761/9 "2017-03-17T21:43:53Z")

</div>

Thank you very much Chris Bagley this solve the problem, so thanks a lot.
