启动应用程序时 Titanium 缺少 Google 分析

Titanium Missing Google Analytics when Starting App

我正在使用 Titanium 3.5.1 完成同事开发的应用程序的开发。该应用程序对他和 Android 模拟器中的 运行s 都很好。另一位同事也在他的 Mac 上安装了 Titanium 3.5.1 并启动应用程序,一切正常,没有任何变化。

我在 Ubuntu 14.04 上使用相同的 Titanium,应用程序无法在模拟器中启动。我不断收到缺少 Google 分析插件的错误消息。我知道这不是 Linux 的事情,因为第一个同事也在使用 Ubuntu 来开发应用程序。所以在那里工作得很好。

我正在使用最新安装的 NodeJS 和 Oracle JDK。

$ node -v
v0.12.4
$ java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-0ubuntu0.14.04.2)
OpenJDK Server VM (build 24.79-b02, mixed mode)
$ ti --version
4.0.1

$ ti sdk
Titanium Command-Line Interface, CLI version 4.0.1, Titanium SDK version 3.5.1.GA
Copyright (c) 2012-2015, Appcelerator, Inc.  All Rights Reserved.

Please report bugs to http://jira.appcelerator.org/

SDK Install Locations:
   /home/land/.titanium [default]

Installed SDKs:
   3.5.1.GA [selected]  /home/land/.titanium/mobilesdk/linux/3.5.1.GA

这是我在尝试模拟时遇到的错误:

[ERROR] :  TiExceptionHandler: (main) [1722,1722] ----- Titanium Javascript Runtime Error -----
[ERROR] :  TiExceptionHandler: (main) [1,1723] - In ti:/module.js:280,9
[ERROR] :  TiExceptionHandler: (main) [1,1724] - Message: Uncaught Error: Requested module not found: analytics.google
[ERROR] :  TiExceptionHandler: (main) [0,1724] - Source:         throw new Error("Requested module not found: " + request);
[ERROR] :  V8Exception: Exception occurred at ti:/module.js:280: Uncaught Error: Requested module not found: analytics.google

我知道 Google 分析模块在那里:

所有这些都是为其他两位同事声明的完全相同的代码 运行,而没有对代码进行任何更改。我在编译之前也对项目进行了运行 "Clean"。同样的结果。

根据Github在开发者问题中找到了答案。看起来就像模块的 JAR 文件名一样简单。其中一个字母是大写的。由于 Linux 使用区分大小写的文件名 Linux 无法找到它。在检查器中重命名文件就成功了,并为我修复了它:

https://github.com/Sitata/titanium-google-analytics/issues/13#issuecomment-70508249