Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Apk generated from BASE_URL in config.json #193

Open
shreyasnbhat opened this issue Jul 7, 2017 · 3 comments
Open

Error in Apk generated from BASE_URL in config.json #193

shreyasnbhat opened this issue Jul 7, 2017 · 3 comments

Comments

@shreyasnbhat
Copy link

I am building an script to generate apks of different sample via travis. As of now the only apk in the apk branch is of the fossasia17 sample. Now we are going to have multiple sample apks in the apk branch after each build.

The Google I/O 2016 version gave me several errors.
87ce27b1-116a-4705-90bf-7c9a1773269b

I think that that some formatting errors have cropped up in the sample probably. And these errors are shown by the ResponseProcessor.
@iamareebjamal Please have a look.
@arp95 @mahikaw Please test the app by changing the BASE_URL in config.json to the ones in Google I/O 17 etc.

E/ResponseProcessor: com.fasterxml.jackson.databind.JsonMappingException: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value
                      at [Source: okhttp3.ResponseBody$BomAwareReader@527f74e; line: 73, column: 269]
                         at [Source: okhttp3.ResponseBody$BomAwareReader@527f74e; line: 73, column: 28] (through reference chain: java.util.ArrayList[2]->org.fossasia.openevent.data.Speaker["short_biography"])
                         at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1511)
                         at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:262)
                         at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125)
                         at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:277)
                         at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
                         at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
                         at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1575)
                         at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1183)
                         at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:32)
                         at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:23)
                         at retrofit2.ServiceMethod.toResponse(ServiceMethod.java:118)
                         at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:212)
                         at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:106)
                         at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135)
                         at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
                         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                         at java.lang.Thread.run(Thread.java:761)
                      Caused by: com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value
                      at [Source: okhttp3.ResponseBody$BomAwareReader@527f74e; line: 73, column: 269]
                         at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1586)
                         at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:521)
                         at com.fasterxml.jackson.core.base.ParserMinimalBase._throwUnquotedSpace(ParserMinimalBase.java:485)
                         at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._finishString2(ReaderBasedJsonParser.java:1974)
                         at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._finishString(ReaderBasedJsonParser.java:1946)
                         at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.getText(ReaderBasedJsonParser.java:260)
                         at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:31)
                         at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:11)
                         at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:490)
                         at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:95)
                         at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:260)
                         	... 16 more
I/SpeakersListFragment: Speaker download failed.
E/Timeout: com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value
            at [Source: okhttp3.ResponseBody$BomAwareReader@527f74e; line: 73, column: 269]
@iamareebjamal
Copy link
Member

This is because a new line is used without \n

"short_biography": "<p>Yigit is a software engineer on the Android Framework team focusing on app architecture and developer productivity. He also works on Data Binding and RecyclerView. Prior to joining Google, he was the Android Engineering Manager at Path.
 He received his bachelor's degree in computer engineering from Middle East Technical University, Turkey.</p>"

You can add lenient parsing by

mapper.configure(Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true);

in the app

@abishekvashok
Copy link
Member

@iamareebjamal any updates on this?

@iamareebjamal
Copy link
Member

As reported above, the error was in the configuration of JSON parser. Using lenient parsing, this can be ignored. Another workaround is to not add hard line breaks in the JSON itself but it is rudimentary to enforce such restrictions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants