RoboGuice Proguard CreationException - java

I'm using Roboguice 3.0.1 with RoboBlender 3.0.1. I've read the wiki. This application has been working perfectly since 3.0.1 has been GA (almost a year), and I just added proguard to my project. I've seemingly setup the proguard configuration correctly.
Anytime I run the application, I get this error immediately (this is all that is printed; no stack trace or anything).
11-24 01:36:05.473 12995-12995/com.me D/roboguice.RoboGuice: Using annotation database(s).
11-24 01:36:05.475 12995-12995/com.me D/roboguice.RoboGuice: Using annotation database(s) : [com.me, roboguice]
11-24 01:36:05.485 12995-12995/com.meD/roboguice.RoboGuice: Time spent loading annotation databases : 8
11-24 01:36:05.822 12995-12995/com.me E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.me, PID: <pid>
java.lang.RuntimeException: Unable to create application com.me.MeApplication: com.google.inject.CreationException: Unable to create injector, see the following errors:
Note: I've posted this as an issue in the RoboGuice repo, but since that place looks dead, I figured I'd be more likely to get help here.

Looks like it's an issue with Guice. There was an error at this line, but no error was printed.
Guice Issue

Related

Hello, I have a problem trying to port a certain OEM android app

I'm trying to port LG system launcher but I can't get it to work due to a certain missing class called "LGSharedPreferences" or something like that. Here is the logcat obtained:
FATAL EXCEPTION: main
Process: com.lge.launcher3, PID: 9174
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/app/LGSharedPreferences;
at com.lge.launcher3.util.LGHomeFeature.getPermanentPreferences(LGHomeFeature.java:416)
at com.lge.launcher3.util.LGHomeFeature.getSwivelHomeStateFromPreferences(LGHomeFeature.java:369)
at com.lge.launcher3.util.LGHomeFeature.<init>(LGHomeFeature.java:278)
at com.lge.launcher3.util.LGHomeFeature.init(LGHomeFeature.java:294)
at com.lge.launcher3.allapps.SwivelAllAppsDBProvider.onCreate(SwivelAllAppsDBProvider.java:28)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at android.app.ActivityThread.installProvider(ActivityThread.java:7248)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6789)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6706)
at android.app.ActivityThread.access$1300(ActivityThread.java:238)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1914)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7666)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.ClassNotFoundException: android.app.LGSharedPreferences
... 18 more
If it helps I tried both installing it as a user app and making a magisk module to install it as a system app (also I bundled with it some libraries I found in the app manifest such as "com.lge.sui" and "com.lge.lgdynamicactionbar" but no luck) and I always get the same error, some help will be highly appreciated 👍
By the way, sorry for my bad English, I'm still learning :)
The error message means that android.app.LGSharedPreferences was available at compile time, but is missing at runtime. Given the package name of the class, my guess would be that the class is supposed to be loaded from the OS on LG phones, and you are running the app on a phone that doesn't have that available.
If you have the source code for the app and the library that contains android.app.LGSharedPreferences, you should make sure the library containing LGSharedPreferences is statically compiled in (probably also change the package name to avoid conflicts on LG phones).

After upgrading to new Jenkins version, builds are failing

I just upgraded the jenkins from 2.63 to 2.117 (Which I'm regretting now)
Here is the error message I'm getting at the end of all the jobs.
Please help me to understand and resolve this.
FATAL: java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class hudson.model.FreeStyleBuild
java.lang.UnsupportedOperationException: Refusing to marshal java.io.PrintStream for security reasons; see https://jenkins.io/redirect/class-filter/
at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:543)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.EnvironmentVarSetter#log for class org.jenkinsci.plugins.EnvironmentVarSetter
at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
Caused: java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class hudson.model.FreeStyleBuild
at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
at hudson.XmlFile.write(XmlFile.java:193)
Caused: java.io.IOException
at hudson.XmlFile.write(XmlFile.java:200)
at hudson.model.Run.save(Run.java:1923)
at hudson.model.Run.setDisplayName(Run.java:803)
at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.setDisplayName(BuildNameSetter.java:76)
at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.access$000(BuildNameSetter.java:31)
at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter$1.tearDown(BuildNameSetter.java:64)
at hudson.model.Build$BuildExecution.doRun(Build.java:174)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1727)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Note: Others who are using older version of jenkins, there is a big chance that all your jobs will be messed up. So, Please do not update jenkins as of now. (https://jenkins.io/blog/2018/03/15/jep-200-lts/)
You can try the solution given in the official site of Jenkins
https://issues.jenkins-ci.org/browse/JENKINS-49144
Add the three following entries to whitelisted-classes.txt:
java.util.concurrent.locks.ReentrantLock
java.util.concurrent.locks.ReentrantLock$NonfairSync
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject
It is to do with the two things.
Permission to be updated to the .war file.
Build Pipeline plugin needs to be updated.
This solved my problem.
It's a known security fix in Jenkins https://github.com/jenkinsci/jep/tree/master/jep/200.
You can check list of affected plugins https://wiki.jenkins.io/display/JENKINS/Plugins+affected+by+fix+for+JEP-200 and upgrade your affected ones to overcome the error.

JDK 8u161 breaks JMX Integration

I'm working with a piece of code that's quite old. It works absolutely fine with the versions of Java older than 8u161.
This is the error I get on 8u161 and beyond releases.
[main] ******** - Failed to create JmxConnectInfo!
java.lang.AbstractMethodError
at javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:150)
at javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:135)
at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:405)
This error is triggered from a class that extends javax.management.remote.rmi.RMIConnectorServer where I invoke the code
super.start()
I'm sure that this error is caused by JDK-8159377 but I'm unable to figure a way out!
Can someone pls advise?

My app crashes on launch?

I apologize for the broad title but I struggle to be more specific because iIhonestly don't know what went wrong. I was working on my app just like normal, and I hadn't tested for a couple of hours and also I think I updated something in android studio (It prompted me that some features were ready to be updated and I clicked)
Anyways, I've reverted everything I could think of that I might have screwed up, but it still won't work. I figure it might be something in the gradle files. Is anyone able to figure it out based on this?
--------- beginning of crash
10-24 14:10:47.679 2597-2597/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.jonet.lillehauaapp, PID: 2597
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.jonet.lillehauaapp-a1apOVe4GHJGjXWwg52Lag==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.jonet.lillehauaapp-a1apOVe4GHJGjXWwg52Lag==/lib/x86, /system/lib, /system/vendor/lib]]] couldn't find "libnative-lib.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
at java.lang.System.loadLibrary(System.java:1657)
at com.example.jonet.lillehauaapp.MainActivity.<clinit>(MainActivity.java:25)
at java.lang.Class.newInstance(Native Method)

Eclipse Java - Android app using serial do not work

I'm trying to use an app in Eclipse (v3.8), but it don't work.
The API is 19, and the app is Serial_Port_1.1.apk
My method: (I'm new with eclipse)
Extract the apk with apktool
Import the folder with Eclipse
Run as: Android application
I got theses errors:
threadid=1: thread exiting with uncaught exception (group=0xb3ac2ba8)
FATAL EXCEPTION: main
Process: android_serialport_api.sample, PID: 1508
java.lang.RuntimeException: Unable to instantiate application android_serialport_api.sample.Application: java.lang.ClassNotFoundException: Didn't find class "android_serialport_api.sample.Application" on path: DexPathList[[zip file "/data/app/android_serialport_api.sample-1.apk"],nativeLibraryDirectories=[/data/app-lib/android_serialport_api.sample-1, /vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4317)
I'm trying to connect an Arduino to Eclipse, and the app works fine on a real system (ARM Orange Pi)
As it says in the LogCat, there is a ClassNotFoundException when you try to run it after decompile. As I understood, the original app works but after decompile + recompile it won't work again, throwing a CNF. This means that your decompile process didn't work properly. I suggest you trying the Android APK Decompiler, which is a free online tool.
Note: I haven't tested it yet, but it should work.

Categories