问题
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