NativeScript / NativeScript/android
@Interfaces decorator gives an error "Error executing Static Binding Generator: Class not found"
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 563
- Forks
- 144
- Avg merge
- 10h 46m
- Merged PRs (30d)
- 14
Description
Environment:
Nativescript: 6.7.8
tns-core-modules: 6.0.1
tns-andoird: 6.5.3
Issue:
I am implementing Java Interface in my Nativescript-angular application for android. I have added Java android plugin dependency in the app.gradle file. I get a build (tns build android) error for @Interfaces decorator.
Build error during "tns build android"
"Error executing Static Binding Generator: Class not found global.com.microsoft.identity.client.IPublicClientApplication.ISingleAccountApplicationCreatedListener"
If I execute below steps then I dont see any issue.
- "tns run android --no-hmr"
- Application built and started successfully
- Perform necessary @Interfaces related changes in the TS file
- Automatically starts the incremental build
- I dont see any error and my code works fine.
app.gradle:
dependencies {
implementation "com.microsoft.identity.client:msal:1.2.+"
}
TS file:
declare var global: any;
@Interfaces([global.com.microsoft.identity.client.IPublicClientApplication.ISingleAccountApplicationCreatedListener])
export class SingleAccount extends java.lang.Object {
mSingleAccountApp;
constructor() {
super();
// necessary when extending TypeScript constructors
return global.__native(this);
}
onCreated(application): void {
//some code
}
onError(exception): void {
////some code
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the clean tns build android failure and the successful tns run android --no-hmr flow. Inspect the app.gradle dependency and the TypeScript @Interfaces declaration, then trace the Static Binding Generator error for IPublicClientApplication.ISingleAccountApplicationCreatedListener. Done means the interface can be built successfully from a clean build, not only incrementally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, typescript
- Domain
- build-system, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100