[TIMOB-24548] Android: Issue with SDK while accessing from API Gateway
GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2017-05-18T16:39:23.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Backlog |
Components | Android |
Labels | n/a |
Reporter | Abhimanyu Narwal |
Assignee | Joshua Quick |
Created | 2017-03-31T23:20:07.000+0000 |
Updated | 2017-05-30T16:45:22.000+0000 |
Description
While using generated SDK code from API Portal, unable to run the mobile application based on sdk code. After following steps mentioned in readme, We also tried couple of different ways to resolve it as suggested by SDK team, but it seems that alloy project is unable to recognize those files (of sdk code). Due to which we get error for module not found.
As of now we have followed each step given in readme but when trying to run it, application returns below error:
[ERROR] : TiExceptionHandler: (main) [1074,1074] ----- Titanium Javascript Runtime Error -----
[ERROR] : TiExceptionHandler: (main) [1,1075] - In ti:/module.js:303,2
[ERROR] : TiExceptionHandler: (main) [1,1076] - Message: Uncaught Error: Requested module not found: ./studentcar/index
[ERROR] : TiExceptionHandler: (main) [0,1076] - Source: throw new Error("Requested module not found: " + request); // TODO Set 'code' property to 'MODULE_NOT_FOUND' to match Node?
[ERROR] : V8Exception: Exception occurred at ti:/module.js:303: Uncaught Error: Requested module not found: ./studentcar/index
Expected Result: Using generated SDK code from mobile application user should be able to access APIs generated in Arrow and make respective calls.
Attachments
I ran into a similar issue.
I updated the API gateway to the latest 1.0.0 version. That gave me the attached SDK.
I integrated it at a superficial level, just updated alloy.js
I ran it on iOS. Worked.
I ran it on Android. Failed with a similar message about "unable to find ../model/student"
I noticed that my files are capitalized (as in "Student.js")
Editing the DefaultAPI.js to reflect the following worked:
My OS X boot volume is NOT formatted case-sensitive
Android _is_ case sensitive: https://stackoverflow.com/questions/6502712/isnt-android-file-exists-case-sensitive
My sense is that https://github.com/appcelerator/client-generator/blob/command_line/templates/titanium/api.js#L8 needs to respect the capitalization.Josh, can you take a look at this and let me know what you think?
The newest "client-generator" (v1.0.0-17) and "ti.oauth" (v0.3.1) changes will solve this issue.
This is really a client SDK bug, not a Titanium Mobile one.
Closing ticket with reference to the above comments.