Android/Adobe air crash report: java.lang.UnsatisfiedLinkError - java

i am getting this error inside Google's "Crashes & ANRs". The application built with Adobe Air and packaged as captive runtime.
java.lang.UnsatisfiedLinkError: nativeSurfaceCreated
at com.adobe.air.AIRWindowSurfaceView.nativeSurfaceCreated(Native Method)
at com.adobe.air.AIRWindowSurfaceView.surfaceCreated(AIRWindowSurfaceView.java:719)
at android.view.SurfaceView.updateWindow(SurfaceView.java:545)
at android.view.SurfaceView.access$000(SurfaceView.java:81)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:169)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:693)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1731)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2583)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4508)
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:809)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
at dalvik.system.NativeStart.main(Native Method)
Does anybody know what this means?

The UnsatisfiedLinkError for Java usually means that you tried to load a library called nativeSurfaceCreated. Basically your code called a method that called a method and so on, and some code somebody else wrote called a native method. This native method loaded a library called nativeSurfaceCreated, which you don't have. This is usually packaged in a dll in Windows or a so file in Linux. If you can find this dll/so file, you can probably run whatever you're running.

Related

Silent install APK programmatically

Sorry for my poor English. I want to figure out how to install (or delete) APK file silently without root programmatically.
First of all I added android:sharedUserId="android.uid.system" to manifest, and permissions
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission
android:name="android.permission.INSTALL_PACKAGES"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.DELETE_PACKAGES" tools:ignore="ProtectedPermissions"/>
Code of installing and deleting
public void installApp(File file){
try {
final String command = "pm install " + file.getPath();
Process proc = Runtime.getRuntime().exec(new String[] {command });
proc.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
}
public void deleteApp(String appPackage){
try {
final String command = "pm uninstall " + appPackage;
Process proc = Runtime.getRuntime().exec(new String[] {command });
proc.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
}
And as I know I need manufacturer keys to sign my App. I didn't found keys for Android Studio emulators, so for example I downloaded an image of Android 4.4 r2 from here http://www.android-x86.org/releases/releasenote-4-4-r2 (and mount it in Oracle VM) and got keys from here https://sourceforge.net/p/android-x86/build/ci/android-x86-4.4-r2/tree/target/product/security/ .As I understood platform.x509.pem and platform.pk8 are keys what I needed.
I signed my App with signapk.jar something like this java -jar signapk.jar platform.x509.pem platform.pk8 app.apk signapp.apk.
But it doesn't work. Some of attempts ended with error:
Uninstall
07-30 04:42:46.050 1477-1477/com.jinga.jihome W/System.err: java.io.IOException: Error running exec(). Command: [pm uninstall ru.bogdanov.mom] Working Directory: null Environment: null
at java.lang.ProcessManager.exec(ProcessManager.java:211)
07-30 04:42:46.060 1477-1477/com.jinga.jihome W/System.err: at java.lang.Runtime.exec(Runtime.java:173)
at java.lang.Runtime.exec(Runtime.java:128)
at com.jinga.jihome.updater.packageInstaller.PackageInstallerHelper.deleteApp(PackageInstallerHelper.java:59)
at com.jinga.jihome.MainActivity.onCreate(MainActivity.java:102)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
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:779)
07-30 04:42:46.070 1477-1477/com.jinga.jihome W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.io.IOException: Permission denied
at java.lang.ProcessManager.exec(Native Method)
at java.lang.ProcessManager.exec(ProcessManager.java:209)
Install
07-30 04:42:49.420 1477-1477/com.jinga.jihome W/System.err: java.io.IOException: Error running exec(). Command: [pm install /storage/sdcard/app-debug.apk] Working Directory: null Environment: null
at java.lang.ProcessManager.exec(ProcessManager.java:211)
at java.lang.Runtime.exec(Runtime.java:173)
07-30 04:42:49.430 1477-1477/com.jinga.jihome W/System.err: at java.lang.Runtime.exec(Runtime.java:128)
at com.jinga.jihome.updater.packageInstaller.PackageInstallerHelper.installApp(PackageInstallerHelper.java:49)
at com.jinga.jihome.MainActivity$2.onSuccess(MainActivity.java:135)
at com.jinga.jihome.MainActivity$2.onSuccess(MainActivity.java:126)
at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:81)
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:109)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
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:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.io.IOException: No such file or directory
at java.lang.ProcessManager.exec(Native Method)
at java.lang.ProcessManager.exec(ProcessManager.java:209)
Some of signed apks doesn't want to install with error like App conflicts with existing package by the same nameor what my device not incompatible for this Apk, but without signing all ok.
I've tried with different images, key pairs and emulators, but not succeed, what I did wrong?
I too have an app which installs and updates apks on client devices.
It is also signed with the platform signing keys which means we have permission to install this on their players!
On Android 8.x I've had to set
android:sharedUserId="android.uid.shell"
in the to make it work. I'm using the command:
File localApk = new File("apkName.apk");
String[] Commands = {"pm", "install", "-r", localApk.getAbsolutePath()};
Runtime.getRuntime().exec(Commands);
Without the shareUserId being set I always got permission errors.
Permissions defined in app's manifest have nothing to do with shell commands. They guard the Java API.
DELETE_PACKAGES permission guards the PackageManager#deletePackage method. It's not part of the public SDK so you'll have to access it using reflection (or compile your app against unhidden android.jar).
The reflection path
You'll need to copy this interface to your project:
package android.content.pm;
interface IPackageDeleteObserver {
void packageDeleted(String packageName, int returnCode);
}
Then call the deletePackage method using reflection. Here's a sample in Kotlin:
private val deletePackageMethod = PackageManager::class.java.getDeclaredMethod(
"deletePackage",
String::class.java,
IPackageDeleteObserver::class.java,
Int::class.javaPrimitiveType
)
#RequiresPermission(Manifest.permission.DELETE_PACKAGES)
fun PackageManager.deletePackage(
packageName: String,
observer: IPackageDeleteObserver,
flags: Int
) {
deletePackageMethod.invoke(this, packageName, observer, flags)
}
You can find the flags and return codes in PackageManager source code as constants prefixed with DELETE_.
So far this is all tested and verified.
Notes: Reflection is extra work, so we do the method lookup only once. The method is hidden but public so you don't need to call setAccessible(true).
Warning: Please test this on Android 9, I can't guarantee this works with the ban on accessing hidden API. I think since your app is signed with the system signature and runs as the system user, it should have no problem.
The unhide path
If you compile against the modified android.jar you can directly reference types mentioned above.
The only problem I encountered was that gradle task mockableAndroidJar is not compatible with modified android.jar. You'll have to exclude that task from execution by adding -x mockableAndroidJar to gradle command line in the IDE.
I haven't actually tried it, I can't tell you if the IDE will let you any further.

java.lang.NoClassDefFoundError: com.google.android.gms.common.internal.zzbo

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

ClassNotFoundException Mystery

Google Play Console is reporting a minute percentage of my users are getting a ClassNotFoundException upon app launch. The mystery is, which is the class that cannot be found? Well, the Stacktrace is supposed to state the name, but in these cases it is missing the name. The following is the trace, which is being sent by multiple devices:
java.lang.RuntimeException:
at android.app.LoadedApk.makeApplication(LoadedApk.java:507)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4720)
at android.app.ActivityThread.access$1500(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1343)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5584)
at java.lang.reflect.Method.invokeNative(Method.java:0)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(NativeStart.java:0)
Caused by: java.lang.ClassNotFoundException:
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newApplication(Instrumentation.java:982)
at android.app.LoadedApk.makeApplication(LoadedApk.java:502)
As you can see, the standard "Didn't find class "xx.yy.zz" message is missing!
Any ideas?
i just created an account to ask something so i couldn't help you by a comment:) sorry to make this little hint as an answer.
the last exception without a cause is the interesting one.
my answer despite the data you shared from your project is to look after the line "Caused by: java.lang.ClassNotFoundException:" in your log output, just below that line goto "BaseDexClassLoader.java:56" by clicking on it, it's the first line in its stack trace ,this line tells you the class and method where the exception with no cause occurred as well as its file and line number, i am pretty sure you will find more clues searching from there as that place is probably caused the main problem.

java.lang.NoClassDefFoundError: java.awt.Image in android

I am facing the following issue in Android.
FATAL EXCEPTION: main
Process: pkg.demo, PID: 22090
java.lang.NoClassDefFoundError: java.awt.Image
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.(RuntimeBuiltinLeafInfoImpl.java:372)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.(RuntimeTypeInfoSetImpl.java:65)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:133)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:85)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.(ModelBuilder.java:156)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.(RuntimeModelBuilder.java:93)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:455)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:303)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:142)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1174)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:162)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:363)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
The cause of your problem is in the first line of the exception:
FATAL EXCEPTION: main Process: pkg.demo, PID: 22090 java.lang.NoClassDefFoundError: java.awt.Image at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.
Android cannot find the class java.awt.Image. This is because Image is an AWT class; AWT is a toolkit that does not exist in Android.
This error originates at com.sun.xml.bind.v2.modle.impl.RuntimeBuiltinLeafInfoImpl. So, it seems you've added a library that relies upon AWT.
The solution is to see if this library has been ported to Android; then use the Android port.
If there is no port, you'll have to find another library.

Java.Lang.VerifyError, Jenkins bug?

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.

Categories