Skip to content

Commit fa61a0f

Browse files
committed
copy wear jar irrespective of component
1 parent 6ce2ba4 commit fa61a0f

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/processing/mode/android/AndroidBuild.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,20 +238,22 @@ public File createProject(boolean wear) throws IOException, SketchException {
238238
// Copy the compatibility package, needed for the permission handling
239239
File compatJarFile = mode.getContentFile("mode/android-support-v4.jar");
240240
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+
// }
241252

242253
// Copy any imported libraries (their libs and assets),
243254
// and anything in the code folder contents to the project.
244255
copyLibraries(libsFolder, assetsFolder);
245256
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-
}
255257

256258
if (getAppComponent() == CARDBOARD) {
257259
// TODO: temporary hack until I find a better way to include the cardboard aar

0 commit comments

Comments
 (0)