@@ -238,20 +238,22 @@ public File createProject(boolean wear) throws IOException, SketchException {
238
238
// Copy the compatibility package, needed for the permission handling
239
239
File compatJarFile = mode .getContentFile ("mode/android-support-v4.jar" );
240
240
Util .copyFile (compatJarFile , new File (libsFolder , "android-support-v4.jar" ));
241
+
242
+ // if (getAppComponent() == WATCHFACE) {
243
+ // The wear jar is needed even when the app is not a watch face, because on
244
+ // devices with android < 5 the dependencies of the PWatchFace* classes
245
+ // cannot be resolved.
246
+ // TODO: temporary hack until I find a better way to include the wearable aar
247
+ // package included in the SDK:
248
+ File wearJarFile = mode .getContentFile ("mode/wearable-1.3.0-classes.jar" );
249
+ System .out .println (wearJarFile .toString ());
250
+ Util .copyFile (wearJarFile , new File (libsFolder , "wearable-1.3.0-classes.jar" ));
251
+ // }
241
252
242
253
// Copy any imported libraries (their libs and assets),
243
254
// and anything in the code folder contents to the project.
244
255
copyLibraries (libsFolder , assetsFolder );
245
256
copyCodeFolder (libsFolder );
246
-
247
- if (getAppComponent () == WATCHFACE ) {
248
- // TODO: temporary hack until I find a better way to include the wearable aar
249
- // package included in the SDK:
250
-
251
- File wearJarFile = mode .getContentFile ("mode/wearable-1.3.0-classes.jar" );
252
- System .out .println (wearJarFile .toString ());
253
- Util .copyFile (wearJarFile , new File (libsFolder , "wearable-1.3.0-classes.jar" ));
254
- }
255
257
256
258
if (getAppComponent () == CARDBOARD ) {
257
259
// TODO: temporary hack until I find a better way to include the cardboard aar
0 commit comments