[TIMOB-11862] Android: Module package name with underscore throws an exception
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2016-08-25T21:23:07.000+0000 |
Affected Version/s | Release 2.1.3, Release 5.4.0 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | reiji-terasaka |
Assignee | Eric Merriman |
Created | 2012-11-07T10:25:32.000+0000 |
Updated | 2017-03-24T21:58:17.000+0000 |
Description
I created a module that contains an underline in the package name.
For example, "com.ad_stir.ti".
However, my module threw the exception.
11-07 19:06:21.860: E/TiApplication(4676): java.lang.UnsatisfiedLinkError: nativeBootstrap
11-07 19:06:21.860: E/TiApplication(4676): at com.ad_stir.ti.AdstirsdkBootstrap.nativeBootstrap(Native Method)
11-07 19:06:21.860: E/TiApplication(4676): at com.ad_stir.ti.AdstirsdkBootstrap.bootstrap(AdstirsdkBootstrap.java:17)
Working Patch
--- mobilesdk/linux/2.1.3.GA/module/android/bootstrap.py
+++ mobilesdk/linux/2.1.3.GA/module/android/bootstrap.py
@@ -332,7 +332,7 @@
open(genBindings, "w").write(gperfTemplate % gperfContext)
def generateNative(self, javaTemplate, cppTemplate, javaDir, cppDir):
- jniPackage = self.moduleId.replace(".", "_")
+ jniPackage = self.moduleId.replace("_", "_1").replace(".", "_")
className = self.moduleName[0:1].upper() + self.moduleName[1:]
context = {
I cannot reproduce with Titanium SDK 5.4.0.GA. We introduced a new module build system in 5.0.0 that doesn't have a problem. Note: while trying to reproduce this, I uncovered and fixed TIMOB-23827.
Closing ticket as the issue cannot be reproduced and with reference to the previous comments.