Facebook Audience Network NoClassDefFoundError - android

I'm using Facebook Audience Network v4.27.0.
The apk compiles fine using Proguard.
Sometimes this crash occurs:
java.lang.NoClassDefFoundError:
at com.facebook.ads.internal.view.b.d.a (Unknown Source)
at com.facebook.ads.internal.view.b.d.<init> (Unknown Source)
at com.facebook.ads.internal.view.b.b.<init> (Unknown Source)
at com.facebook.ads.internal.view.o.<init> (Unknown Source)
at com.facebook.ads.internal.view.m.<init> (Unknown Source)
at com.facebook.ads.internal.adapters.l$4.c (Unknown Source)
at com.facebook.ads.internal.adapters.l$4.b (Unknown Source)
at com.facebook.ads.internal.c.b$1$1.run (Unknown Source)
This is the Proguard mapping of the corresponding class:
com.facebook.ads.internal.view.b.d -> com.facebook.ads.internal.view.b.d:
com.facebook.ads.internal.view.b.e a -> a
android.widget.TextView b -> b
android.widget.TextView c -> c
void <init>(android.content.Context) -> <init>
void a(android.content.Context) -> a
void a(java.lang.String,java.lang.String) -> a
void a(int,int) -> a
When I remove all dontwarn directives in proguard.txt, the above NoClassDefFoundError is not shown, so the crash probably has nothing to do with missing libraries.
Any ideas how to solve that?

It's likely because you didn't include Android Support Library v4 or v7.
I also highly suggest updating to latest 5.1.0 version.

Related

Getting error in jenkins build

Getting error in Jenkins, while building the project.These are following error "The process cannot access the file because it is being used by another process."
Building on master in workspace D:\Jenkins\jobs\App\workspace
Cleaning local Directory.
java.nio.file.FileSystemException:
D:\Jenkins\jobs\App\workspace\.\app\app.properties: The process cannot access the file because it is being used by another process.
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
at sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source)
at java.nio.file.Files.delete(Unknown Source)
at sun.reflect.GeneratedMethodAccessor2180.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at hudson.Util.deleteFile(Util.java:255)
at hudson.Util.deleteRecursive(Util.java:318)
at hudson.Util.deleteContentsRecursive(Util.java:220)
at hudson.Util.deleteRecursive(Util.java:309)
at hudson.Util.deleteContentsRecursive(Util.java:220)
at hudson.scm.subversion.CheckoutUpdater$1.perform(CheckoutUpdater.java:81)
at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:162)
at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:988)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:969)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:945)
at hudson.FilePath.act(FilePath.java:990)
at hudson.FilePath.act(FilePath.java:968)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:894)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:830)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Archiving artifacts
Finished: FAILURE
What does this mean, and what can I do about it?
in job configuration page delete workspace option is there. click that option before running the job. Or else if master-slave then check the same file has been used by differ

App crashing using Cloudrail 2.7.0 with portal statistics

After appearing to work for a while, cloudrail 2.7.0 is now repeatedly crashing with the following:
Fatal Exception: java.lang.RuntimeException: ServiceCode Error in function selfTest at 26
at com.cloudrail.si.servicecode.Interpreter.run(Unknown Source)
at com.cloudrail.si.servicecode.Interpreter.callFunction(Unknown Source)
at com.cloudrail.si.servicecode.InitSelfTest.execute(Unknown Source)
at com.cloudrail.si.servicecode.InitSelfTest.initTest(Unknown Source)
at com.cloudrail.si.statistics.InitSelfTestTask.run(Unknown Source)
Caused by java.lang.NullPointerException
at com.cloudrail.si.servicecode.commands.http.RequestCall.execute(Unknown Source)
at com.cloudrail.si.servicecode.Interpreter.run(Unknown Source)
at com.cloudrail.si.servicecode.Interpreter.callFunction(Unknown Source)
at com.cloudrail.si.servicecode.InitSelfTest.execute(Unknown Source)
at com.cloudrail.si.servicecode.InitSelfTest.initTest(Unknown Source)
at com.cloudrail.si.statistics.InitSelfTestTask.run(Unknown Source)
I have tried stepping through the code but cannot see the cause. What I can see is that, in InitSelfTest, the following line is not wrapped in at try/catch block and may therefore assume that appContext.getPackageName() is non null?
ip.callFunction("selfTest", new Object[]{interpreterStorage, appContext.getPackageName(), appInfo1.className, appVersionName, appVersionCode});
This issue is solved in version 2.7.1. It was reported through github as well: https://github.com/CloudRail/cloudrail-si-android-sdk/issues/38.

Can I work on Selenium and Android in same workspace?

For a project I am writing Selenium test cases for automation. On the other hand for other project I am designing a page in Android.
I have created some part of page in Android and now need to finish Selenium test cases. But as soon as I run one big error came. Then I thought that I have to change my workspace and kept Selenium test cases in another work space even then error is coming (different error).
Below is the error after changing workspace:
org.testng.TestNGException: Cannot find class in classpath: inventory
at org.testng.xml.XmlClass.loadClass(XmlClass.java:81) at
org.testng.xml.XmlClass.init(XmlClass.java:73) at
org.testng.xml.XmlClass.<init>(XmlClass.java:59) at
org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:543)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
Source) at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source) at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(Unknown
Source) at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source) at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown
Source) at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
Source) at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source) at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source) at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source) at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source) at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
Source) at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source) at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown
Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at
org.testng.xml.XMLParser.parse(XMLParser.java:39) at
org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:17) at
org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:10) at
org.testng.xml.Parser.parse(Parser.java:168) at
org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:311) at
org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:88) at
org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204) at
org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Yes. You can create both projects in same work space.

Android - Proguard error with static String

I'm running ProGuard for my release build and trying to optimize it as much as possible. The only custom rules I've added so far are Serialization and Facebook ones. I'm running my release build now and I'm getting a stack trace and what it maps back to is really throwing me off. Here's my stack trace:
java.lang.NullPointerException
E/AndroidRuntime(10842): at com.myapp.android.myapp.dh.a(Unknown Source)
E/AndroidRuntime(10842): at android.support.v4.app.Fragment.b(Unknown Source)
E/AndroidRuntime(10842): at android.support.v4.app.w.a(Unknown Source)
E/AndroidRuntime(10842): at android.support.v4.app.p.onCreatePanelMenu(Unknown Source)
E/AndroidRuntime(10842): at android.support.v7.a.g.a(Unknown Source)
E/AndroidRuntime(10842): at android.support.v7.a.m.a(Unknown Source)
E/AndroidRuntime(10842): at android.support.v7.a.g.onCreatePanelMenu(Unknown Source)
In mapping, com.myapp.android.myapp.dh.a is:
com.myapp.android.myapp.LocalFragment -> com.myapp.android.myapp.dh:
java.lang.String USER_ACCOUNT -> a
In my actual code it's this:
public static String USER_ACCOUNT = "com.myapp.android.myapp.LocalFragment.user_account";
Now this constant is used in multiple places throughout this Fragment, but it should never be null. Anyone seen a problem like this before? Does Proguard do weird stuff with statics?
Edit: This error is thrown and the app crashes basically as soon as I take the action that would load this Fragment.
EDIT AGAIN
After a bit more investigation, I was wrong about what a was. a was that Static member, but a is also a method. It's the onCreate method. I'm also seeing this error in logcat before the NPE is thrown in onCreate:
W/SupportMenuInflater(10842): Cannot instantiate class: android.support.v7.widget.SearchView
W/SupportMenuInflater(10842): java.lang.NoSuchMethodException: <init> [class android.content.Context]
W/SupportMenuInflater(10842): at java.lang.Class.getConstructorOrMethod(Class.java:472)
W/SupportMenuInflater(10842): at java.lang.Class.getConstructor(Class.java:446)
W/SupportMenuInflater(10842): at android.support.v7.internal.view.e.a(Unknown Source)
W/SupportMenuInflater(10842): at android.support.v7.internal.view.e.a(Unknown Source)
W/SupportMenuInflater(10842): at android.support.v7.internal.view.c.a(Unknown Source)
W/SupportMenuInflater(10842): at android.support.v7.internal.view.c.inflate(Unknown Source)
W/SupportMenuInflater(10842): at com.myapp.android.myapp.dh.a(Unknown Source)
You have a problem with proguard obfuscating the support libraries, or specifically, the SearchView component that you probably try to initiate in your fragment. To avoid this, you need to add few exclusions to proguard configuration file (proguard.cfg).
-keep class android.support.v7.widget.** { *; }
-keep interface android.support.v7.widget.** { *; }
This will keep all classes and interfaces inside the widget package of the support library from being obfuscated.

LIBGDX HTML runtime error but works on android and desktop

I'm having an issue where my game compiles to android and desktop but is getting a runtime error saying it can't find any of the files in the package walljumper.tools. It gets all the way to the loading screen, loads and then says this in the browser
GwtApplication: exception: walljumper/tools/Assets
walljumper/tools/Assets
and says this in the console
java.lang.NoClassDefFoundError: walljumper/tools/Assets
at com.me.walljumper.WallJumper.create(WallJumper.java:23)
at com.badlogic.gdx.backends.gwt.GwtApplication.setupLoop(GwtApplication.java:177)
at com.badlogic.gdx.backends.gwt.GwtApplication$1$1.update(GwtApplication.java:138)
at com.badlogic.gdx.backends.gwt.preloader.Preloader$1$1.onSuccess(Preloader.java:184)
at com.badlogic.gdx.backends.gwt.preloader.AssetDownloader$4$1.onEvent(AssetDownloader.java:171)
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: walljumper.tools.Assets
at com.google.gwt.dev.shell.CompilingClassLoader.findClass(CompilingClassLoader.java:1090)
at com.google.gwt.dev.shell.CompilingClassLoader.loadClass(CompilingClassLoader.java:1196)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 15 more
Thanks in advance
In your Something.gwt.xml in your shared project do you correctly list the translatable source packages?
<module>
<source path="walljumper/" />
</module>

Categories

Resources