Failed to build 5.2.2/android missing org.apache.http

Looks like a missing dependency?

Not sure why this would build for anybody else.

My Android SDK is up-to-date. (Maybe that's a problem!)

I tried with NDK n9d based on other posts on the thread.

PWD: /Users/jon/.rvm/gems/ruby-2.2.3@watusi-rhodes-5.2.2-75fd4c2/gems/rhodes-5.2.2

CMD: /Library/Java/Home/bin/javac -g -d /Users/jon/workspace/xxxxx/mobile_app/build/android/jxxxxx/development/bin/tmp/Rhodes -source 1.6 -target 1.6 -nowarn -encoding latin1 -classpath /Users/jon/sdk/android/sdk/platforms/android-23/android.jar:/Users/jon/workspace/xxxxx/mobile_app/build/android//xxxxx/development/bin/tmp/Rhodes:/Users/jon/sdk/android/sdk/extras/android/support/v4/android-support-v4.jar @/Users/jon/workspace/xxxxx/mobile_app/build/android/xxxxx/development/bin/tmp/RhodesSRC_build.files

platform/android/Rhodes/src/com/rhomobile/rhodes/event/Event.java:34: package org.apache.http.impl.cookie does not exist

import org.apache.http.impl.cookie.DateUtils;

                                  ^

platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Request.java:35: package org.apache.http does not exist

import org.apache.http.HttpResponse;

                      ^

platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Request.java:36: package org.apache.http.client does not exist

import org.apache.http.client.HttpClient;

                             ^

platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Request.java:37: package org.apache.http.client.methods does not exist

import org.apache.http.client.methods.HttpGet;

                                     ^

platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Request.java:38: package org.apache.http.impl.client does not exist

import org.apache.http.impl.client.DefaultHttpClient;

                                  ^

platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Request.java:192: cannot find symbol

symbol  : class HttpGet

location: class com.rhomobile.rhodes.mapview.Request

  private HttpGet mRequest;

         ^

platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapBitmapManager.java:35: package org.apache.http does not exist

import org.apache.http.HttpResponse;

                      ^

platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapBitmapManager.java:36: package org.apache.http.client does not exist

import org.apache.http.client.HttpClient;

                             ^

platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapBitmapManager.java:37: package org.apache.http.client.methods does not exist

import org.apache.http.client.methods.HttpGet;

                                     ^

platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapBitmapManager.java:38: package org.apache.http.impl.client does not exist

import org.apache.http.impl.client.DefaultHttpClient;

Jon Tara
Tried with Java7 SDK (now

Tried with Java7 SDK (now required by Android tools?) and with NDK 10e. Neither one made a difference.

This is apparently required by MapView? I don't use a MapView...

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
I manually added the .jars

I manually added the .jars from:

    https://hc.apache.org/downloads.cgi

to my Java7 SDK and is seems to have solved it.

FYI, I was able to build with NDK r10e. Previous Rhodes versions were unable to build with > r9D, but unsure if there are still other issues if we use r10e.

If there are additional components we need to install in the Java SDK, they should be documented. Maybe the RhoStudio installer installs them - I only use the Rhodes Gem.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
If you build with NDK N10e,

If you build with NDK N10e, the app immediately exits on ARM hardware.

It seems to run on X86 hardware.

So, I still build with N9D.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Mark Nongkhlaw
Sounds like you're facing

Sounds like you're facing same problem like Poonam Sharma. Pls check out Rhomobile Google group (yeah, people are still using it!)

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
I'm thinking now the issue is

I'm thinking now the issue is a missing prerequisite in API 23. I figured I should update my Android SDK when I updated Rhodes, maybe that was a bad idea. Maybe they "crossed in the mail". (Rhodes 5.2.2 released, and then API 23 caught Rhodes unawares).

You'd think Rhodes would be able to indicate the highest API supported?

It's just a guess, though, because Android development is admittedly a bit of a mystery to me.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Mark Nongkhlaw
Well from that post on Google

Well from that post on Google groups, it looks like Android 6 which I believe corresponds to API level 23 is not supported yet (wasn't supported in 5.1.1 either). You could try building with API 22. You could set that in your app's build.yml. However, I haven't downloaded the latest release. So I'm just guessing.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
Dumb question...You could try

Dumb question...

You could try building with API 22. You could set that in your app's build.yml.

And how would I do that?

My impression was that build.yml android/version is only for simulator target. No?

I've been setting it to 4.4.2, probably not correct, then...

And actually, I haven't paid much attention to it, since I don't use a Google emulator, but GenyMotion instead. (So, I just build for dual X86/ARM devices.)

Should I be setting this to 5.1?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
Since I have been setting

Since I have been setting android/version to 4.4.2, clearly this will not fix the issue around org.apache.http.

Is there some undocumented way of setting the MAXIMUM API version?

LOL, yes, I just searches Rhodes 5.1.1 source. Why, of course, there is maxSDK. And not a word in the documentation!

build.yml android\\maxSDK is undocumented · Issue #312 · rhomobile/rhomobile-docs · GitHub

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
It seems you have to make

It seems you have to make sure you do not have API 23 installed.

I temporarily removed the org.apache.http components I had manually installed, set the undocumented maxSDK to 22 in build.yml, and did a clean build. Same error.

Only removing SDK 23 resolved the problem.

Not sure what - if anything - maxSDK does, other than setting maxSDK in the manifest. I suppose it is prudent, in any case.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Mark Nongkhlaw
Hmm. Thats news for me too. I

Hmm. Thats news for me too. I never used a maxSDK. But I did use a minSDK=11 in the past under the android: section of build.yml and that worked as expected.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
Actually, Google advises

Actually, Google advises against use of maxSDK. It works like minSDK - the app cannot be installed if device SDK > maxSDK. Android APIs are supposed to be backward-compatible, and so apps should run on newer APIs, but perhaps with compatibility features.

There is an additional setting, targetSDKVersion. This is a guarantee by the app that it was written for this SDK version, and so no compatibility features are needed if device API <= targetSDKVersion.

I searched Rhodes source, and targetSDKVersion is hard-coded to '12'. That seems awfully low, and would seem to kick-in a whole bunch of compatibility features...

This doesn't seem right... is Rhodes really written against SDK 12?

Although hard-coded, you can change it in your application's AndroidManifest.erb.

None of this (seems) to have any effect on how the project is built. (e.g. what SDK it builds against.) It (seems) to build against the highest SDK you have installed.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
Setting targetSDKVersion to

Setting targetSDKVersion to 22 "works", but... then CSS pixels are device pixels, and everything is TINY.

So, I guess we have to keep it at 12.

(Either way, System.screenWidth, system.screenHeight are wrong on Android, and always the same as System.realScreenWidth, System.realScreenHeight...)

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
Setting targetSDKVersion to

Setting targetSDKVersion to 14 (my current minSDK) doesn't have the problem with CSS pixels = device pixels, and does gain some behavior. For example, I now see the half-round semi-transparent overlay at top or bottom of the screen when I scroll to an edge.

Sure wish I knew what Rhodes is really doing with the SDK version numbers and what SDK levels are really supported... (whatever "supported" means)

I wound-up editing my AndroidManifest.erb like this. Seems to make sense... why would you set targetSDKVersion < minSDK?

  <!-- Android SDK -->

  <uses-sdk android:minSdkVersion='<%= @minSdkVer %>' android:targetSdkVersion='<%= @minSdkVer %>'

    <% if @maxSdkVer %>

      android:maxSdkVersion='<%= @maxSdkVer %>'

    <% end %>

  />

I might try bumping it up a notch at a time and see when the device pixel ratio breaks.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
FWIW, I was able to increase

FWIW, I was able to increase targetSDKVersion to 16 (JellyBean). At 19 (KitKat) it runs with devicePixelRatio of 1, and everything is tiny.

I don't know the exact breakpoint, but since 17 and 18 are just JellyBean revs, I'll give 18 a go.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Robert Galvin
JonThe maxSDK, minSDK, etc is

Jon

The maxSDK, minSDK, etc is only a runtime configuration in the Android manifest. It is not used during build. Rhodes will use whatever the latest API level is available to build the Android application. Currently there is no way to control the specific API that is used for building. The only workaround right now is to remove the Marhmallow API 23 and rebuild.

In platform-23, android has removed apache support which RhoMobile uses in Mapview. Please find the link below.https://developer.android.com/intl/es/preview/behavior-changes.html (Removing the Apache HTTP client)

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
So, it sounds like manual

So, it sounds like manual installation of the Apache HTTP support would be a workaround until Rhodes MapView is updated. (If one still wants to build with SDK 23.)

I don't think we'll be encountering Marshmallow in the wild for a bit, so for now I've uninstalled API 23.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Mark Nongkhlaw
IMHO removing an API level

IMHO removing an API level from the SDK just to make Rho build successfully is not the ideal solution. What if I need that same API for other purposes, e.g., development using other tools in the same dev machine that requires it?

Just the other day I tried to build an app with Ionic+Cordova with API 19 as the test device was on Kitkat. But it refused to build the apk till I included API 22.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments