fharper
fharper

Reputation: 559

Android Titanium Appcelerator - Path must be a string. Received null

I'm working on a project using Titanium & Alloy and I'm finally able to run the iOS version, but I got an error with Android when I run the appc ti build -p android command.

Everything seems to work until the Building Java source files step

/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"

where I get the following error

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

I never used Titanium (6.0.1.GA - CLI 5.0.14), don't have access to previous developer and didn't use much Node (6.11.2) also even if I know JavaScript, so I'm stuck. I tried many things like changing the Titanium SDK, Java JDK (1.8.0_121), Android SDK (6.0 API 23 rev 3), but nothing works and iOS is running now. I'm not even sure where this error happens. I have the issues even if I use the AppceleratorStudio to try to run the app.

Any idea? I spent too much time on this and really need to move forward... Thanks a lot!

Update

Here is the full log (too big to paste directly in SO) when I run the appc run -p android --build-only -l trace command: https://dl.dropboxusercontent.com/u/13087140/StackOverflow/build_android.log

Upvotes: 0

Views: 1517

Answers (2)

fharper
fharper

Reputation: 559

The solution to this issue was to upgrade the Android SDK Tools from 23.0.2 to 26.0.1, even if not tested and supported by Appcelerator Titanium for now.

Upvotes: 2

user3956566
user3956566

Reputation:

This is a known issue with appcelerator and basically, it hasn't been fixed for certain configurations - the devs have been having difficulty reproducing the error, so it seems the exact version choice for titanium and node is important.

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

Resolution: Won't Fix

One user's fix.

The developer has closed the issue and there is conflict about whether the issue has been solved.

Will close ticket as won't fix. Confirmed that I do not get this error any more with
Appc CLI Core 5.4.0-36 with Ti SDK 6.0.0.v20160728020336.

and

I am still unable to reproduce this issue with the current GA stack:
Appc CLI NPM: 4.2.8
Appc CLI Core: 6.1.0
SDK: 6.0.1.GA
Node: v6.9.2
OS: Mac OS X (10.12.2)
If possible, when running the mobile project, include the debug and trace logs: DEBUG=* appc run -l trace.

Now you're using:

Titanium (6.0.1.GA - CLI 5.0.14)
Node (6.11.2)

Try using older sdks for titanium and an earlier node version. I don't see it being an issue with the Android sdk.

One user resolved it by downgrading node

I resolved it by using node v4x. It does not work with v6.x which I was using when I saw the error.

From github:

appcelerator/titanium Path must be a string. Received undefined

From the devs:

The obvious check of all paths:

The first thing I would do is look at both your Appc CLI and Titanium CLI config files and see if there are any settings that look like paths that are undefined, null, or empty and fixing them. You can find them at ~/.appcelerator/appc-cli.json and ~/.titanium/config.json.

and downgrading versions:

So this happens because of some changes in Node.js that affect 5.5.1.GA. If your app needs to stay on SDK 5.5.1.GA try to downgrade your Node version to a 4.X version, otherwise upgrading to SDK 6.0.1.GA should fix the issue.

The other issue that is always worth mentioning - is to uninstall and install fresh sdks, in case there's been some changes or flaw in the current ones that were imported with the project you've inherited.

Upvotes: 1

Related Questions