-
-
Notifications
You must be signed in to change notification settings - Fork 43
TypeError: Cannot read property 'client' of undefined #37
Comments
I have released v1.4.0 which fixes a couple issues with all the pull requests that I just finished accepting and testing and then tested it against my WebSocket server. |
Hi @NathanaelA , I've been getting the same issue as well using v1.4.0.
Everything works fine when running the nativescript application through |
@arondesign - Based on the error, this actually looks like the app isn't merging in the JAR file properly. Are you using the latest TNS, one of the recent versions had an issue with merging and the fixed it with a later version. |
@NathanaelA - I am using the latest version of tns, but I think you are right. After further digging around in android-runtime, it seems to be more of an issue where the extend an existing android application documentation doesn't cover how to move the plugin dependencies over, and pretty much anything else that |
@Pip3r4o - Can you shed some light on if this is a known issue with the Android runtime? |
@NathanaelA this seems like a limitation of what @arondesign has already found for himself - the documentation on extending an android application project does not go over how to apply all include.gradle scripts from the nativescript project dependencies, nor how to add the aars and jars as compile dependencies to the project. I can't offer any immediate workaround/solution to the problem. |
@Pip3r4o - Exactly, I figured as much. I understand that you do not have any immediate workaround for the overall problem, but do you know of a workaround to simply add a single dependency? In this case, |
@Pip3r4o basically, just this include.gradle
|
@arondesign does that not work for you? You could also add the same dependency to |
@Pip3r4o - Well, I've tried that, but it doesn't seem to be a simple as just dropping the dependency in app.gradle (I still get the same error). How do flavors fit into the build process from a cli generated project? When does the type marshaller execute in android-runtime? |
@arondesign please have a look at https://docs.nativescript.org/runtimes/android/advanced-topics/execution-flow Metadata for the JavaScript - Java communication is generated at build time. If a Java package is undefined at run time, then it hasn't been present when the build happened. 'Type marshalling' occurs on Java method/constructor calls, as well as on accessing properties - static or otherwise. Flavors are just the mechanism through which plugin android resources are brought into the application - they do not directly affect what happens at run time. Perhaps you could create a sample project where the problem is reproducible for me to test locally. |
@Pip3r4o - Ah.... the metadata. I wasn't copying over the generated metadata between builds - once I did it ran properly. Thanks for the help! |
@arondesign normally you would not have to do anything manually to have the metadata 'copied over' for your application and the libraries it has, am I missing something in your case? |
This is not the same as issue #14 - the solution provided on that issue does not resolve this issue. This happens at startup, this code used to work just fine but a recent upgrade of libraries/dependencies has brought this issue up. This isn't a problem on the iOS emulator, only the android device that I've tested.
tns version:
3.4.0
package.json:
Here's the error output
The text was updated successfully, but these errors were encountered: