Comments (8)
I'm getting the same error when overloading on number of arguments.
public static interface Logger {
public void print();
public void print(Object value);
}
from android.
Implementing Java interfaces require different syntax. You cannot use extend
functions for this purpose. Use new
and pass the implementation object as a single constructor parameter. Here is an example from the documentation https://github.com/NativeScript/docs/wiki/Getting-Started-with-NativeScript-for-Android#how-to-implement-an-interface
I will investigate the case with DummyLogger
class further.
from android.
@slavchev as you can see in my code I do extend
the class and new
the interface. The code is valid, that's not the problem. It's the runtime that is not behaving right.
from android.
Indeed we have identified a bug and a fix is already in the works. Thanks for reporting this.
from android.
The master have been updated with the fix for that, closing this issue.
from android.
Hi, I found that implementing firebase CompletionListener is not working :
{ To notify if firebase set is completed, I checked the firebase nativescript plugin is not implementing this function, so I tried it on my own and it failed }
var complete = com.firebase.client.Firebase.CompletionListener.extend({
onComplete: function (err, firebase) {
console.log('complete');
}
});
ref.child(url).setValue(object,new complete);
and here's the firebase android doc for it
public static interface Firebase.CompletionListener
void onComplete(FirebaseError error,
Firebase ref)
and here's the error message
com.tns.NativeScriptException:
Calling js method onClick failed
Error: com.firebase.client.FirebaseException: Failed to parse node with class class com.tns.gen.com.firebase.client.Firebase_CompletionListener_fservice_firebase_l161_c72__
com.firebase.client.snapshot.NodeUtilities.NodeFromJSON(NodeUtilities.java:84)
com.firebase.client.snapshot.NodeUtilities.NodeFromJSON(NodeUtilities.java:12)
com.firebase.client.snapshot.PriorityUtilities.parsePriority(PriorityUtilities.java:29)
com.firebase.client.Firebase.setValue(Firebase.java:268)
Is the android method override has limitation on parameters?
Thanks
from android.
We don't support extend
syntax for Java interfaces. Use new
instead as follows (code never tested)
var complete = new com.firebase.client.Firebase.CompletionListener({
onComplete: function (err, firebase) {
console.log('complete');
}
});
ref.child(url).setValue(object,new complete);
from android.
Ill try.. Thanks
from android.
Related Issues (20)
- Building on my Xiaomi device logs error HOT 4
- Android d.ts generator fails to create typings for nested data class
- Build failed with Nativescript Android 8.5: Execution failed for task ':app:mergeDebugNativeLibs'. HOT 4
- Nativescript 6x is failing/crashing while upgrading to android targetSdkVersion 31. HOT 2
- Nativescript app crash on android 31 HOT 1
- NativeScript 8.5.3 Android build failing: Could not find method task() for arguments [replaceSettings, settings_9f0ihdbhsry4akdttkhpjzk68$_run_closure1@860396b] on settings 'proto' of type org.gradle.initialization.DefaultSettings. HOT 6
- Get gradle error every time after npm clean HOT 3
- Unable to establish loopback connection HOT 20
- Mirgation Issue: 6.5 > 8.5 | Launch fails: 'env' not defined HOT 14
- Determine a suitable default value for minSdkVersion HOT 4
- Webview in android/react native is not allowing the web cam to zoom. Even though the zoom value for the camera is set statically in javascript, webview loads the website with the default zoom. Please suggest how to zoom the camera access through webview.
- Chrome DevTools not showing network activity anymore HOT 3
- Android Native script Build error with Unable to apply changes on device: emulator-5554. Error is: Invalid Version: null
- Recursion in Util.java. I suspect that this will lead to issues passing a Google Tier2 CASA
- [koltin] auto create `kotlin.jvm.functions.FunctionX` when a JS function is passed
- Can't visualize Chrome elements Tab
- Error 8.6.0 HOT 4
- missing android-dts-generator.jar - ns typings android not working HOT 4
- NS/Android Unable to create application com.tns.NativeScriptApplication: Error calling module function: Unexpected string HOT 5
- Kotlin issues (companion object)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android.