Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
170 views
in Technique[技术] by (71.8m points)

java - App for Sony SmartWatch

sorry for my english :(

I get this error when i build my project

01-21 00:27:27.305  20626-20626/ruben.wol.wareable E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: ruben.wol.wareable, PID: 20626
    java.lang.NoSuchMethodError: android.support.wearable.view.WatchViewStub.requestApplyInsets
            at android.support.wearable.view.WatchViewStub.onAttachedToWindow(WatchViewStub.java:119)
            at android.view.View.dispatchAttachedToWindow(View.java:12752)
            at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2577)
            at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2584)
            at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2584)
            at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2584)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1426)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1191)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6233)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:788)
            at android.view.Choreographer.doCallbacks(Choreographer.java:591)
            at android.view.Choreographer.doFrame(Choreographer.java:560)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:774)
            at android.os.Handler.handleCallback(Handler.java:808)
            at android.os.Handler.dispatchMessage(Handler.java:103)
            at android.os.Looper.loop(Looper.java:193)
            at android.app.ActivityThread.main(ActivityThread.java:5296)
            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:824)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
            at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
            at dalvik.system.NativeStart.main(Native Method)

some people asks me for this file build.grandle :

apply plugin: 'com.android.application'


android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "ruben.wol.wareable"
        minSdkVersion 19
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.support:wearable:1.1.0'
    compile 'com.google.android.gms:play-services-wearable:6.5.87'
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

See the exception:

java.lang.NoSuchMethodError: android.support.wearable.view.WatchViewStub.requestApplyInsets

I think the version of the library containing android.support.wearable.view.WatchViewStub, does not have the method requestApplyInsets. Be sure you are using the correct version.

Example:

compile 'com.google.android.support:wearable:1.1.0'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...