Prototik / HoloEverywhere

NO LONGER MAINTAINED. DEVELOP FOR 4.X+ DUDE.
MIT License
2.18k stars 608 forks source link

java.lang.NoClassDefFoundError: android.support.v4.app._HoloFragmentInflater$1 #842

Closed william-ferguson-au closed 10 years ago

william-ferguson-au commented 10 years ago

It appears that is looking for android/support/v4/app/NoSaveStateFrameLayout$NoSaveStateFrameLayoutCreator which doesn't exist anywhere in the android support libraries shipped with the Android SDK.

Full log is:

07-22 23:19:05.505  10010-10010/? I/dalvikvm﹕ Failed resolving Landroid/support/v4/app/_HoloFragmentInflater$1; interface 350 'Landroid/support/v4/app/NoSaveStateFrameLayout$NoSaveStateFrameLayoutCreator;'
07-22 23:19:05.505  10010-10010/? W/dalvikvm﹕ Link of class 'Landroid/support/v4/app/_HoloFragmentInflater$1;' failed
07-22 23:19:05.505  10010-10010/? E/dalvikvm﹕ Could not find class 'android.support.v4.app._HoloFragmentInflater$1', referenced from method android.support.v4.app._HoloFragmentInflater.<clinit>
07-22 23:19:05.505  10010-10010/? W/dalvikvm﹕ VFY: unable to resolve new-instance 396 (Landroid/support/v4/app/_HoloFragmentInflater$1;) in Landroid/support/v4/app/_HoloFragmentInflater;
07-22 23:19:05.505  10010-10010/? D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0000
07-22 23:19:05.505  10010-10010/? W/dalvikvm﹕ method Lorg/holoeverywhere/LayoutInflater;.createViewFromTag incorrectly overrides package-private method with same name in Landroid/view/LayoutInflater;
07-22 23:19:05.505  10010-10010/? W/dalvikvm﹕ method Lorg/holoeverywhere/LayoutInflater;.rInflate incorrectly overrides package-private method with same name in Landroid/view/LayoutInflater;
07-22 23:19:05.505  10010-10010/? I/dalvikvm﹕ Failed resolving Landroid/support/v4/app/_HoloFragmentInflater$1; interface 350 'Landroid/support/v4/app/NoSaveStateFrameLayout$NoSaveStateFrameLayoutCreator;'
07-22 23:19:05.505  10010-10010/? W/dalvikvm﹕ Link of class 'Landroid/support/v4/app/_HoloFragmentInflater$1;' failed
07-22 23:19:05.505  10010-10010/? D/dalvikvm﹕ DexOpt: unable to opt direct call 0x09a9 at 0x02 in Landroid/support/v4/app/_HoloFragmentInflater;.<clinit>
07-22 23:19:05.515  10010-10010/? D/dalvikvm﹕ DexOpt: couldn't find static field Landroid/support/v4/app/NoSaveStateFrameLayout;.sNoSaveStateFrameLayoutCreator
07-22 23:19:05.515  10010-10010/? I/dalvikvm﹕ DexOpt: unable to optimize static field ref 0x01dd at 0x05 in Landroid/support/v4/app/_HoloFragmentInflater;.<clinit>
07-22 23:19:05.515  10010-10010/? W/dalvikvm﹕ Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Landroid/support/v4/app/_HoloFragmentInflater;
07-22 23:19:05.515  10010-10010/? W/dalvikvm﹕ Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lorg/holoeverywhere/app/Application;
07-22 23:19:05.515  10010-10010/? W/dalvikvm﹕ Class init failed in newInstance call (Lau/com/xandar/jumblee/JumbleeApplication;)
07-22 23:19:05.515  10010-10010/? D/AndroidRuntime﹕ Shutting down VM
07-22 23:19:05.515  10010-10010/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x415a8ba8)
07-22 23:19:05.515  10010-10010/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: au.com.xandar.jumblee, PID: 10010
    java.lang.NoClassDefFoundError: android.support.v4.app._HoloFragmentInflater$1
            at android.support.v4.app._HoloFragmentInflater.<clinit>(_HoloFragmentInflater.java:18)
            at org.holoeverywhere.app.Application.<clinit>(Application.java:34)
            at java.lang.Class.newInstanceImpl(Native Method)
            at java.lang.Class.newInstance(Class.java:1208)
            at android.app.Instrumentation.newApplication(Instrumentation.java:990)
            at android.app.Instrumentation.newApplication(Instrumentation.java:975)
            at android.app.LoadedApk.makeApplication(LoadedApk.java:502)
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4301)
            at android.app.ActivityThread.access$1500(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5001)
            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:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)

Dependencies are:

        <dependency>
            <groupId>org.holoeverywhere</groupId>
            <artifactId>library</artifactId>
            <version>2.1.0</version>
            <type>aar</type>
        </dependency>

        <dependency>
            <groupId>org.holoeverywhere</groupId>
            <artifactId>addon-preferences</artifactId>
            <version>2.1.0</version>
            <type>aar</type>
        </dependency>

        <dependency>
            <groupId>com.android.support</groupId>
            <artifactId>support-v4</artifactId>
            <version>19.1.0</version>
        </dependency>
william-ferguson-au commented 10 years ago

So I found a version of com.android.support:supoprt-v4:19.1.0 that contains NoSaveStateFrameLayout$NoSaveStateFrameLayoutCreator in the HoloEverywhere repo.

But that begs a couple of questions:

Prototik commented 10 years ago

@william-ferguson-au

william-ferguson-au commented 10 years ago

But that means I can have a build with this as a dependency:

<dependency>
            <groupId>com.android.support</groupId>
            <artifactId>support-v4</artifactId>
            <version>19.1.0</version>
</dependency>

and it will use 2 totally different artifacts depending on whose machine it is built on.

HE has no right to be publishing artifacts in the com.android.support group. That is the prerogative of the owner of the android project.

It would be like me publishing org.holoeverywhere:library:2.1.0 with my own versions of the HE classes.

william-ferguson-au commented 10 years ago

If you really feel like you need to publish your own versions of the support libraries publish them as org.holoeverywhere.android.support or similar.

Prototik commented 10 years ago

@william-ferguson-au And has conflicts with all other libraries which uses support-library after it. You could build anything with any other patches from any version of code and push it to your own repository or even local repo. I will not publish any other versions of any components into HE's repo.

Btw you could specify version as 19.+ and has always fresh version of library.

william-ferguson-au commented 10 years ago

Sorry Sergey, I didn't follow any of that.

krschultz commented 10 years ago

@Prototik this seems like a huge mistake. If HoloEverywhere is using a modified version of the support library, then publish it under a different name. If HoloEverywhere is using a non-modified but renamed version of the support library to reduce downstream conflicts, that is unnecessary and creating more problems than it solves. Anyone down stream that wants to use a newer version of the support library can exclude that artifact. It is standard practice in the community, these are just two examples plucked out of my build.gradle file.

    compile('de.keyboardsurfer.android.widget:crouton:1.8.5') {
        exclude group: 'com.google.android', module: 'support-v4'
    }

or

    androidTestCompile('com.jakewharton.espresso:espresso:1.1-r3') {
        exclude group: 'com.google.guava'
        exclude group: 'com.google.code.findbugs'
    }
Prototik commented 10 years ago

@rkistner No many releases of HoloEverywhere ever. You could be your own version with any dependencies - license allow it ;)