WatchViewStub.requestApplyInsets fails with NoSuchMethodError

非 Y 不嫁゛ 提交于 2020-01-17 03:51:25

问题


I'm trying to run simple Android Wear app on S5 with KitKat. The app is just sample generated by Android Studio. When I run the app it fails with:

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

I've found the class and there's no requestApplyInsets method indeed.

I'm using the latest version of the support library for wearable which is 1.0.0.

dependencies {
    compile 'com.google.android.support:wearable:1.0.0'
    compile 'com.google.android.gms:play-services-wearable:5.0.77'
}

Is it possible to run it on API 19?


回答1:


Ok it's my fault. Looks like if you have wear module in your application it is built and installed by default (instead of app module).

To build and install Android app from terminal now I have to run

gradlew app:iD 

Where app is my plain Android project (named mobile by default). Running it without app: prefix installs wear app.



来源:https://stackoverflow.com/questions/25295800/watchviewstub-requestapplyinsets-fails-with-nosuchmethoderror

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!