rapidpro / surveyor

Android client for executing RapidPro flows offline.
http://rapidpro.io
ISC License
15 stars 12 forks source link

Bug when using regex #25

Closed NelsonGNP closed 6 years ago

NelsonGNP commented 6 years ago

Hi guys,

I´m trying to use a regex to filter some answers, however, on android version 7+ the app is not handling the query (see attached). ps.: it works on older versions like 6.1, so I think that the Android SDK that handles regex, has changed after this version.

screenshot_20180611-120433

surveyor-debug.txt

rowanseymour commented 6 years ago

Interesting. This is coming from Pattern.compile(...) which supports the flag Pattern.UNICODE_CHARACTER_CLASS in Java 1.7 but not in earlier versions. We handle this by using reflection in https://github.com/rapidpro/expressions/blob/master/java/src/main/java/io/rapidpro/expressions/utils/ExpressionUtils.java#L224 to determine if that constant is defined... maybe there is a version of the Android SDK where it's defined but not supported?

NelsonGNP commented 6 years ago

I tested on an Android 7.1.2, and a colleague tested on 8.1.0, both versions didn´t work, and when a colleague tested with an Andoird 6, worked.

rowanseymour commented 6 years ago

Yeah you're right - looks like that constant is defined but not supported on Android 7+.. will make make changes to remove it