Justl24
Justl24

Reputation: 119

NoSuchMethodError: android.support.v4.view.ViewCompat.isAttachedToWindow

Hello you!

I have a problem with v7.AppCombatActivity. It seems that i am to stupid to find the solution, because there are many other postings in www how to fix this, but i can not get it to work. So i think i have to post my problem here to find the solution for my problem.

Here the Facts:

My App uses a normal fullscreen-Activity as a Splash-Screen in startup-periode, then i start a new Intent with a AppCombatActivity as Login-Screen. On my Nexus5 is works without a Problem (Android 5.1), but on my Galaxy Tab10.1 it crashes (Android 4.2.2).

08-10 11:06:09.530: W/dalvikvm(20561): VFY: unable to resolve static method 5918: Landroid/support/v4/view/ViewCompat;.isAttachedToWindow (Landroid/view/View;)Z
08-10 11:06:09.530: D/dalvikvm(20561): VFY: replacing opcode 0x71 at 0x0025
08-10 11:06:09.553: D/AndroidRuntime(20561): Shutting down VM
08-10 11:06:09.553: W/dalvikvm(20561): threadid=1: thread exiting with uncaught exception (group=0x41874930)
08-10 11:06:09.561: E/AndroidRuntime(20561): FATAL EXCEPTION: main
08-10 11:06:09.561: E/AndroidRuntime(20561): java.lang.NoSuchMethodError: android.support.v4.view.ViewCompat.isAttachedToWindow
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.support.v7.app.AppCompatDelegateImplV7.createView(AppCompatDelegateImplV7.java:796)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(AppCompatDelegateImplV7.java:836)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:44)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:675)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:807)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:736)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:249)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at de.ha.veng.LoginActivity.onCreate(LoginActivity.java:81)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.app.Activity.performCreate(Activity.java:5104)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2262)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.app.ActivityThread.access$600(ActivityThread.java:153)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.os.Handler.dispatchMessage(Handler.java:99)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.os.Looper.loop(Looper.java:137)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at android.app.ActivityThread.main(ActivityThread.java:5227)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at java.lang.reflect.Method.invokeNative(Native Method)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at java.lang.reflect.Method.invoke(Method.java:511)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
08-10 11:06:09.561: E/AndroidRuntime(20561):    at dalvik.system.NativeStart.main(Native Method)

Here is my Constalation: I have copyed android-support-v7-appcombat to my Workspace and marked as "is Library" It contains allready the v4.jar, right ? I added this source to the properties of my project. Also in my Porject there is a v13 and i allways get this Warning:

WARNING: Found both android-support-v4 and android-support-v13 in the dependency list.
Because v13 includes v4, using only v13.

Is it possible that the v4 is excluded by build, so that appCombat cant access the v4.ViewCombat ??

Here some pics:

The Workspace

the Workspace

The V7

v7 Properties

v7 Build Path

v7 Order an Export

The App

App Properties

App Build Path

App Order an Export

Please help me! Thanks a lot!

Torsten

(I am not a native english speaker)

Upvotes: 0

Views: 3868

Answers (2)

Justl24
Justl24

Reputation: 119

Switch to Android Studio cant be the solution at all. I will switch, but not yet, not on the half way of my project. Next Project, OK. I have a deadline and can not hold it if i now start to learn how Android Studio works.

To mark an answer "switch to Android" as "helpfull" i can not understand.

By the way .... I have solved my posted problem.

Upvotes: 2

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75788

You are using ecllipse which has limitations .Just switch to Android Studio.Android Studio has become increasingly popular across Android developers and the open source community — so much, in fact, that many users are even moving away from Eclipse entirely.

Eclipse is dead for Android development

What Should you do

Migrate to Android Studio.For step by step approach you may visit Getting Started with Android Studio And Android Tutorial for Beginners.I hope it helps you a lot

Upvotes: 1

Related Questions