Search code examples
android-studiowear-osandroid-studio-giraffe

Android Studio Giraffe - WEAR OS - Only compose?


I got the Android Studio Giraffe installed on a new computer... While trying to create a new project it doesnt show me the options for creating a view project like the previous version (or choose the language), only "compose for wear os"...

enter image description here

enter image description here

What am I missing?? For other kinds of devices it shows...

Thanks!


Solution

  • If you want to create a new project with wear os then select No activity and after that create an Empty Views Activity enter image description here with the image and add the below code to the manifest file.

    <uses-feature android:name="android.hardware.type.watch" />
    
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/Theme.Nav" >
        <activity
            android:name="com.wear.mobileapp.NewActivity"
            android:exported="true" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    
        <uses-library
            android:name="com.google.android.wearable"
            android:required="true" />
    
        <meta-data
            android:name="com.google.android.wearable.standalone"
            android:value="true" />
    </application>