AdaptiveCard native method on android not found - android

i'm tring to launch the basic adaptive card example using maven central depencdency but i'm having an error because native method impl is not being found.
I have just add the dependency to my build.gradle:
compile 'io.adaptivecards:adaptivecards-android-arm:1.0.0'
This is the error:
11-13 18:19:55.944 16684-16970 E/zygote: No implementation found for long com.microsoft.adaptivecards.objectmodel.AdaptiveCardObjectModelJNI.AdaptiveCard_DeserializeFromString(java.lang.String) (tried Java_com_microsoft_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_AdaptiveCard_1DeserializeFromString and Java_com_microsoft_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_AdaptiveCard_1DeserializeFromString__Ljava_lang_String_2)
11-13 18:19:55.945 16684-16684 D/AndroidRuntime: Shutting down VM
11-13 18:19:55.949 16684-16684 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.tuenti.messenger, PID: 16684
java.lang.UnsatisfiedLinkError: No implementation found for long com.microsoft.adaptivecards.objectmodel.AdaptiveCardObjectModelJNI.AdaptiveCard_DeserializeFromString(java.lang.String) (tried Java_com_microsoft_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_AdaptiveCard_1DeserializeFromString and Java_com_microsoft_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_AdaptiveCard_1DeserializeFromString__Ljava_lang_String_2)
at com.microsoft.adaptivecards.objectmodel.AdaptiveCardObjectModelJNI.AdaptiveCard_DeserializeFromString(Native Method)
at com.microsoft.adaptivecards.objectmodel.AdaptiveCard.DeserializeFromString(AdaptiveCard.java:105)
I have checked the generated APK and it contains the SO for adaptive cards but still does not work.

Try adding a static ctor before accessing the API and see if that helps.
static {
System.loadLibrary("adaptivecards-native-lib");
}

Related

androidx.paging.InitialDataSource cannot be cast to com.firebase.ui.firestore.paging.FirestoreDataSource

Here is what I get on mAdapter.startListening()
I have extended my adapter from FirestorePagingAdapter
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.valorem.flobooks.debug, PID: 14886
java.lang.ClassCastException: androidx.paging.InitialDataSource cannot be cast to com.firebase.ui.firestore.paging.FirestoreDataSource
at com.firebase.ui.firestore.paging.FirestorePagingAdapter$5.apply(FirestorePagingAdapter.java:98)
at com.firebase.ui.firestore.paging.FirestorePagingAdapter$5.apply(FirestorePagingAdapter.java:95)
at androidx.lifecycle.Transformations$2.onChanged(Transformations.java:143)
at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:152)
at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:146)
at androidx.lifecycle.LiveData$ObserverWrapper.activeStateChanged(LiveData.java:468)
at androidx.lifecycle.LiveData.observeForever(LiveData.java:234)
at androidx.lifecycle.MediatorLiveData$Source.plug(MediatorLiveData.java:141)
at androidx.lifecycle.MediatorLiveData.onActive(MediatorLiveData.java:118)
at androidx.lifecycle.LiveData.changeActiveCounter(LiveData.java:390)
at androidx.lifecycle.LiveData$ObserverWrapper.activeStateChanged(LiveData.java:466)
at androidx.lifecycle.LiveData.observeForever(LiveData.java:234)
at com.firebase.ui.firestore.paging.FirestorePagingAdapter.startListening(FirestorePagingAdapter.java:181)
at com.valorem.flobooks.helpAndSupport.CategoryQuestionsFragment.onStart(CategoryQuestionsFragment.kt:91)
I fixed this issue by updating my grade file.
Initially I only had:
dependencies {
implementation("androidx.paging:paging-runtime:2.1.2")
}
but then I added the rest shown in the documentation here
https://developer.android.com/topic/libraries/architecture/paging
dependencies {
implementation("androidx.paging:paging-runtime:2.1.2")
// alternatively - without Android dependencies for testing
testImplementation("androidx.paging:paging-common:2.1.2")
// optional - RxJava support
implementation("androidx.paging:paging-rxjava2:2.1.2")
}

Android Runtime Error using Scala and libGDX with Gradle

I want to build android apk in my libGdx project but I got this error shows up
My other projects with libgdx and scala works well.
I have it on this part of the code:
tempArray = stage.getActors.items.array.filter(_ != null).filter(_.getName == "ball1")
W/com.scala.gdx: Accessing hidden method Ljava/lang/invoke/VarHandle;->releaseFence()V (blacklist, reflection, denied)
E/AndroidRuntime: FATAL EXCEPTION: GLThread 456
Process: com.scala.gdx, PID: 8618
java.lang.ExceptionInInitializerError
...
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1557)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)
Caused by: java.lang.NoSuchMethodException: java.lang.invoke.VarHandle.releaseFence []
at java.lang.Class.getMethod(Class.java:2072)
at java.lang.Class.getDeclaredMethod(Class.java:2050)
at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:782)
...
at a.a.a.p.a.l.onSurfaceChanged(:310) 
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1557) 
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272) 

Possible bug on Android Starter SDK initialization

I'm using the Starter SDK v3.13.2.8 to perform auto-suggest searches in an Android app. It works well on Android versions 9 and 4.2. But on Android 5.1.1 (API 22), the app crashes. Here's the stack trace:
11-01 16:24:09.022 341-430/com.example.myapp.debug E/AndroidRuntime: FATAL EXCEPTION: pool-2-thread-1
Process: com.example.myapp.debug, PID: 341
java.lang.NoSuchMethodError: No virtual method getActiveNetwork()Landroid/net/Network; in class Landroid/net/ConnectivityManager; or its super classes (declaration of 'android.net.ConnectivityManager' appears in /system/framework/framework.jar)
at a.a.a.a.a.v0.a(MapsUtils.java:23)
at a.a.a.a.a.v0.a(MapsUtils.java:20)
at a.a.a.a.a.h.e(AnalyticsTrackerExternal.java:6)
at a.a.a.a.a.h.d(AnalyticsTrackerExternal.java:1)
at a.a.a.a.a.h$c.run(AnalyticsTrackerExternal.java:50)
at a.a.a.a.a.h$i.run(AnalyticsTrackerExternal.java:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
In order for this exception to be thrown, I don't even need to dispatch the request. All I need to do is to initialize the map engine:
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
MapEngine.getInstance().init(ApplicationContext(this)) {
Log.d("HereInit", "$it")
}
}
}
Before the app crashes, though, it's possible to see the log output from the MapEngine.init callback:
11-01 16:24:10.079 341-341/com.example.myapp.debug D/HereInit: NONE
Fix will be included in SDK 3.14 release. From all projects tab inside the portal, the new version which is 4.1 can be downloaded.

FATAL EXCEPTION: GoogleApiHandler

In my project i'm using the monetization service(Vungle/AppLovin).
When I'm trying to load an ad, i get this exception
E/AndroidRuntime: FATAL EXCEPTION: GoogleApiHandler
Process: kz.ikar, PID: 3673
java.lang.NoSuchMethodError: No virtual method setChannelId(Ljava/lang/String;)Landroid/support/v4/app/NotificationCompat$Builder; in class Landroid/support/v4/app/NotificationCompat$Builder; or its super classes (declaration of 'android.support.v4.app.NotificationCompat$Builder' appears in /data/app/kz.ikar-2oCl4DY4J8w7wP-jirbYvA==/split_lib_dependencies_apk.apk)
at com.google.android.gms.common.GoogleApiAvailability.zza(Unknown Source:225)
at com.google.android.gms.common.GoogleApiAvailability.zza(Unknown Source:15)
at com.google.android.gms.common.api.internal.zzbm.zzc(Unknown Source:4)
at com.google.android.gms.common.api.internal.zzbo.onConnectionFailed(Unknown Source:104)
at com.google.android.gms.common.api.internal.zzbo.connect(Unknown Source:83)
at com.google.android.gms.common.api.internal.zzbo.zza(Unknown Source:47)
at com.google.android.gms.common.api.internal.zzbm.handleMessage(Unknown Source:283)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:164)
at android.os.HandlerThread.run(HandlerThread.java:65)
In my project I have two fragments in one activity. The user gets an ad in the second one. If I load an ad from the activity, it works well. What can be the cause of this issue?
By the way both ad networks(Vungle and AppLovin) return this exception
I had the same problem and I fixed it downgrading to firebase Google Play services 11.6.0
One reason you could be getting this error is if your buildToolsVersion in your app-level Gradle is less than 26. Either that or your v4 support is less than 26.0.0 seeing as NotificationCompat.Builder was added in API 26.

NoClassDefFoundError when trying to build google api client

today i added the google play services library to my project. I have followed the instructions which are given on http://developer.android.com/google/play-services/setup.html#ensure
Screenshot of my Settings: https://drive.google.com/file/d/0Bwe9sI6XZ6rcZGZzdmlaQjVheDA/edit?usp=sharing
The problem is when I try to execute the following code, a noclassdeffounderror exception raises.
public class MainActivity extends Activity {
private GoogleApiClient mGoogleClient;
#Override
protected void onCreate(Bundle savedInstanceState) {
mGoogleClient = new GoogleApiClient.Builder(this)
.addApi(Games.API)
.addScope(Games.SCOPE_GAMES)
.setGravityForPopups(Gravity.TOP | Gravity.CENTER_HORIZONTAL)
.build();
In the logcat the exception looks like
threadid=1: thread exiting with uncaught exception (group=0x40d02930)
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.google.android.gms.common.api.GoogleApiClient$Builder
at com.gmail.mhofer4991.at.taptorotate.MainActivity.onCreate(MainActivity.java:104)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2147)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$600(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5074)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Force finishing activity com.example.taptorotate/com.gmail.mhofer4991.at.taptorotate.MainActivity
I also have cleaned and rebuilt the project.
It's driving me crazy that i cannot solve the problem. I know there are already other threads with the same topic and I also tried some solutions which were suggested there but none of them worked for me. Please help me out!
I also had same problem,
java.lang.NoClassDefFoundError:
com.google.android.gms.common.api.GoogleApiClient$Builder
I was using the below dependency on the application build.gradle file.
compile 'com.google.android.gms:play-services:7.8.0'
I changed it to
compile 'com.google.android.gms:play-services-plus:7.8.0'
I updated the Google Play Services (Rev 26) and Google Repository(Rev 20).
After that the exception doesn't occur.
Try to use individual APIs and corresponding build.gradle descriptions as mensioned in the following page,
https://developers.google.com/android/guides/setup#ensure
Try to add obfuscation rules for the Google API's if you have minifyEnabled or ProGuard set to true:
ProGuard Configuration
tryin to work with an implementation of Google Drive in Android i´ve found this error message pointing some classes like:
java.lang.ClassNotFoundException: com.google.android.gms.common.api.Scope
Caused by: java.lang.ClassNotFoundException: Didn't find class
I have found that the real problem is the limit of 64K references when we add dependencies related to GoogleApiClient, so adding multidex support solved my problem:
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
...
...
multiDexEnabled true
}
...
...

Categories

Resources