# Fire Beta: Unable to run template Android Application (Swift)

**URL:** https://talk.remobjects.com/t/fire-beta-unable-to-run-template-android-application-swift/8246
**Category:** Fire
**Tags:** fire
**Created:** [February 24, 2016, 9:35am UTC](https://talk.remobjects.com/t/fire-beta-unable-to-run-template-android-application-swift/8246 "2016-02-24T09:35:14Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Loreto\_Parisi](https://talk.remobjects.com/user_avatar/talk.remobjects.com/loreto_parisi/32/1926_2.png) [@Loreto\_Parisi](https://talk.remobjects.com/u/Loreto_Parisi)
#### Post date: [February 24, 2016, 9:35am UTC](https://talk.remobjects.com/t/fire-beta-unable-to-run-template-android-application-swift/8246/1 "2016-02-24T09:35:14Z")

</div>

I have created a brand new template Android Application (Swift), and I cannot run on the device since latest version of Fire beta.  
I see the device connected in the devices list, and the target disabled in the targets list.

 ![](https://talk.remobjects.com/uploads/default/original/2X/2/2bf57bc9b9981610553baf3673871660d7856c8b.jpg)

The same happens in a more complex project with several solutions (like iOS, Shared libraries, etc), as showed in the next screenshot:

 ![](https://talk.remobjects.com/uploads/default/original/2X/3/3f813f16436ae10d0ac9c244d21a1c177081ec8f.jpg)

You can see that only the iOS target is active, while the Android is grayed. The device is in the devices list.

The device is unlocked as a developer device, and it is seen by adb:

```
macbookproloreto:MXMPortableNETLib admin$ adb devices
List of devices attached
0a21584f	device

```

In the project settings I see an “Unexpected value” in `CrossBox Device ID`:

 ![](https://talk.remobjects.com/uploads/default/original/2X/e/ed313719f0f2cfa8970c935161a256fb05743955.jpg)

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 24, 2016, 1:15pm UTC](https://talk.remobjects.com/t/fire-beta-unable-to-run-template-android-application-swift/8246/2 "2016-02-24T13:15:32Z")

</div>

Is the output type set to Library or to Executable? Try setting it to Executable.

---

<div class="post-metadata">

### Author: ![Loreto\_Parisi](https://talk.remobjects.com/user_avatar/talk.remobjects.com/loreto_parisi/32/1926_2.png) [@Loreto\_Parisi](https://talk.remobjects.com/u/Loreto_Parisi)
#### Post date: [February 24, 2016, 1:19pm UTC](https://talk.remobjects.com/t/fire-beta-unable-to-run-template-android-application-swift/8246/3 "2016-02-24T13:19:59Z")

</div>

@mh didn’t change that, how to do?

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 24, 2016, 1:22pm UTC](https://talk.remobjects.com/t/fire-beta-unable-to-run-template-android-application-swift/8246/4 "2016-02-24T13:22:01Z")

</div>

It’s in Settings. I did change Fire to be stricter, and not allow Library projects to run. I’ll review though how that applies to Android, and whether to fix the template, or tweak the logic in Fire further.

---

<div class="post-metadata">

### Author: ![Loreto\_Parisi](https://talk.remobjects.com/user_avatar/talk.remobjects.com/loreto_parisi/32/1926_2.png) [@Loreto\_Parisi](https://talk.remobjects.com/u/Loreto_Parisi)
#### Post date: [February 24, 2016, 1:29pm UTC](https://talk.remobjects.com/t/fire-beta-unable-to-run-template-android-application-swift/8246/5 "2016-02-24T13:29:56Z")

</div>

Ah weird, here is:

```
<ProjectGuid>929B265F-D81D-4090-8C42-E860E7192630</ProjectGuid>
    <OutputType>Library</OutputType>

```

So it was a default settings that was wrong, while in the iOS template is

```
<RootNamespace>iOSSilverSampleApp</RootNamespace>
        <ProjectGuid>D4CFC236-2049-4544-B9F4-999B053B9F53</ProjectGuid>
        <OutputType>executable</OutputType>
        <AssemblyName>iOSSilverSampleApp</AssemblyName>
```

---

<div class="post-metadata">

### Author: ![Loreto\_Parisi](https://talk.remobjects.com/user_avatar/talk.remobjects.com/loreto_parisi/32/1926_2.png) [@Loreto\_Parisi](https://talk.remobjects.com/u/Loreto_Parisi)
#### Post date: [February 24, 2016, 1:31pm UTC](https://talk.remobjects.com/t/fire-beta-unable-to-run-template-android-application-swift/8246/6 "2016-02-24T13:31:28Z")

</div>

…uhm maybe it needs something elsewhere:

Errors:

```
/Users/admin/Projects/MusiXmatch/MXMPortableNETLib/MXMSilverSDK.sln (Build) ->
(Build target) ->
/Users/admin/Projects/MusiXmatch/MXMPortableNETLib/Samples/AndroidSilverSampleApp/AndroidSilverSampleApp.elements (default targets) ->
/Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Oxygene/RemObjects.Oxygene.Cooper.Common.targets (CoreCompile target) ->

        : error E103: Could not find a "Main" method in this project
```

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 24, 2016, 2:08pm UTC](https://talk.remobjects.com/t/fire-beta-unable-to-run-template-android-application-swift/8246/7 "2016-02-24T14:08:19Z")

</div>

Yeah, i’ll need to revert Fire to allow running libraries for _Android_ (but not for plain Java)

---

<div class="post-metadata">

### Author: ![Loreto\_Parisi](https://talk.remobjects.com/user_avatar/talk.remobjects.com/loreto_parisi/32/1926_2.png) [@Loreto\_Parisi](https://talk.remobjects.com/u/Loreto_Parisi)
#### Post date: [February 24, 2016, 2:10pm UTC](https://talk.remobjects.com/t/fire-beta-unable-to-run-template-android-application-swift/8246/8 "2016-02-24T14:10:17Z")

</div>

ah so it changed since previous version (I was able to run the android app template)…? Thanks.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 24, 2016, 2:31pm UTC](https://talk.remobjects.com/t/fire-beta-unable-to-run-template-android-application-swift/8246/9 "2016-02-24T14:31:07Z")

</div>

Yes, that was a fret change in Fire; an over-eager one it turns out 😉

---

<div class="post-metadata">

### Author: ![Loreto\_Parisi](https://talk.remobjects.com/user_avatar/talk.remobjects.com/loreto_parisi/32/1926_2.png) [@Loreto\_Parisi](https://talk.remobjects.com/u/Loreto_Parisi)
#### Post date: [February 29, 2016, 10:06am UTC](https://talk.remobjects.com/t/fire-beta-unable-to-run-template-android-application-swift/8246/10 "2016-02-29T10:06:57Z")

</div>

Ok, so I have updated Fire.  
I have started from scratch a new `Android Application` project in the current solution.  
Now I can run this kind of template project.

The console prints

```
Installing org.me.androidsilversampleapp
Calling adb -s 0a21584f install -r "/Users/admin/Projects/MusiXmatch/MXMPortableNETLib/Samples/AndroidSilverSampleApp/./bin/Release/AndroidSilverSampleApp.apk"

```

I had to set the configuration to `Release` for this target.

and then it freezes for a while and then:

```
The process failed to start with the following error:

Starting: Intent { cmp=org.me.androidsilversampleapp/.MainActivity }

```

I have just created a project without any change so I have a basic

```
public class MainActivity: Activity {

	public override func onCreate(savedInstanceState: Bundle!) {
		super.onCreate(savedInstanceState)
		ContentView = R.layout.main
	}
}

```

If I open Android Monitor from AndroidStudio, I can see:

```
02-29 11:03:27.430 605-1260/? I/ActivityManager: Force stopping org.me.androidsilversampleapp appid=10086 user=-1: set debug app
02-29 11:03:27.430 605-1260/? I/ActivityManager: START u0 {flg=0x10000000 cmp=org.me.androidsilversampleapp/.MainActivity} from uid 2000 on display 0
02-29 11:03:27.449 8038-8038/? D/AndroidRuntime: Shutting down VM
02-29 11:03:27.466 605-1367/? I/ActivityManager: Start proc 8059:org.me.androidsilversampleapp/u0a86 for activity org.me.androidsilversampleapp/.MainActivity
02-29 11:03:27.504 717-717/? V/PhoneStatusBar: setLightsOn(true)
02-29 11:03:27.511 8059-8059/? W/ActivityThread: Application org.me.androidsilversampleapp is waiting for the debugger on port 8100...

```

as it was likely waiting for debugger (even if the target was set to `Release`).

In Settings the `CrossBox Device ID` is still `unexpected value`.

If I try to set to `Debug` configuration I get a “unable to deploy” error instead, after freezing and I can see on the Nexus 7 a alert entitled `Waiting for Debugger`.

---

<div class="post-metadata">

### Author: ![Loreto\_Parisi](https://talk.remobjects.com/user_avatar/talk.remobjects.com/loreto_parisi/32/1926_2.png) [@Loreto\_Parisi](https://talk.remobjects.com/u/Loreto_Parisi)
#### Post date: [March 3, 2016, 3:01pm UTC](https://talk.remobjects.com/t/fire-beta-unable-to-run-template-android-application-swift/8246/11 "2016-03-03T15:01:36Z")

</div>

@mh I did further tests and I can see that for this Android Application here:

> **[swift-promise-example/SampleAndroidAppFire at master ·...](https://github.com/loretoparisi/swift-promise-example/tree/master/SampleAndroidAppFire)**
>
> master/SampleAndroidAppFire

The app hangs on a brand new install of the `Xamarin Android Player / Nexus 7 (marshmallow)`

 ![](https://talk.remobjects.com/uploads/default/original/2X/4/4ad0b2f4de912432fac428e4cdfac44a2dd5e9e6.jpg) 

This is what happens on a real device too (Nexus 7 as well);

Both devices are attached to the `adb`:

```auto
macbookproloreto:~ admin$ adb devices
List of devices attached
10.71.34.101:5555	device
0a21584f	device

```

and I can run from `Fire` so I see from the CrossBox devices popup then.

I confirm that the configuration of devices / adb / android seems to be ok, since

- Using Fire on a real Nexus 7 device I the same “Waiting for Debugger” popup and then the error;
- Using `AndroidStudio` I can run the project without this debugging error. The AndroidStudio project can be found here: [swift-promise-example/SampleAndroidApp at master · loretoparisi/swift-promise-example · GitHub](https://github.com/loretoparisi/swift-promise-example/tree/master/SampleAndroidApp)

This is the emulator logs (That hangs running from Fire):

```
03-03 16:22:27.856 1491 1491 D AndroidRuntime: Shutting down VM
03-03 16:22:27.863 330 957 I ActivityManager: Start proc 1501:org.me.androidsilversampleapp/u0a52 for activity org.me.androidsilversampleapp/.MainActivity
03-03 16:22:27.871 1491 1494 I art : Debugger is no longer active
03-03 16:22:27.889 1501 1501 W ActivityThread: Application org.me.androidsilversampleapp is waiting for the debugger on port 8100...
03-03 16:22:27.890 1501 1501 I System.out: Sending WAIT chunk
03-03 16:22:27.926 330 1296 I OpenGLRenderer: Initialized EGL, version 1.4
03-03 16:22:27.949 805 955 E Surface : getSlotFromBufferLocked: unknown buffer: 0xaf0f2380
03-03 16:22:27.956 330 1296 W EGL_xap : eglSurfaceAttrib not implemented
03-03 16:22:27.956 330 1296 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x9db933e0, error=EGL_SUCCESS
03-03 16:22:28.093 1501 1507 I art : Ignoring second debugger -- accepting and dropping
03-03 16:22:31.456 330 563 D TaskPersister: removeObsoleteFile: deleting file=16_task.xml
03-03 16:22:31.456 330 563 D TaskPersister: removeObsoleteFile: deleting file=16_task_thumbnail.png
03-03 16:22:37.851 330 394 W ActivityManager: Launch timeout has expired, giving up wake lock!
03-03 16:22:41.665 330 534 E WifiStateMachine: WifiStateMachine CMD_START_SCAN source -2 txSuccessRate=0.00 rxSuccessRate=0.00 targetRoamBSSID=any RSSI=-55
03-03 16:23:01.667 330 534 E WifiStateMachine: WifiStateMachine CMD_START_SCAN source -2 txSuccessRate=0.00 rxSuccessRate=0.00 targetRoamBSSID=any RSSI=-55

```

I don’t get what means this message from `Art`:

```
  03-03 16:22:27.871 1491 1494 I art : Debugger is no longer active

```

that makes a lot of sense as soon as we look at the popup on the device emulator.  
So the issue was that running as a `Release` configuration it start debugging, while running as `Debug` configuration, debugging starts since I can see:

```
03-03 16:26:13.967 1593 1599 I art : Debugger is active
03-03 16:26:13.983 1593 1593 I System.out: Debugger has connected
03-03 16:26:16.193 1593 1593 I System.out: waiting for debugger to settle...
03-03 16:26:16.282 330 563 D TaskPersister: removeObsoleteFile: deleting file=19_task.xml
03-03 16:26:16.282 330 563 D TaskPersister: removeObsoleteFile: deleting file=19_task_thumbnail.png
03-03 16:26:16.394 1593 1593 I System.out: debugger has settled (1425)

```

To recap, the `Release` configuration seems to start a debugging session, that is the error (not sure it’s my side or `Android Application` template side…
