Skip to content

Commit 306b54f

Browse files
committed
resolve merge conflict
1 parent 025d66d commit 306b54f

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

build/project-template-gradle/src/main/java/com/tns/RuntimeHelper.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ public boolean hasErrorIntent() {
3737

3838
return hasErrorIntent;
3939
}
40-
4140
public void initRuntime() {
41+
if (Runtime.isInitialized()) {
42+
return;
43+
}
44+
4245
System.loadLibrary("NativeScript");
4346

4447
Logger logger = new LogcatLogger(app);
@@ -130,7 +133,13 @@ public void initRuntime() {
130133

131134
runtime.init();
132135
runtime.runScript(new File(appDir, "internal/ts_helpers.js"));
133-
Runtime.initInstance(this.app);
136+
try {
137+
// put this call in a try/catch block because with the latest changes in the modules it is not granted that NativeScriptApplication is extended through JavaScript.
138+
Runtime.initInstance(this.app);
139+
}
140+
catch (Exception e) {
141+
142+
}
134143
runtime.run();
135144
}
136145
}

0 commit comments

Comments
 (0)