Sony Smartwatch 2开发受阻:示例项目无法编译及SDK获取难题
Hey there! Let's work through this frustrating problem you're having with getting your Sony Smartwatch 2 (SW2) development set up. Dealing with outdated, removed SDKs is always a headache, so let's break down the fixes step by step:
First, Verify Your SDK Directory Structure
Sony's Add-on SDK needs to be in the exact right folder structure for Eclipse to recognize it. Double-check:
- You should have your SDK extracted directly into
/[SDK]/add-ons/sony_add-on_sdk_2_0—make sure there isn't an extra nested folder (like/sony_add-on_sdk_2_0/sony_add-on_sdk_2_0) inside. If there is, move the inner folder's contents up one level. - Confirm the folder contains key files like
manifest.ini,sources/, andlibs/—these are required for Eclipse to detect the add-on as a valid Android platform extension.
Fix Eclipse's Add-on Recognition
Even if you placed the SDK in the right spot, Eclipse might not pick it up automatically:
- Open Eclipse, go to
Window > Preferences > Android > Add-ons Sites - Click
Add, then navigate to your/[SDK]/add-ons/sony_add-on_sdk_2_0folder and select it - Hit
ApplyandOK, then restart Eclipse - Go to your project's properties (
Right-click project > Properties > Android) and make sure you've selected the Sony Smartwatch 2 build target (not a regular Android API 17 target)
Resolve Compilation Errors
If the SDK is recognized but you still can't compile, try these fixes:
- Check API Version Compatibility: SW2 runs on Android 4.2 (API 17). Make sure your project's
AndroidManifest.xmlhasandroid:minSdkVersion="17"andandroid:targetSdkVersion="17"(match the SDK's supported version). - Manually Add Sony Libraries: Sometimes Eclipse fails to auto-include SW2's required libraries (like
SmartExtensionUtils.jar). Go toProject > Properties > Java Build Path > Libraries, clickAdd JARs, and select the JAR files from/[SDK]/add-ons/sony_add-on_sdk_2_0/libs/. - Clean & Rebuild: Eclipse can cache old build artifacts. Go to
Project > Clean, select your SW2 project, and let Eclipse rebuild it from scratch.
Address Eclipse Version Compatibility
Eclipse 4.6.3 (Neon) is relatively new, and Sony's SDK 2.0 is quite old—they might not play nicely together. Try:
- Downgrading to an older Eclipse version like Luna (4.4) or Mars (4.5), which had better support for legacy Android SDK tools.
- Matching your Android SDK Tools version to something older (e.g., 25.2.5 or earlier)—newer SDK tools often drop support for outdated add-on formats.
Alternative: Try Android Studio
If Eclipse continues to give you grief, consider importing the project into Android Studio:
- Open Android Studio, select
Import Projectand choose your Eclipse SW2 project folder. - Follow the import wizard, making sure to point it to your SDK directory with the Sony add-on.
- Adjust the project's
build.gradlefile to setcompileSdkVersion 17and add any missing dependencies manually.
Hopefully one of these steps gets your SW2 sample project compiling smoothly!
内容的提问来源于stack exchange,提问作者Fera

