Switch to another (Android) Activity onTap


#1

I have following (tap) handler:

public switchActivity() {
    app.android.context.startActivity(new android.content.Intent(app.android.context, "com.example.Activities.ExampleActivity"));
}

I think the handler is the problem. Anyways here’s the Activity:

import {setActivityCallbacks, AndroidActivityCallbacks} from "ui/frame";

@JavaProxy("com.example.Activities.ExampleActivity")
class ExampleActivity extends android.app.Activity {
    private _callbacks: AndroidActivityCallbacks;

    protected onCreate(savedInstanceState: android.os.Bundle): void {
        if (!this._callbacks) {
            setActivityCallbacks(this);
        }

        this._callbacks.onCreate(this, savedInstanceState, super.onCreate);

        let layout = this.getResources().getIdentifier("activity_example", "layout", this.getPackageName());
        this.setContentView(layout);
    }

    protected onSaveInstanceState(outState: android.os.Bundle): void {
        this._callbacks.onSaveInstanceState(this, outState, super.onSaveInstanceState);
    }

    protected onStart(): void {
        this._callbacks.onStart(this, super.onStart);
    }

    protected onStop(): void {
        this._callbacks.onStop(this, super.onStop);
    }

    protected onDestroy(): void {
        this._callbacks.onDestroy(this, super.onDestroy);
    }

    public onBackPressed(): void {
        this._callbacks.onBackPressed(this, super.onBackPressed);
    }

    public onRequestPermissionsResult(requestCode: number, permissions: Array<String>, grantResults: Array<number>): void {
        this._callbacks.onRequestPermissionsResult(this, requestCode, permissions, grantResults, undefined /*TODO: Enable if needed*/);
    }

    protected onActivityResult(requestCode: number, resultCode: number, data: android.content.Intent): void {
        this._callbacks.onActivityResult(this, requestCode, resultCode, data, super.onActivityResult);
    }
}

I’ve registered it in AndroidManifest.xml

	<activity
		android:name="com.tns.NativeScriptActivity"
		android:label="@string/title_activity_kimera"
		android:configChanges="keyboardHidden|orientation|screenSize"
		android:theme="@style/LaunchScreenTheme">

		<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />

		<intent-filter>
			<action android:name="android.intent.action.MAIN" />
			<category android:name="android.intent.category.LAUNCHER" />
		</intent-filter>
	</activity>
	<activity android:name="com.tns.ErrorReportActivity"/>
	<activity android:name="com.example.Activities.ExampleActivity"></activity>

Now whenever I click the button the app will crash. Heres the logcat output:

$ adb logcat
--------- beginning of main
01-31 17:56:59.140  1243  1309 D hwcomposer: hw_composer sent 323 syncs in 60s
01-31 17:57:15.612  3377  3377 E art     : invalid stream - problem with parameter iterator in /data/app/com.example.Activities-1/base.apk for method void com.tns.gen.android.view.View_OnClickListener.onClick(android.view.View)
01-31 17:57:15.614  3377  3377 D AndroidRuntime: Shutting down VM
01-31 17:57:15.614  3377  3377 E art     : invalid stream - problem with parameter iterator in /data/app/com.example.Activities-1/base.apk for method void com.tns.gen.android.view.View_OnClickListener.onClick(android.view.View)
01-31 17:57:15.614  3377  3377 W System.err: com.tns.NativeScriptException: 
01-31 17:57:15.614  3377  3377 W System.err: Calling js method onClick failed
01-31 17:57:15.614  3377  3377 W System.err: [object Object]
01-31 17:57:15.614  3377  3377 W System.err: File: "/data/data/com.example.Activities/files/app/tns_modules/@angular/core/bundles/core.umd.js, line: 12764, column: 20
01-31 17:57:15.614  3377  3377 W System.err: StackTrace: 
01-31 17:57:15.614  3377  3377 W System.err: 	Frame: function:'DebugAppView._rethrowWithContext', file:'/data/data/com.example.Activities/files/app/tns_modules/@angular/core/bundles/core.umd.js', line: 12764, column: 21
01-31 17:57:15.614  3377  3377 W System.err: 	Frame: function:'', file:'/data/data/com.example.Activities/files/app/tns_modules/@angular/core/bundles/core.umd.js', line: 12781, column: 27
01-31 17:57:15.614  3377  3377 W System.err: 	Frame: function:'', file:'/data/data/com.example.Activities/files/app/tns_modules/nativescript-angular/renderer.js', line: 213, column: 26
01-31 17:57:15.614  3377  3377 W System.err: 	Frame: function:'ZoneDelegate.invoke', file:'/data/data/com.example.Activities/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 190, column: 28
01-31 17:57:15.614  3377  3377 W System.err: 	Frame: function:'onInvoke', file:'/data/data/com.example.Activities/files/app/tns_modules/@angular/core/bundles/core.umd.js', line: 4405, column: 41
01-31 17:57:15.614  3377  3377 W System.err: 	Frame: function:'ZoneDelegate.invoke', file:'/data/data/com.example.Activities/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 189, column: 34
01-31 17:57:15.614  3377  3377 W System.err: 	Frame: function:'Zone.run', file:'/data/data/com.example.Activities/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 83, column: 43
01-31 17:57:15.614  3377  3377 W System.err: 	Frame: function:'NgZone.run', file:'/data/data/com.example.Activities/files/app/tns_modules/@angular/core/bundles/core.umd.js', line: 4274, column: 66
01-31 17:57:15.614  3377  3377 W System.err: 	Frame: function:'zonedCallback', file:'/data/data/com.example.Activities/files/app/tns_modules/nativescript-angular/renderer.js', line: 212, column: 24
01-31 17:57:15.614  3377  3377 W System.err: 	Frame: function:'Observable.notify', file:'/data/data/com.example.Activities/files/app/tns_modules/data/observable/observable.js', line: 149, column: 23
01-31 17:57:15.614  3377  3377 W System.err: 	Frame: function:'Observable._emit', file:'/data/data/com.example.Activities/files/app/tns_modules/data/observable/observable.js', line: 168, column: 18
01-31 17:57:15.614  3377  3377 W System.err: 	Frame: function:'onClick', file:'/data/data/com.example.Activities/files/app/tns_modules/ui/button/button.js', line: 33, column: 32
01-31 17:57:15.614  3377  3377 W System.err: 	at com.tns.Runtime.callJSMethodNative(Native Method)
01-31 17:57:15.614  3377  3377 W System.err: 	at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1022)
01-31 17:57:15.614  3377  3377 W System.err: 	at com.tns.Runtime.callJSMethodImpl(Runtime.java:907)
01-31 17:57:15.614  3377  3377 W System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:895)
01-31 17:57:15.614  3377  3377 W System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:879)
01-31 17:57:15.614  3377  3377 W System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:871)
01-31 17:57:15.614  3377  3377 W System.err: 	at com.tns.gen.android.view.View_OnClickListener.onClick(android.view.View$OnClickListener.java)
01-31 17:57:15.614  3377  3377 W System.err: 	at android.view.View.performClick(View.java:5198)
01-31 17:57:15.615  3377  3377 W System.err: 	at android.view.View$PerformClick.run(View.java:21147)
01-31 17:57:15.615  3377  3377 W System.err: 	at android.os.Handler.handleCallback(Handler.java:739)
01-31 17:57:15.615  3377  3377 W System.err: 	at android.os.Handler.dispatchMessage(Handler.java:95)
01-31 17:57:15.615  3377  3377 W System.err: 	at android.os.Looper.loop(Looper.java:148)
01-31 17:57:15.615  3377  3377 W System.err: 	at android.app.ActivityThread.main(ActivityThread.java:5417)
01-31 17:57:15.615  3377  3377 W System.err: 	at java.lang.reflect.Method.invoke(Native Method)
01-31 17:57:15.615  3377  3377 W System.err: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
01-31 17:57:15.615  3377  3377 W System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
--------- beginning of system
01-31 17:57:15.617  1563  1684 I ActivityManager: START u0 {flg=0x14008000 cmp=com.example.Activities/com.tns.ErrorReportActivity (has extras)} from uid 10062 on display 0
01-31 17:57:15.625  1243  1281 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x333 imply creation of host color buffer
01-31 17:57:15.628  1563  1684 D         : HostConnection::get() New Host Connection established 0x9ce9c100, tid 1684
01-31 17:57:15.638  1243  1243 E EGL_emulation: tid 1243: eglCreateSyncKHR(1660): error 0x3004 (EGL_BAD_ATTRIBUTE)
01-31 17:57:15.662  1563  1684 D gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread)
01-31 17:57:15.695  1243  1631 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x933 imply creation of host color buffer
01-31 17:57:15.698  3377  3377 I Process : Sending signal. PID: 3377 SIG: 9
01-31 17:57:15.720  1563  1582 D         : HostConnection::get() New Host Connection established 0x985bb600, tid 1582
01-31 17:57:15.749  1563  1608 W InputDispatcher: channel 'f5414e5 com.example.Activities/com.tns.NativeScriptActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
01-31 17:57:15.750  1563  1608 E InputDispatcher: channel 'f5414e5 com.example.Activities/com.tns.NativeScriptActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-31 17:57:15.750  1563  1740 D GraphicsStats: Buffer count: 3
01-31 17:57:15.750  1563  1741 I WindowState: WIN DEATH: Window{f5414e5 u0 com.example.Activities/com.tns.NativeScriptActivity}
01-31 17:57:15.750  1563  1741 W InputDispatcher: Attempted to unregister already unregistered input channel 'f5414e5 com.example.Activities/com.tns.NativeScriptActivity (server)'
01-31 17:57:15.751  1563  2185 I ActivityManager: Process com.example.Activities (pid 3377) has died
01-31 17:57:15.756  3407  3407 I art     : Not late-enabling -Xcheck:jni (already on)
01-31 17:57:15.763  1563  2185 I ActivityManager: Start proc 3407:com.example.Activities/u0a62 for activity com.example.Activities/com.tns.ErrorReportActivity
01-31 17:57:15.788  3407  3407 I TNS.Native: NativeScript Runtime Version 2.4.1, commit b6676b88f846e551e0e20e67e9bc09d60dfb3089
01-31 17:57:15.788  3407  3407 D TNS.Native: JNI_ONLoad
01-31 17:57:15.788  3407  3407 D TNS.Native: JNI_ONLoad END
01-31 17:57:15.800  3407  3407 W art     : Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
01-31 17:57:15.831  1243  1631 E SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
01-31 17:57:15.831  3407  3424 D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
01-31 17:57:15.839  3407  3407 D         : HostConnection::get() New Host Connection established 0xaab1d5c0, tid 3407
01-31 17:57:15.847  3407  3407 W         : Process pipe failed
01-31 17:57:15.877  3407  3424 D         : HostConnection::get() New Host Connection established 0xaa45e240, tid 3424
01-31 17:57:15.885  3407  3424 I OpenGLRenderer: Initialized EGL, version 1.4
01-31 17:57:15.903  1243  1281 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
01-31 17:57:15.912  3407  3424 E EGL_emulation: tid 3424: eglSurfaceAttrib(1165): error 0x3009 (EGL_BAD_MATCH)
01-31 17:57:15.912  3407  3424 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xaab54a40, error=EGL_BAD_MATCH
01-31 17:57:15.913  1243  1283 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
01-31 17:57:15.926  1243  1283 D gralloc_ranchu: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
01-31 17:57:16.078  1563  1574 W InputMethodManagerService: Got RemoteException sending setActive(false) notification to pid 3377 uid 10062
01-31 17:57:16.080  1563  1582 I ActivityManager: Displayed com.example.Activities/com.tns.ErrorReportActivity: +326ms
01-31 17:57:16.286  1563  1582 D gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread)
01-31 17:57:16.754  1563  1582 W WindowAnimator: Failed to dispatch window animation state change.
01-31 17:57:16.754  1563  1582 W WindowAnimator: android.os.DeadObjectException
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at android.os.BinderProxy.transactNative(Native Method)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at android.os.BinderProxy.transact(Binder.java:503)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at android.view.IWindow$Stub$Proxy.onAnimationStopped(IWindow.java:534)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at com.android.server.wm.WindowAnimator.updateWindowsLocked(WindowAnimator.java:286)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at com.android.server.wm.WindowAnimator.animateLocked(WindowAnimator.java:678)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at com.android.server.wm.WindowAnimator.-wrap0(WindowAnimator.java)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at com.android.server.wm.WindowAnimator$1.doFrame(WindowAnimator.java:123)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at android.view.Choreographer.doCallbacks(Choreographer.java:670)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at android.view.Choreographer.doFrame(Choreographer.java:603)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at android.os.Handler.handleCallback(Handler.java:739)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at android.os.Handler.dispatchMessage(Handler.java:95)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at android.os.Looper.loop(Looper.java:148)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at android.os.HandlerThread.run(HandlerThread.java:61)
01-31 17:57:16.754  1563  1582 W WindowAnimator: 	at com.android.server.ServiceThread.run(ServiceThread.java:46)
01-31 17:58:00.055  1243  1309 D hwcomposer: hw_composer sent 86 syncs in 60s
01-31 17:59:00.050  1243  1309 D hwcomposer: hw_composer sent 6 syncs in 60s
01-31 18:00:00.049  1243  1309 D hwcomposer: hw_composer sent 6 syncs in 60s

I can’t find any information on switching between activities in NativeScript. The docs just show how to replace the default NativeScript activity which is not what I want. I need a custom activity for some library and just want to enable my NativeScript Angular app to navigate to that activity and of course to go back as well.

Isn’t this possible with {NS} or am I doing something totally wrong here?


#2

I managed to get this done:

public switchActivity() {
    let intent: android.content.Intent = new android.content.Intent(
        application.android.foregroundActivity,
        com.example.Activities.ExampleActivity["class"]
    );

    application.android.foregroundActivity.startActivity(intent);
}

I followed the docs when extending Activity. For the custom layout from Android Studio that’s not the best idea … Heres the now working Activity class:

@JavaProxy("com.example.Activities.ExampleActivity")
class ExampleActivity extends android.app.Activity {

    protected onCreate(savedInstanceState: android.os.Bundle): void {
        super.onCreate(savedInstanceState);

        let layout = this.getResources().getIdentifier("activity_example", "layout", this.getPackageName());
        this.setContentView(layout);
    }

}

The layout is located at: app/App_Resources/Android/layout/activity_example.xml

I also had to copy a dimens.xml file to app/App_Resources/Android/values/dimens.xml from Android Studio.


#3

Hey can you tell me - are u able to call android activity from nativescript.If so can you share some sort of code to implement the same. Thanks


#4

are u able to call android activity from nativescript.

Yes I am.

If so can you share some sort of code to implement the same. Thanks

I already did with my second post to this thread.

If you get stuck you may have to ask more precisely.


#5

this is what i’m trying to achieve. I have created a project in nativescript and then i have imported the project in android studio. created a new activity in android that calls my nativescript activity. but
now i want to call some another activity in java to get called from nativescript activity.


#6

So if i understand you correctly you

  1. have an existing app
  2. want to integrate some parts with {NS}
  3. to accomplish that you switch to the main {NS} activity
  4. at some point you want to switch back to a activity of your existing app

Is that correct? If so: I think my code will help you accomplish (4.) for sure.
About (2.) and (3.): I’m not sure if that can be easily done. Have a look at the docs thought.

But anyways: Since you seem to have an existing Android App you should know how to switch between activities. That’s not really {NS} related thought.


#7

Yeah You got me correctly. the link you gave i have already used it but now the problem im getting is calling activity defined in android manifest of android application from javascript.


#8

I think you should merge them and end up with one AndroidManifest.xml that contains the additional {NS} Activity. At least that’s what I’d try thought I don’t have experience with this particular issue because in my case I had different goals.


#9

Below is my Manifest including my adroid main activity and my nativescript activity-

  <application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".MyCustomNativeScriptActivity" />
    <activity android:name=".addEvent">
    </activity>
</application>

can you tag or refer someone who might can help me in this case. Thanks


#11

I’m trying to start activity from aar file, when i used the code you have posted

let intent: android.content.Intent = new android.content.Intent(
        application.android.foregroundActivity,
        com.example.Activities.ExampleActivity["class"]
    );

    application.android.foregroundActivity.startActivity(intent);

it threw an error on

 com.example.Activities.ExampleActivity["class"]

for com is not defined, what kind of imports you have?


#12

Give this a try: declare const com: any;


#13

It didn’t work, What i’m tying to do is to run a UnityPlayerActivity from a generated .aar file
I have created an extension for the activity

@JavaProxy('com.ShbaitaStudio.BountyRun.UnityPlayerActivity')
export class GameActivity extends android.app.Activity {

}

And i have tried to call the activity using the following code

let intent: android.content.Intent = new android.content.Intent(
      app.android.foregroundActivity,
      GameActivity.class
    );
    app.android.foregroundActivity.startActivity(intent);

This is method is other than the one i mentioned above, but even using the earlier method declaring

const com:any;

didn’t work, now this method throws the following error

Error: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
System.err:     android.content.ComponentName.<init>(ComponentName.java:128)
System.err:     android.content.Intent.<init>(Intent.java:4970)
System.err:     com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err:     com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err:     com.tns.FragmentClass.onCreateView(FragmentClass.java:40)
System.err:     android.app.Fragment.performCreateView(Fragment.java:2361)
System.err:     android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1000)
System.err:     android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1178)
System.err:     android.app.BackStackRecord.run(BackStackRecord.java:815)
System.err:     android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1585)
System.err:     android.app.FragmentController.execPendingActions(FragmentController.java:371)
System.err:     android.app.Activity.performResume(Activity.java:7011)
System.err:     android.app.ActivityThread.performResumeActivity(ActivityThread.java:3611)
System.err:     android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3676)
System.err:     android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2876)
System.err:     android.app.ActivityThread.-wrap12(ActivityThread.java)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
System.err:     android.os.Handler.dispatchMessage(Handler.java:105)
System.err:     android.os.Looper.loop(Looper.java:156)
System.err:     android.app.ActivityThread.main(ActivityThread.java:6577)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
System.err: File: "file:///data/data/org.nativescript.demo/files/app/tns_modules/nativescript-unity/unity.common.js, line: 15, column: 21

#14

You may try this but it’s hard to help without being able to debug etc.:

let intent: android.content.Intent = new android.content.Intent(
    app.android.foregroundActivity,
    (com as any).ShbaitaStudio.BountyRun.UnityPlayerActivity["class"]
);

app.android.foregroundActivity.startActivity(intent);

#15

it threw this error

TypeError: Cannot read property 'ShbaitaStudio' of undefined

#16

i had to declare

let com: any;

so the typescript won’t throw error

cannot find name com

#17

@anas.zgh Is your issue resolved?

declare let com: any;

...

com.ShbaitaStudio.BountyRun.UnityPlayerActivity["class"]

or

(com as any).ShbaitaStudio.BountyRun.UnityPlayerActivity["class"]

should both do the trick… Whatever you prefer.


#18

Unfortunately no, none of the above methods worked for me, when used the latter method

(com as any).ShbaitaStudio.BountyRun.UnityPlayerActivity["class"]

it threw a runtime error

TypeError: Cannot read property 'ShbaitaStudio' of undefined

#19

@anas.zgh Did you register your Java proxied class in AndroidManifest.xml like this:

<activity android:name="com.ShbaitaStudio.BountyRun.UnityPlayerActivity"></activity>

Also make sure that you do a clean build. (e. g. platform remove & add then run)


#20

I have tried declaring the activity in the manifest before, but it threw a java Dex error

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/ShbaitaStudio/BountyRun/UnityPlayerActivity;

I have removed the platform and added it again before trying this method now, and it threw the same error


Custom activity java.lang.ClassNotFoundException
#21

@anas.zgh Stick to the NativeScript docs. You need to get this right before trying anything else. Once you can do a console.dir((com as any).ShbaitaStudio.BountyRun.UnityPlayerActivity); without errors or undefined as output you can continue with my suggested code.

Also make sure to put the activity into it’s own dedicated file and remove the export statement. See if that helps. I can imagine it could cause trouble. Keep in mind to always test with clean builds. (platform remove + add, then run)