What do I need for Android development?

Running “add devices” from where? A command line thingee? The Android Device Manager? Something else?

Android Studio picked it up ok already, just not VS.

… time passes …

After going in and out of Android Studio and VS a couple of times and the Android Device Manager, I noticed that a prompt for allowing the device came up on the phone. I "ok"ed it. After going back into VS again, and checking the Crossbox, the device was showing up again.

Maybe some sort of slow Android thing going on again.

Looks like I’m back in business again, except for having lost the virtual device emulators that were there before. Don’t know how to get those back. I guess I can create some manually, but would have been good to have a couple to model after, at least.

sorry “adb devices”. it got auto-corrected. Check out https://docs.elementscompiler.com/Fire/Devices/.

Ah, thanks for the link.

1 Like

I’m still trying to resolve my emulator problems. After I make an app and test it on my actual device, I’d like to see how it runs on some emulators.

I think uninstalling Android Studio and re-installing it messed things up, but it might have been something else was updated, like VS. Here is my current situation.

I can launch the Android device manager from VS. I configured one and started it. Takes a while to come up, but it is up and responding to clicks, etc.

The name of the device is “mydevice”. In Water, at the right side it shows:
"Android emulator mydevice 1(Not booted up)

So it can’t run on that emulator. Not sure where the “1” came from, but I did rename the emulator from “My Device” to “mydevice” because I was afraid it was having trouble finding a name with a space in it.

In VS, CrossBox shows:

“local: Android Emulator mydevice 1”

But doesn’t say it isn’t booted. But when I try to run, I get:

------ Build started: Project: org.me.androidapplication7, Configuration: Debug ------
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
Running C:\Users\mtied\AppData\Local\Android\sdk\tools\emulator.exe -avd mydevice_1 -verbose
Emulator has terminated.
Error debugging project: Android Emulator mydevice 1 failed to boot. Missing emulator engine program for 'x86' CPU.

That is the same message I get in Water in the “debug console” if I try to run an app in Water.

I tried going into the SDK manager in VS and added a bunch of x86 things, but it didn’t make a difference.

I also read on the web that there was an update a while ago that changed the emulator from being in tools/emulator to emulator/emulator (or vice versa). I see emulator.exe in BOTH, so I don’t think that is a problem.

Are there clues here is to what is screwed up and how to fix it?

… time passes …

I found something on the web about setting ANDROID_SDK_ROOT environment variable. When I did that, Water DID launch a new emulator I created that used Nougat 7.1.

Maybe the path environment variable was there and the uninstall removed it and then the re-install did not add it back? This might be the problem. Trying things out now…

For one, can you use Water for now? as that eliminates one extra layer of complexity for troubleshooting, as I know exactly what Water does for Android support, while in VS there’s a few more layers of indirection…

it sows that even though it IS booted up?

Could be that VS just doesn’t show that extra status.

both VS and Water should try and bot the emulator up for you, as needed.

Running C:\Users\mtied\AppData\Local\Android\sdk\tools\emulator.exe -avd mydevice_1 -verbose
Emulator has terminated.
Error debugging project: Android Emulator mydevice 1 failed to boot. Missing emulator engine program for ‘x86’ CPU.

there you go — that sounds like a misconfigured emulator.

as the link from before states:

Troubleshooting Note : The IDE only sees devices listed by the abd devices and emulator -list-advs command line tools, since those are its interface to the Android SDK.

Whenever physical a device does not show in adb devices `, the IDE will not see it, by design , and the problem needs to be sorted out between the system and the Android SDK. Fire and Water can only show the devices reported by the Android SDK, and this is the query point it uses; everything below that is outside of our control.

we use the regular Android toolchain APIs for dealing with devices and emulators. When those fail, that’s out of our control.

I neve rused VS’s own Android tools, such as its SDK manager. try suing there SDK Manager and Device Manager in Android Studio, or the emulator command line, as those are the official tools for this.

As for the concrete error (Missing emulator engine program for 'x86' CPU), I have no clue what that might indicate.

Maybe. do you see/have an Android SDK folder specified in Water preferences? Water should detect the default, and/or if you override it there, whatever rvalue you see there is what we’ll use. That said, it might well be that the Android SDK tools themselves, internally, require ANDROID_SDK_ROOT to be set properly — I wouldn’t know about that…

Ok, let’s start over from Water.

I launch Water and create a new Android Application. I do a build and I get this:

"C:\Program Files (x86)\RemObjects Software\Elements\Bin\EBuild.exe" "C:\Users\xxx\Documents\RemObjects Software\Elements\Water\Android\org.me.androidapplication4\org.me.androidapplication4.sln" --logger:fire --configuration:Debug --verbosity:normal "--xml:C:\Users\xxx\Documents\RemObjects Software\Elements\Water\Android\org.me.androidapplication4\obj\org.me.androidapplication4.water.xml" --build --setting:TreatFixableErrorsAsWarnings=True
RemObjects EBuild. An open source build engine for Elements and beyond.
Copyright RemObjects Software 2016-2019. All Rights Reserved. Created by marc hoffman.
Version 10.0.0.2385 (develop) built on talax, 20190315-162227. Commit aab5759.

   Android SDK found in 'C:\Program Files (x86)\Android\android-sdk'.
   Android Build Tools found in 'C:\Program Files (x86)\Android\android-sdk\build-tools\25.0.3'.
   Android ApkBuilder found in 'C:\Program Files (x86)\Android\android-sdk\tools\lib\sdklib-26.0.0-dev.jar;C:\Program Files (x86)\Android\android-sdk\tools\lib\sdk-common-26.0.0-dev.jar;C:\Program Files (x86)\Android\android-sdk\tools\lib\common-26.0.0-dev.jar'.
   No exact platform version was specified for target 'Cooper-Android', using android-28.
   Found Android Manifest: 'C:\Users\xxx\Documents\RemObjects Software\Elements\Water\Android\org.me.androidapplication4\Properties\AndroidManifest.android-xml'.
   Android build version is '28'.
   Android manifest file is 'C:\Users\xxx\Documents\RemObjects Software\Elements\Water\Android\org.me.androidapplication4\Properties\AndroidManifest.android-xml'.
   Reference 'android' was resolved to 'C:\Program Files (x86)\Android\android-sdk\platforms\android-28\android.jar' for target 'Cooper-Android'.
   Reference 'cooper' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Cooper\cooper.jar' via XML for target 'Cooper-Android'.
   Reference 'elements' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Cooper\elements.jar' via XML for target 'Cooper-Android'.
   RemObjects Elements (Oxygene, C#, Swift and Java) Compiler for .NET, Cocoa, Java and Island.
   Version 10.0.0.2385 (develop) built on talax, 20190315-162227. Commit aab5759.
   Copyright 2003-2019 RemObjects Software, LLC. All rights reserved.
   
   Source file: C:\Users\xxx\Documents\RemObjects Software\Elements\Water\Android\org.me.androidapplication4\MainActivity.pas
   Source file: C:\Users\xxx\AppData\Local\RemObjects Software\EBuild\Obj\org.me.androidapplication4-10DD391998BF211E64974A4632F23ED6388C3F59\Debug\Cooper-Android\r\R.java
   Reference: C:\Program Files (x86)\Android\android-sdk\platforms\android-28\android.jar
   Reference: C:\Program Files (x86)\RemObjects Software\Elements\References\Cooper\cooper.jar
   Reference: C:\Program Files (x86)\RemObjects Software\Elements\References\Cooper\elements.jar
E: dex: Unknown option --min-sdk-version=5
   Project 'org.me.androidapplication4' failed to build.
   Solution 'org.me.androidapplication4' failed to build all projects.

So what is it telling me about min sdk? It sounds like it doesn’t even know that tagged keyword?

Here was the auto generated project manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.me.androidapplication4"
    android:versionCode="1"
    android:versionName="1.0">
    <application
        android:label="@string/app_name"
        android:icon="@drawable/icon">
        <activity android:label="@string/app_name" android:name="org.me.androidapplication4.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="5"/>
</manifest>

your android sdk is (very) outdated, if you get the “unknown option” error.

Thanks, logged as bugs://82294 (to catch that error message and provide a more detailed message, as this seems to be popping up way too often).

As far as I know, I downloaded the LATEST from the developer.android.org, 3.3.2. Is that not the latest?

Oh, that is the latest Studio. I think IT put the version of the SDK there. Let’s see if I can find the version of it…

It looks like my Android Studio has the option of downloading a bunch of SDK versions, but seems to have just Android 9 (Pie) “installed” according to the manager.

I thought it a little odd that the option name in the error message has "-"s in it whereas the option has no dashes.

As far as I know that option is valid. Although in Android Studio, it says the option will be ignored because it uses the values in Gradle (whatever that is) which doesn’t seem to be present for Water.

… time passes …

If I take the line out, it doesn’t complain. That line was put in by the “default” android application template.

… time passes …

I THINK maybe Water is looking in the wrong place for the emulator. It looks to be looking in the Tools subfolder and I think the latest version of stuff puts it in Emulator.

The last of the build has:

Running "C:\Program Files (x86)\Android\android-sdk\tools\emulator.exe" -avd mydevice_1 -verbose
Emulator has terminated.

This thread is starting to conflate half a dozen separate issues, and it’s getting confusing and hard to follow up on. can we split this up?

this error is for the `–min-sdk-version=5" option being passed to the DEX tool. (very) old versions don’t support that option, you seem to have an old version.

Not sure what to tell ya, but given:

Running “C:\Program Files (x86)\Android\android-sdk\tools\emulator.exe” -avd mydevice_1 -verbose
Emulator has terminated.

clearly it does exist there, else it couldn’t run and emit that error?

I just checked there very latest SDK< and indeed --min-sdk-version still works fine, so it’s not that they dropped this again:

D: /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/bin/java -Xmx1024M -jar /Users/Shared/Android/sdk/build-tools/29.0.0-rc2/lib/dx.jar --dex --verbose --min-sdk-version=5 --incremental "--output=/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/com.remobjects.androidapplication49-1C0E2D3BFCECC7732F7689D4A8B66E9A96E94F63/Debug/Cooper-Android/classes.dex" --positions=lines "/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/com.remobjects.androidapplication49-1C0E2D3BFCECC7732F7689D4A8B66E9A96E94F63/Debug/Cooper-Android/com.remobjects.androidapplication49.jar" /Users/mh/Code/Elements/Bin/References/Cooper/cooper.jar
...

Can you enable “Diagnostic” build log level in Water preferences, so you too can see what exact version of DX is being run for you when you get the error?

thanx.

As for the emulator error: this is odd: I’. getting the same error here with my previously configured Emulator as you do (Android Emulator Nexus 5X API P failed to boot. Missing emulator engine program for 'x86' CPU.), but that doesn’t seem specific to Water, as the same emulator also fails to boot in Android Studio, so I guess it just got stale or outdated somewhere along the way. I created a new one in Android Studio, and that one boots up fine both there in in Fire/Water. I suggest you do the same, delete the old emulators and set up a fresh one.

I had already uninstalled the Android Studio and re-installed, but I can do that again. After I did it last time, there were no “old emulators” to delete. And by deleting the old emulators, do you mean remove them from the device manager, or something else?

What is the “Dex tool”? I assume that gets installed as part of the Android Studio? If not, where does one get that?

As for the location of the emulator, BOTH folders exist. Don’t know if their contents are the same or different, but it might be that Water needs to determine which one is supposed to currently be used. Just a thought.

As for the “–min-sdk-version=5”, are you saying that the xml file has the name without the dashes and then something is invoked where those dashes get put in for the option for Dex?

… going off to reinstall Android Studio, again. And I’ll try to enable “Diagnostic build log level”. After those findings, I’ll start a new thread …

Doesn’t really matter, you can leave em, there if you want. the point is, create a new one and use that. But yes, I meant to remove them form device manager by hitting the trashcan button.

Yeah, but nothing in the error message yo ar getting indicates to me that this is the problem…

There’s a project option AndroidMinimumSDKVersion. you have it set to 5. That setting drives the command line parameter for DX, which is --min-sdk-version=*, and it drives the value being put into your XML file. Your version of Android tools is too old to understand the option. (and why are we discussing this in two threads, now?)

bugs://82294 got closed with status fixed.