Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24548] Android: Issue with SDK while accessing from API Gateway

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionNot Our Bug
Resolution Date2017-05-18T16:39:23.000+0000
Affected Version/sn/a
Fix Version/sBacklog
ComponentsAndroid
Labelsn/a
ReporterAbhimanyu Narwal
AssigneeJoshua Quick
Created2017-03-31T23:20:07.000+0000
Updated2017-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

FileDateSize
studentcar_titanium.zip2017-04-05T13:31:08.000+0000114202
studentcar.json2017-04-05T13:31:06.000+000092255

Comments

  1. Ingo Muschenetz 2017-04-05

    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:

       var Client = require('../client'),
       	student = require('../model/Student'),
       	testuser = require('../model/Testuser'),
       	car = require('../model/Car');
       

    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.
  2. Eric Merriman 2017-04-05

    Josh, can you take a look at this and let me know what you think?
  3. Joshua Quick 2017-04-05

    The newest "client-generator" (v1.0.0-17) and "ti.oauth" (v0.3.1) changes will solve this issue.
  4. Ingo Muschenetz 2017-05-18

    This is really a client SDK bug, not a Titanium Mobile one.
  5. Lee Morris 2017-05-30

    Closing ticket with reference to the above comments.

JSON Source