0
votes

I know it's been awhile for glass development, but I'm hoping someone out there has solved this problem recently because I'm at a lost. I'm trying to get a clean, base immersion activity to compile and run on Google Glass using Android Studio and gdk. But, I'm getting an error when trying to run the Hello World immersion activity with Android Studio.

Error:Module 'app': platform 'Google Inc.:Glass Development Kit Preview:19' not found.

This is with no changes to base code, just a clean creation of a module following the quickstart guide. I have the gdk from 19 installed from sdk 19, and am using build tools version 26. I've tried installing and reinstalling pretty much everything. I know that the glass develop kit (gdk) is installed:

$ ls ~/Library/Android/sdk/add-ons/addon-google_gdk-google-19/libs/
gdk.jar

Here is what sdkmanager says about what else is installed (Android studio shows the same tools in it's interface):

$ ./sdkmanager --list
Warning: File /Users/aviv/.android/repositories.cfg could not be loaded.
Installed packages:
  Path                              | Version | Description                       | Location                         
  -------                           | ------- | -------                           | -------                          
  add-ons;addon-g...e_gdk-google-19 | 11      | Glass Development Kit Preview     | add-ons/addon-g..._gdk-google-19/
  build-tools;19.1.0                | 19.1.0  | Android SDK Build-Tools 19.1      | build-tools/19.1.0/              
  build-tools;25.0.0                | 25.0.0  | Android SDK Build-Tools 25        | build-tools/25.0.0/              
  build-tools;26.0.0                | 26.0.0  | Android SDK Build-Tools 26        | build-tools/26.0.0/              
  emulator                          | 26.1.2  | Android Emulator                  | emulator/                        
  extras;android;m2repository       | 47.0.0  | Android Support Repository        | extras/android/m2repository/     
  extras;google;m2repository        | 55      | Google Repository                 | extras/google/m2repository/      
  extras;intel;Ha...ecution_Manager | 6.1.1   | Intel x86 Emulator Accelerator... | extras/intel/Ha...cution_Manager/
  extras;m2reposi...ut-solver;1.0.2 | 1       | Solver for ConstraintLayout 1.0.2 | extras/m2reposi...t-solver/1.0.2/
  extras;m2reposi...nt-layout;1.0.2 | 1       | ConstraintLayout for Android 1... | extras/m2reposi...t-layout/1.0.2/
  patcher;v4                        | 1       | SDK Patch Applier v4              | patcher/v4/                      
  platform-tools                    | 26.0.0  | Android SDK Platform-Tools        | platform-tools/                  
  platforms;android-19              | 4       | Android SDK Platform 19           | platforms/android-19/            
  platforms;android-26              | 1       | Android SDK Platform 26           | platforms/android-26/            
  sources;android-19                | 2       | Sources for Android 19            | sources/android-19/              
  tools                             | 26.0.2  | Android SDK Tools                 | tools/                     

This is the relevant part of my build.grandle file

android {
    compileSdkVersion "Google Inc.:Glass Development Kit Preview:19"
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "com.example.xxx.glasstest"
        minSdkVersion 19
        targetSdkVersion 26
        //...

}

I've also tried setting the sdk version all to 19 and 19.1.0 as in other posts, but nothing seems to work.

And, I'm running this on Mac OSX Sierra and Android studio version 2.3.3

2
I think this question is related but I did try that answer already (which was down voted, not by me ...)Adam A.

2 Answers

1
votes

Turns out the latest version of gradle is not compatable with building using the Glass Development Kit (gdk). To get it comepile, open the top level build.gradle, and change

dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'

    }

to (note the 3 turned into a 2 --- easy to miss!)

dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
    }

Then in your application build script, you can use the latest build version and target SDK 19.

android {
    compileSdkVersion 'Google Inc.:Glass Development Kit Preview:19'
    buildToolsVersion '26.0.0'
    defaultConfig {
        applicationId "com.example.xxx.glasstest3"
        minSdkVersion 19
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

Now, my glass device is so old, I need to get that fancy new upgrade before I can still run the app.

0
votes

I faced similar kind of problem earlier. I am not sure you are facing the same problem or not but seems similar and I guess its android studio related problem.

You can do following steps and check either its really fix your problem or not.

  1. Change android SDK path to some other directory where its not exist. Build now.
  2. Android studio will show the errors of SDK path related
  3. Then change the path again with correct one and now build/clean build again.

Check the issue resolved or not.