diff --git a/code/app/build.gradle b/code/app/build.gradle index bc005aa9..1cef94c3 100644 --- a/code/app/build.gradle +++ b/code/app/build.gradle @@ -65,7 +65,9 @@ dependencies { implementation "com.adobe.marketing.mobile:core:2.+" implementation 'com.adobe.marketing.mobile:identity:2.+' - implementation 'com.adobe.marketing.mobile:edgeconsent:2.+' + implementation ('com.adobe.marketing.mobile:edgeconsent:2.+') { + transitive = false + } implementation 'com.adobe.marketing.mobile:assurance:2.+' implementation ('com.adobe.marketing.mobile:edge:2.+') { transitive = false diff --git a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/URLUtils.java b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/URLUtils.java index 2970d61c..cb76fb4d 100644 --- a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/URLUtils.java +++ b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/URLUtils.java @@ -17,7 +17,7 @@ import com.adobe.marketing.mobile.util.StringUtils; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; +import java.nio.charset.Charset; class URLUtils { @@ -54,9 +54,10 @@ static String generateURLVariablesPayload(final String ts, final String ecid, fi // No need to encode urlFragment.append("null"); } else { - urlFragment.append(URLEncoder.encode(theIdString, StandardCharsets.UTF_8.toString())); + urlFragment.append(URLEncoder.encode(theIdString, Charset.forName("UTF-8").name())); } - } catch (UnsupportedEncodingException e) { + } catch (UnsupportedEncodingException | IllegalArgumentException e) { + urlFragment.append("null"); Log.debug(LOG_TAG, LOG_SOURCE, String.format("Failed to encode urlVariable string: %s", e)); } return urlFragment.toString();