• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

App Inventor Game Crashing on Real Device & emulator, any help please ?

My game is crashing on a real device as well as on emulator & when I check in Logcat I see this error:-

2019-01-20 10:46:50.444 4990-4990/com.app.app_name E/art: No implementation found for boolean com.app_ad_secret.utils.PTJniHelper.isAdNetworkActive(java.lang.String) (tried Java_com_app_1ad_1secret_utils_PTJniHelper_isAdNetworkActive and Java_com_app_1ad_1secret_utils_PTJniHelper_isAdNetworkActive__Ljava_lang_String_2) 2019-01-20 10:46:50.445 4990-4990/com.app.app_name E/AndroidRuntime: FATAL EXCEPTION: main Process: com.app.app_name, PID: 4990 java.lang.UnsatisfiedLinkError: No implementation found for boolean com.app_ad_secret.utils.PTJniHelper.isAdNetworkActive(java.lang.String) (tried Java_com_app_1ad_1secret_utils_PTJniHelper_isAdNetworkActive and Java_com_app_1ad_1secret_utils_PTJniHelper_isAdNetworkActive__Ljava_lang_String_2) at com.app_ad_secret.utils.PTJniHelper.isAdNetworkActive(Native Method) at com.app.app_name.PTPlayer.onStart(PTPlayer.java:115) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1248) at android.app.Activity.performStart(Activity.java:6679) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2609) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6077) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)

When I opened that (PTPlayer.java:115), it took me to this method:-

@override
protected void onStart() {
super.onStart();
if (PTJniHelper.isAdNetworkActive("kAdMob")) {
rohit_ad_chart_boost.onStart( this );
}
}

I don't understand the problem here & what's causing this? Can someone please just tell me the problem here.
 
Looks like you've got a missing library, or dependency version issue. Are you sure this code compiles correctly?
 
So if you hover over that line in your code and open the declaration for isAdNetworkActive(), where does it take you to?
 
So if you hover over that line in your code and open the declaration for isAdNetworkActive(), where does it take you to?
When i hover over to isAdNetworkActive() it doesn't take me anywhere it's just error message with no link but yeah i click on "at com.app_name.PTPlayer.onStart(PTPlayer.java:115)", it takes me here :-

@override
protected void onStart() {
super.onStart();
if (PTJniHelper.isAdNetworkActive("kAdMob")) {
rohit_ad_chart_boost.onStart( this );
}
}
 
And where is the code for PTJniHelper?

I want to see that class definition.
 
And where is the code for PTJniHelper?

I want to see that class definition.
yeah it's java class in app/java/app_name/utils/PtJniHelper

which contains this :-

package com.app_name.utils;

public class PTJniHelper {
public static native void loadModelController();
public static native boolean isAdNetworkActive( String name );
}
 
So that's a method defined by a native library. That is code written in C or C++, which has been compiled, and your Java code can use that library, and invoke methods which it defines.

Normally when you use a native library, your code would have to specifically reference it by using a static initializer block like this

Code:
static {
        System.loadLibrary("fubar");
    }

As we can't see the rest of your code, we have no idea if it's doing that.
When the native library has been loaded, then your code should be able to invoke anything defined within that library. But it sounds like you're not loading the required library. I have no idea what that is, and nobody else would be able to answer that question.
But my question is, what are the origins of this code? If you wrote it, then surely you know what native libraries are needed. If you got the code from someone else, then it should have all the dependencies, or you could ask them what's missing.
 
N
So that's a method defined by a native library. That is code written in C or C++, which has been compiled, and your Java code can use that library, and invoke methods which it defines.

Normally when you use a native library, your code would have to specifically reference it by using a static initializer block like this

Code:
static {
        System.loadLibrary("fubar");
    }

As we can't see the rest of your code, we have no idea if it's doing that.
When the native library has been loaded, then your code should be able to invoke anything defined within that library. But it sounds like you're not loading the required library. I have no idea what that is, and nobody else would be able to answer that question.
But my question is, what are the origins of this code? If you wrote it, then surely you know what native libraries are needed. If you got the code from someone else, then it should have all the dependencies, or you could ask them what's missing.
No that's the problem i didn't wrote this code i bought it
 
But it has all dependencies

Clearly not, because the runtime is reporting it can't find any implementation for your method. That means you don't have the required dependent library.
I'd get back to the person you bought this from, and ask them what's going on, or to supply everything needed to run it.
 
Clearly not, because the runtime is reporting it can't find any implementation for your method. That means you don't have the required dependent library.
I'd get back to the person you bought this from, and ask them what's going on, or to supply everything needed to run it.
ok thank you so much for helping me out
 
Back
Top Bottom