代码之家  ›  专栏  ›  技术社区  ›  fharper

Android Titanium Appcelerator-路径必须是字符串。接收到空值

  •  0
  • fharper  · 技术社区  · 7 年前

    我正在做一个使用钛的项目;Alloy和我终于可以运行iOS版本了,但当我运行 appc ti build -p android

    一切似乎都正常,直到 Building Java source files

    /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/javac  
    "-J-Xmx1024M" "-encoding" "utf8" "-bootclasspath" "/Users/fharper/Library/Android/sdk/platforms/android-
    23/android.jar:/Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/kroll-v8.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-analytics.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/aps-analytics.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-android.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/jaxen-1.1.1.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/ti-commons-codec-1.3.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/kroll-common.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/titanium.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/android-support-multidex.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-filesystem.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-app.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-ui.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/nineoldandroids-appc-2.4.0.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-media.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-appcompat.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/android-support-v4.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/android-support-v7-appcompat.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-cardview.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/cardview-v7-23.0.1.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-locale.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-network.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-xml.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-platform.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-gesture.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-database.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-geolocation.jar:
    /Users/fharper/Documents/Code/TheProject/TheProject/modules/android/ti.compression/3.0.0/compression.jar:
    /Users/fharper/Documents/Code/TheProject/TheProject/modules/android/analytics.google/3.2.0/analytics.google.jar:
    /Users/fharper/Documents/Code/TheProject/TheProject/modules/android/analytics.google/3.2.0/lib/google-play-services-analytics.jar:
    /Users/fharper/Documents/Code/TheProject/TheProject/modules/android/analytics.google/3.2.0/lib/google-play-services-base.jar:
    /Users/fharper/Documents/Code/TheProject/TheProject/modules/android/analytics.google/3.2.0/lib/google-play-services-basement.jar:
    /Users/fharper/Documents/Code/TheProject/TheProject/modules/android/analytics.google/3.2.0/lib/play-services-analytics-impl.jar:
    /Users/fharper/Documents/Code/TheProject/TheProject/modules/android/com.ideeclic.insitu.insituwebserver/2.0.0/insituwebserver.jar:
    /Users/fharper/Documents/Code/TheProject/TheProject/modules/android/ti.map/3.0.1/map.jar:/Users/fharper/Documents/Code/TheProject/TheProject/modules/android/ti.map/3.0.1/lib/google-play-services-map.jar:
    /Users/fharper/Library/Application Support/Titanium/modules/android/com.alcoapps.actionbarextras/1.7.3/actionbarextras.jar:
    /Users/fharper/Documents/Code/TheProject/TheProject/modules/android/com.tripvi.drawerlayout/2.0.0/drawerlayout.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/kroll-apt.jar:
    /Users/fharper/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/lib/titanium-verify.jar:Manifest.class:R.class:AssetCryptImpl.class:Insitu2TheProjectActivity.class:Insitu2TheProjectAppInfo.class:Insitu2TheProjectApplication.class" "-d" 
    "/Users/fharper/Documents/Code/TheProject/TheProject/build/android/bin/classes" "-proc:none" "-target" "1.6" "-source" "1.6" "@/Users/fharper/Documents/Code/TheProject/TheProject/build/android/java-sources.txt"
    

    我得到了以下错误

    An uncaught exception was thrown!
    Path must be a string. Received null
    Path must be a string. Received null
    

    我从未使用过Titanium(6.0.1.GA-CLI 5.0.14),没有访问以前的开发人员,也没有使用太多Node(6.11.2),即使我知道JavaScript,所以我被卡住了。我尝试了很多事情,比如更改Tianium SDK、Java JDK(1.8.0_121)、Android SDK(6.0 API 23 rev 3),但都没用,iOS现在正在运行。我甚至不确定这个错误发生在哪里。即使我使用AppceleratorStudio尝试运行应用程序,我也会遇到问题。

    知道吗?我在这方面花了太多时间,真的需要继续前进……非常感谢!

    使现代化

    这是我运行 appc run -p android --build-only -l trace 命令: https://dl.dropboxusercontent.com/u/13087140/StackOverflow/build_android.log

    2 回复  |  直到 7 年前
        1
  •  2
  •   fharper    7 年前

    这个问题的解决方案是将Android SDK工具从23.0.2升级到26.0.1,即使目前没有Appcelerator Titanium的测试和支持。

        2
  •  1
  •   user3956566 user3956566    7 年前

    这是appcelerator的一个已知问题,基本上,它还没有针对某些配置进行修复——开发人员一直很难再现错误,因此钛和节点的确切版本选择似乎很重要。

    "Path must be a string. Received undefined" error is thrown if you build to Android using Node 6.X.X strictly with Appc CLI

    一个用户的修复。


    带有Ti SDK 6.0.0.v20160728020336的Appc CLI核心5.4.0-36。


    Appc CLI NPM:4.2.8

    SDK:6.0.1.GA
    节点:v6.9.2

    如果可能,在运行移动项目时,包括调试和跟踪日志:debug=*appc run-l trace。

    现在您正在使用:


    节点(6.11.2)

    尝试使用较旧的SDK for titanium和较早的节点版本。我不认为这是Android sdk的问题。

    来自github:

    appcelerator/titanium Path must be a string. Received undefined

    开发者:

    所有路径的明显检查:

    我要做的第一件事是查看Appc CLI和Titanium CLI配置文件,看看是否有任何设置看起来像未定义、null或空的路径,然后修复它们。您可以在~/.appcelerator/appc cli上找到它们。json和~/.titanium/config.json。

    和降级版本:

    另一个总是值得一提的问题是卸载并安装新的SDK,以防当前随您继承的项目导入的SDK中出现一些更改或缺陷。