Open rajdeepv opened 6 years ago
So the app gets obfuscated but espresso-server
doesn't, and that still happens?
Yes, App under test is obfuscated but Espresso server is not. If I build unobfuscated app, I do not get above error.
I'm going to look at this.... @mykola-mokhnach do you have any ideas, off the top of your head, why this would be happening?
@dpgraham I have found a way to avoid this. In the application code, we need to make sure that we don't obfuscate com.google.gson
Thanks!
Okay good to know @rajdeepv! We'll still keep it open though. For other users who have this same problem we'll need to either come up with a solution or list it as a "Known Issue" and provide a recommended workaround.
Maybe, this is also a similar issue. I would leave the log here.
05-08 10:01:18.336 E/AndroidRuntime(24598): java.lang.NoSuchMethodError: No direct method <init>(Lkotlin/reflect/d;Ljava/lang/String;Ljava/lang/String;)V in class Lkotlin/jvm/internal/PropertyReference1Impl; or its super classes (declaration of 'kotlin.jvm.internal.PropertyReference1Impl' appears in /data/app/io.appium.espressoserver.test-JDAO30jOyu-UyGfxC1cicw==/base.apk)
05-08 10:01:18.336 E/AndroidRuntime(24598): at com.aspiro.wamp.debugoptions.a.<clinit>(Unknown Source:15)
05-08 10:01:18.336 E/AndroidRuntime(24598): at com.aspiro.wamp.eventtracking.a.b.a(EventsNetworkModule_ProvideHttpLoggingInterceptorFactory.java:1047)
05-08 10:01:18.336 E/AndroidRuntime(24598): at dagger.internal.b.a(DoubleCheck.java:47)
05-08 10:01:18.336 E/AndroidRuntime(24598): at com.aspiro.wamp.eventtracking.a.d.a(EventsNetworkModule_ProvideOkHttpClientFactory.java:1056)
05-08 10:01:18.336 E/AndroidRuntime(24598): at dagger.internal.b.a(DoubleCheck.java:47)
05-08 10:01:18.336 E/AndroidRuntime(24598): at com.aspiro.wamp.eventtracking.a.h.a(EventsTrackingModule_ProvidesEventsFactory.java:1029)
05-08 10:01:18.336 E/AndroidRuntime(24598): at dagger.internal.b.a(DoubleCheck.java:47)
05-08 10:01:18.336 E/AndroidRuntime(24598): at com.aspiro.wamp.eventtracking.a.g.a(EventsTrackingModule_ProvideEventServiceFactory.java:1024)
05-08 10:01:18.336 E/AndroidRuntime(24598): at dagger.internal.b.a(DoubleCheck.java:47)
05-08 10:01:18.336 E/AndroidRuntime(24598): at com.aspiro.wamp.h.g$c.a(DaggerApplicationComponent.java:1155)
05-08 10:01:18.336 E/AndroidRuntime(24598): at com.aspiro.wamp.App.f(App.java:181)
05-08 10:01:18.336 E/AndroidRuntime(24598): at com.aspiro.wamp.App.c(App.java:165)
05-08 10:01:18.336 E/AndroidRuntime(24598): at com.aspiro.wamp.App.onCreate(App.java:7161)
05-08 10:01:18.336 E/AndroidRuntime(24598): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
05-08 10:01:18.336 E/AndroidRuntime(24598): at androidx.test.runner.MonitoringInstrumentation.callApplicationOnCreate(MonitoringInstrumentation.java:413)
05-08 10:01:18.336 E/AndroidRuntime(24598): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5822)
05-08 10:01:18.336 E/AndroidRuntime(24598): at android.app.ActivityThread.-wrap1(Unknown Source:0)
05-08 10:01:18.336 E/AndroidRuntime(24598): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666)
05-08 10:01:18.336 E/AndroidRuntime(24598): at android.os.Handler.dispatchMessage(Handler.java:105)
05-08 10:01:18.336 E/AndroidRuntime(24598): at android.os.Looper.loop(Looper.java:251)
05-08 10:01:18.336 E/AndroidRuntime(24598): at android.app.ActivityThread.main(ActivityThread.java:6572)
05-08 10:01:18.336 E/AndroidRuntime(24598): at java.lang.reflect.Method.invoke(Native Method)
05-08 10:01:18.336 E/AndroidRuntime(24598): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
05-08 10:01:18.336 E/AndroidRuntime(24598): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Details Espresso server has gson as dependancy. In many cases gson is a dependancy of the app under test as well. When the app is obfuscated, Its complains NoSuchMethodError for obfuscated methods as below: