Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23830] Android: Unable to build native module with name that starts with number

GitHub Issuen/a
TypeBug
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 5.5.0
Fix Version/sn/a
ComponentsAndroid, Tooling
Labelscb-tooling, engSchedule
ReporterChris Barber
AssigneeChris Barber
Created2016-08-26T05:07:15.000+0000
Updated2019-09-24T15:53:17.000+0000

Description

Can't build a module for Android with a name of "123abc". You can create it just fine. It builds just fine for iOS, however on Android, the name is used to declare the Java class for the module and class names in Java can't start with a number.

Comments

  1. Chris Barber 2016-08-26

    TiSDK master PR: https://github.com/appcelerator/titanium_mobile/pull/8273 TiSDK 6_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/8274
  2. Feon Sua Xin Miao 2016-08-30

    Module build on master and 6_0_X branches are broken, I'm getting following build error:
       [ERROR] import org.appcelerator.titanium.util.Log;
       [ERROR]                                      ^
       [ERROR]   symbol:   class Log
       [ERROR]   location: package org.appcelerator.titanium.util
       
  3. Chris Barber 2016-08-30

    We need to wait for TIMOB-23801 before we can test/merge this.
  4. Feon Sua Xin Miao 2016-09-07

    Now I'm seeing this:
       [ERROR] Failed to compile Java source files:
       [ERROR]   
       [ERROR] /var/folders/mc/fcb2h6g10_b_9jx5v5qq3z6m0000gp/T/ti-android-module-build-11687-41164-1fxibgb/123abc/build/android/gen/com/test/app/_123abcApplication.java:40: error: cannot find symbol
       [ERROR]         	runtime.addExternalModule("com.test.app", com.test.app.my123abcBootstrap.class);
       [ERROR]         	                                                      ^
       [ERROR]   symbol:   class my123abcBootstrap
       [ERROR]   location: package com.test.app
       [ERROR] 1 error
       
    *Steps to reproduce:* 1. create a module, name 123abc, id com.test.app 2. do ti build \-p android without --build-only flag 3. module is built, follow by running the example project 4. the example project failed to run
  5. Hans Knöchel 2016-10-07

    [~cbarber] The PR is marked for 6.0.0, but this ticket isn't. Please update one of both, thx!
  6. Chris Barber 2016-10-07

    [~hansknoechel] This ticket and PR will NOT go in 6.0.
  7. Chris Barber 2017-10-17

    [~hknoechel] Nope. Maybe 7.1 or 7.2.
  8. Hans Knöchel 2018-02-16

    [~fmiao] [~gmathews] Can you code review this? [~cbarber] The PR has merge conflicts.
  9. Chris Barber 2018-02-16

    [~hknoechel] I'm not certain the PRs are valid. How we generate and use the module names and ids is a disaster. Some places we strip all special characters. Some places we camel case. When the module build was ported over, some wires got crossed and the module name is used for the module id and vice versa. What I'm saying is how the module build handles names and ids needs to be completely reviewed and that includes support for names that start with a number.
  10. Chris Barber 2018-03-14

    I'm failing the review of this PR since this PR is so old and I'm not certain it is valid.

JSON Source