[TIMOB-27706] Android: Native modules having uppercase "name" are excluded from build on case-sensitive systems
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-01-10T22:44:52.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.0.0 |
Components | Android |
Labels | android, build, engSchedule, linux, module |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2020-01-07T05:50:39.000+0000 |
Updated | 2020-01-10T22:44:52.000+0000 |
Description
*Summary:*
Native Android modules such as "ti.facebook" will not have their main JAR included in the app if built from a case-sensitive file system. The app will succeed to build, but attempting to use the module's APIs will fail.
For "ti.facebook", the following warning will be logged when doing a build.
From the menu, click:
In "Save As" field, enter:
In "Name" field, enter:
In "Size" field, enter:
Unzip module to folder:
[WARN] Module facebook version 8.0.0 does not have a main jar file
_(This is more of an issue on Linux where the file system is case-sensitive by default.)_
*How to create case-sensitive disk image on macOS:*
Open the "Disk Utility" app.
From the menu, click: File -> New Image -> Blank Image
Click on the "Image Format" drop-down and select "sparse bundle disk image".
In "Save As" field, enter: CaseSensitive.sparsebundle
In "Where" field, select destination to write this image file to.
In "Name" field, enter: CaseSensitive
In "Size" field, enter: 1 GB
Click "Format" drop-down and select "Mac OS Extended (Case-sensitive)".
Click the "Save" button.
You can mount the above image by double clicking the "CaseSensitive.sparsebundle" file. You can find the "CaseSensitive" volume in "Finder" under the "Locations" section. *Steps to reproduce:*Download [kitchensink-v2](https://github.com/appcelerator/kitchensink-v2) to the case sensitive volume.
Download the newest release version of the [ti.facebook](https://github.com/appcelerator-modules/ti.facebook) module.
Unzip module to folder: kitchensink-v2/modules/ti.facebook/...
Open the "tiapp.xml" file.
Build and run on Android.
Notice the following gets logged:
[WARN] Module facebook version 8.0.0 does not have a main jar file
Tap on the app's "Mashups" tab.
Tap on the Facebook row.
Notice the app crashes.
*Reason:* Titanium's build script is doing atoLowerCase()
on the JAR file name [here](https://github.com/appcelerator/titanium_mobile/blob/243afd00e0760f2060e797312942ee65d47b9f5f/android/cli/commands/_build.js#L1575).
*Note:*
This issue causes a build failure in Titanium 9.0.0 since moving to gradle.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/11417
merged to master for 9.0.0
Verified on: Mac OS: 10.15.1 SDK: 9.0.0.v20200110103446 Appc CLI: 7.1.2 JDK: 11.0.4 Node: 10.16.3 Studio: 6.0.0.201911251516 Device: Pixel3(v10.0) emulator