frogermcs / AndroidDevMetrics

Performance metrics library for Android development (includes dagger2metrics)
1.54k stars 118 forks source link

Library crashed app, Theme.AppCompat. #14

Open jmodrako opened 8 years ago

jmodrako commented 8 years ago

Hi! I want to let you know that library crashed my app with following stack-trace:

Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
       at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:340)
       at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:309)
       at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:273)
       at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
       at pl.polskikraft.android.android.activity.HomeActivity_.setContentView(HomeActivity_.java:102)
       at pl.polskikraft.android.android.activity.HomeActivity_.onCreate_aroundBody0(HomeActivity_.java:78)
       at pl.polskikraft.android.android.activity.HomeActivity_$AjcClosure1.run(HomeActivity_.java:1)
       at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
       at com.frogermcs.androiddevmetrics.aspect.ActivityLifecycleAnalyzer.logAndExecute(ActivityLifecycleAnalyzer.java:62)
       at pl.polskikraft.android.android.activity.HomeActivity_.onCreate(HomeActivity_.java:74)
frogermcs commented 8 years ago

Hey,

Are you sure that it's not your code? In stacktrace it seems that you use wrong Theme in your HomeActivity class.

jmodrako commented 8 years ago

I have following theme: Theme.AppCompat.Light.NoActionBar. I just forked your repo and update SupportLibrary, and also change the android:Theme.Light to AppCompact one, but I noticed that when I click on the notification, MetricsActivity do not open itself.

UPDATE: When I've moved MetricsActivity declaration to my manifest the following error occured:

Caused by: java.lang.ClassNotFoundException: Didn't find class "org.aspectj.runtime.reflect.Factory" on path: 
DexPathList[[zip file "/data/app/pl.polskikraft.android.productiondbglg-1/base.apk"],
nativeLibraryDirectories=[/data/app/pl.polskikraft.android.productiondbglg-1/lib/arm, 
/data/app/pl.polskikraft.android.productiondbglg-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]

I must to give up with this library...

williamwebb commented 8 years ago

@jmodrako you do not have to add the activity to your manifest. & can you provide an example to reproduce? Likely there is a conflict in the version of support library your app is using with the one this library brings in. Also a ./gradlew app:dependencies output would be helpful.