This question already has answers here:
Android Telegram App --> java.lang.UnsatisfiedLinkError: No implementation found for void
(5 answers)
Closed 6 years ago.
I downloaded the Telegram project from GitHub and imported to Android Studio. The gradle is build without any error but when I run it I get UnsatisfiedLinkError error.
From logCat:
FATAL EXCEPTION: main
Process: org.telegram.messenger.beta, PID: 11299
java.lang.UnsatisfiedLinkError: No implementation found for void org.telegram.tgnet.ConnectionsManager.native_setJava(boolean) (tried Java_org_telegram_tgnet_ConnectionsManager_native_1setJava and Java_org_telegram_tgnet_ConnectionsManager_native_1setJava__Z)
at org.telegram.tgnet.ConnectionsManager.native_setJava(Native Method)
at org.telegram.messenger.ApplicationLoader.onCreate(ApplicationLoader.java:278)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1035)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4638)
at android.app.ActivityThread.access$1500(ActivityThread.java:155)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1378)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
And the line error points to is:
ConnectionsManager.native_setJava(android.os.Build.VERSION.SDK_INT == 14 || android.os.Build.VERSION.SDK_INT == 15);
Got stuck here for 2 days. Help me out. Thanks in advance.
Finally found the solution for it!
The project has C and CPP files that needs libraries which is in .so extension while running in devices.Recently they have deleted those files which is added in the commit section.That is why we get an exception while running.So we have run these C and CPP codes using NDK and Cygwin.
Download NDK:
http://developer.android.com/intl/es/ndk/downloads/index.html
Download Cygwin:
https://www.cygwin.com/
Removing prebuilt libraries. The source code for all libraries is (and always was) available here: https://github.com/DrKLO/Telegram/tree/master/TMessagesProj/jni
Related
This question already has answers here:
Why am I getting a NoClassDefFoundError in Java?
(31 answers)
Can't Import java.awt.font Class
(2 answers)
Closed 21 days ago.
This post was edited and submitted for review 20 days ago and failed to reopen the post:
Original close reason(s) were not resolved
I have a web application, an android application, and a Xamarin application that all need to produce the same report. My idea is to create a java library (.jar) which inside:
contains jasper libraries (jasperreports-6.20.0.jar etc) and related dependencies (iText-2.1.7.jar etc);
contains the .jasper file of the template;
implements a generateReport(jsonData) method that can be called by the three applications that populates the template with the data json passed as an argument.
When importing my .jar library inside android app and Xamarin I got the following error:
--- End of inner exception stack trace ---
at Java.Interop.JniEnvironment+InstanceMethods.CallObjectMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0006e] in <00c315a988634383b446eff646084784>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <00c315a988634383b446eff646084784>:0
at IT.Gpi.SicerVerbali.VerbaliGenerator.GenerateReport (System.String jsonData, System.String templateName, System.String exportType) [0x00058] in C:\VSSProjects\Sicer-App-Basilicata\JarBinding\obj\Debug\generated\src\IT.Gpi.SicerVerbali.VerbaliGenerator.cs:101
at Sicer_App_Basilicata.Droid.DeviceServiceUtility.generaVerbaleAsync (System.String jsonString) [0x00014] in C:\VSSProjects\Sicer-App-Basilicata\Sicer-App-Basilicata.Android\DeviceServiceUtility.cs:39
--- End of managed Java.Lang.NoClassDefFoundError stack trace ---
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/Font;
at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.resolveObject(ContextClassLoaderObjectInputStream.java:121)
at java.io.ObjectInputStream.checkResolve(ObjectInputStream.java:1402)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2003)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:504)
at net.sf.jasperreports.engine.base.JRBaseReport.readObject(JRBaseReport.java:777)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1006)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1903)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1804)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1354)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:374)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:226)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:210)
at it.gpi.sicerVerbali.VerbaliGenerator.generateReport(VerbaliGenerator.java:81)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:7000)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.awt.Font" on path: DexPathList[[zip file "/data/app/com.gpi.sicer_app_basilicata-cQk19TZ0T6FL-L8syxXnRA==/base.apk"],nativeLibraryDirectories=[/data/app/com.gpi.sicer_app_basilicata-cQk19TZ0T6FL-L8syxXnRA==/lib/arm, /data/app/com.gpi.sicer_app_basilicata-cQk19TZ0T6FL-L8syxXnRA==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 24 more
}
Searching online I discovered that Android does not include the java.awt.* package. I also discovered that there is an Android SDK for jasper reports, but I understand that it only works for calls to a Jasper Server, while I need the reports to be produced offline. Can anyone tell me if it can be done and how?
Thanks to anyone who can help me, I'm desperate.
It's not a duplicate of Why am I getting a NoClassDefFoundError in Java? because java.awt.* package is inside jdk and I can't add that in my project as a normal dependency.
I have one old project that runs only in eclipse hence i have downloaded eclipse java photon and configured the ADT tools into it. I have mappped the Android sdk provided by studio with it and tried to run the app into the device but each time i run this app i am getting following error
Installing SLTL.apk...
Installation error: INSTALL_PARSE_FAILED_NO_CERTIFICATES
Please check logcat output for more details.
Launch canceled!
when i checked the logcat i am getting following error
/com.android.defcontainer D/DefContainer: Copying /data/local/tmp/SLTL.apk to base.apk
10-02 14:17:52.233 1957-1990/system_process W/PackageManager: Failed collect during installPackageLI
android.content.pm.PackageParser$PackageParserException: Failed to collect certificates from /data/app/vmdl871259287.tmp/base.apk
at android.content.pm.PackageParser.collectCertificates(PackageParser.java:1130)
at android.content.pm.PackageParser.collectCertificates(PackageParser.java:1057)
at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:12196)
at com.android.server.pm.PackageManagerService.-wrap25(PackageManagerService.java)
at com.android.server.pm.PackageManagerService$9.run(PackageManagerService.java:10156)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
Caused by: java.lang.NullPointerException: Attempt to get length of null array
at java.util.jar.Manifest.read(Manifest.java:201)
at java.util.jar.Manifest.<init>(Manifest.java:106)
at java.util.jar.StrictJarFile.<init>(StrictJarFile.java:66)
at android.content.pm.PackageParser.collectCertificates(PackageParser.java:1072)
at android.content.pm.PackageParser.collectCertificates(PackageParser.java:1057)
at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:12196)
at com.android.server.pm.PackageManagerService.-wrap25(PackageManagerService.java)
at com.android.server.pm.PackageManagerService$9.run(PackageManagerService.java:10156)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
My system configuration is windows 10 and using java 1.8 as compiler with java 1.8 jre , i tried to search lot many threads and blogs but could not find the solution
I have tried editing the Android manifest file too but no luck
I updated my android studio from 3.1.2 to 3.1.3 and updated my project sdk version to 28 and when i run the application it crashes as soon as it open and throws the following exception,
FATAL EXCEPTION: main
Process: com.google.android.apps.nexuslauncher, PID: 10288
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String)' on a null object reference
at android.os.Parcel.createException(Parcel.java:1948)
at android.os.Parcel.readException(Parcel.java:1865)
at android.app.IActivityManager$Stub$Proxy.startActivity(IActivityManager.java:4541)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1660)
at android.app.Activity.startActivityForResult(Activity.java:4574)
at com.android.launcher3.Launcher.startActivityForResult(SourceFile:1394)
at android.app.Activity.startActivity(Activity.java:4889)
at com.android.launcher3.Launcher.startActivitySafely(SourceFile:2000)
at com.android.launcher3.Launcher.startAppShortcutOrInfoActivity(SourceFile:1850)
at com.android.launcher3.Launcher.onClick(SourceFile:1703)
at android.view.View.performClick(View.java:6579)
at android.view.View.performClickInternal(View.java:6556)
at android.view.View.access$3100(View.java:777)
at android.view.View$PerformClick.run(View.java:25660)
at android.os.Handler.handleCallback(Handler.java:819)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
Caused by: android.os.RemoteException: Remote stack trace:
at android.app.LoadedApk.createAppFactory(LoadedApk.java:224)
at android.app.LoadedApk.<init>(LoadedApk.java:152)
at android.app.ActivityThread.getPackageInfo(ActivityThread.java:2043)
at android.app.ActivityThread.getPackageInfo(ActivityThread.java:1998)
at android.app.ActivityThread.getPackageInfo(ActivityThread.java:1970)
It is a problem of API P emulator. On API 28, 27 it works right.
As CoolMind said, It is a problem in API P emulator, you can solve it by updating your Google APIs Intel System Image in Android SDK.
Add these two lines in your gradle.properties file and then build project. After i added these lines, Android Studio showed stacktrace in Logcat.I fixed those issues and then my app started working.
android.enableD8.desugaring = true
android.enableR8 = true
I know this question may be duplicate but I have tried many solutions but I am unable to make my app work. It should be noted that I have enabled Multidex but still getting below error. I am creating a react native app.
FATAL EXCEPTION: main
Process: com.xxxxxx.yyyyyyyy, PID: 3978
java.lang.NoClassDefFoundError: com.google.android.gms.common.internal.zzbo
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5049)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4623)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4563)
at android.app.ActivityThread.access$1500(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1402)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at dalvik.system.NativeStart.main(Native Method)
If you are developing a react native application and above error came , just make sure that all of your dependencies's Gradle are using same version of firebase servces and play service base.
For example :- my app level gradle file contains
compile "com.google.android.gms:play-services-base:11.4.0"
compile "com.google.firebase:firebase-core:11.4.0"
compile "com.google.firebase:firebase-messaging:11.4.0"
compile "com.google.firebase:firebase-analytics:11.4.0"
compile "com.google.firebase:firebase-crash:11.4.0"
compile "com.google.firebase:firebase-ads:11.4.0"
and one react-native library is using
compile "com.google.android.gms:play-services-base:11.8.0"
and other one library is using
compile "com.google.android.gms:play-services-base:+"
so what i did , i changed all services version to 11.8.0.
BTW you can see gradles of all libraries or dependencies when you open your react-native-project/android folder in Android studio
I hope this will solve your issue
I meet a problem, which has blocked my work for three days. :(
when I build my Android project using Ant under Jenkins, the APK can not launch in phone, and Java.Lang.VerifyError exception occurs.
The weird thing is, in the same computer, eclipse can build and create a working apk by calling Ant. The jenkins and eclipse are using the same Ant, JDK, Android SDK and proguard.
Should this be a bug of Jenkins?
I posted the the exception information generated by jenkins built apk below, could anyone give me a hand? Please let me if you need more infromation.
java.lang.VerifyError: com.dewmobile.library.connection.network.m
at com.dewmobile.library.connection.network.s.q(Unknown Source)
at com.dewmobile.library.connection.network.s.a(Unknown Source)
at com.dewmobile.library.connection.service.DmConnectionService.e(Unknown Source)
at com.dewmobile.library.connection.service.DmConnectionService.onCreate(Unknown Source)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:1966)
at android.app.ActivityThread.access$2500(ActivityThread.java:121)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:997)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
at dalvik.system.NativeStart.main(Native Method)
java.lang.VerifyError happens when you have compiled against a different library than you are using at runtime.
I strongly suspect there is some path issue which is picking wrong version at compile time. I would suggest revisit all your configurations one more time.