我的项目在3周前成功编译。我避免更新appcelerator组件,因为我项目的某些模块需要该特定版本。

自3周前以来,我既没有更新Java(1.8 131),也没有更新appcelerator cli或sdk。我使用的SDK版本是6.0.2。

我无法理解为什么Titan现在在“构建Java源文件”阶段显示此错误:

[INFO]  Building Java source files: /usr/lib/jvm/java-8-oracle/bin/javac "-J-Xmx1024M" "-encoding" "utf8" "-bootclasspath" "/home/user/android-sdk/platforms/android-23/android.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/kroll-v8.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-analytics.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/aps-analytics.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-android.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/jaxen-1.1.1.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/ti-commons-codec-1.3.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/kroll-common.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/titanium.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/android-support-multidex.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-filesystem.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-app.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-ui.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/nineoldandroids-appc-2.4.0.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-media.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-appcompat.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/android-support-v4.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/android-support-v7-appcompat.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-cardview.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/cardview-v7-23.0.1.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-locale.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-network.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-xml.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-map.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-calendar.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-geolocation.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-database.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-accelerometer.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-platform.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-contacts.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-gesture.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-utils.jar:/home/user/Appcelerator_Studio_Workspace/myproject/modules/android/ti.map/3.1.1/map.jar:/home/user/Appcelerator_Studio_Workspace/myproject/modules/android/ti.map/3.1.1/lib/google-play-services-gcm+maps.jar:/home/user/Appcelerator_Studio_Workspace/myproject/modules/android/ti.imagefactory/3.0.0/imagefactory.jar:/home/user/Appcelerator_Studio_Workspace/myproject/modules/android/ti.goosh/2.0.5/ti.goosh.jar:/home/user/Appcelerator_Studio_Workspace/myproject/modules/android/ti.goosh/2.0.5/lib/gson.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/kroll-apt.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/lib/titanium-verify.jar:Manifest.class:R.class:AssetCryptImpl.class:FixioActivity.class:FixioAppInfo.class:FixioApplication.class" "-d" "/home/user/Appcelerator_Studio_Workspace/myproject/build/android/bin/classes" "-proc:none" "-target" "1.6" "-source" "1.6" "@/home/user/Appcelerator_Studio_Workspace/myproject/build/android/java-sources.txt"
[ERROR] Failed to compile Java source files:
[ERROR]
[ERROR] /home/user/Appcelerator_Studio_Workspace/myproject/build/android/gen/es/myproject/AssetCryptImpl.java:44: error: cannot find symbol
[ERROR]             Range range = assets.get(path);
[ERROR]                           ^
[ERROR]   symbol:   variable assets
[ERROR]   location: class AssetCryptImpl
[ERROR] /home/user/Appcelerator_Studio_Workspace/myproject/build/android/gen/es/myproject/AssetCryptImpl.java:48: error: cannot find symbol
[ERROR]             return new String(filterDataInRange(assetsBytes, range.offset, range.length));
[ERROR]                                                 ^
[ERROR]   symbol:   variable assetsBytes
[ERROR]   location: class AssetCryptImpl
[ERROR] Note: /home/user/Appcelerator_Studio_Workspace/myproject/build/android/gen/es/fixio/AssetCryptImpl.java uses unchecked or unsafe operations.
[ERROR] Note: Recompile with -Xlint:unchecked for details.
[ERROR] 2 errors

在此先感谢您的帮助,对于我的英语不好,我们深表歉意。

更新(2017-07-05):

我发现这个apperator吉拉有相同的问题:
https://jira.appcelerator.org/browse/TIMOB-24895

我正在等待正式的工作。

最佳答案

编译之前是否尝试清理项目目录?如果您使用的是Studio,只需转到菜单中的Project / Clean并选择您的项目,或者您可以使用命令行工具(http://docs.appcelerator.com/platform/latest/#!/guide/Titanium_CLI_Tasks-section-src-38931164_TitaniumCLITasks-CleanYourBuildFolder)

关于java - Appcelerator Titanium为我的Android项目构建Java文件时崩溃,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/44756874/

10-11 22:32