-2

I am new to android things. Recently I tried to build an android things app on android studio 2.3.3 with 25 SDK.

But when I include the android things support library into the dependency of app module build.gradle file and sync with latest gradle changes,it gives me the below error :

"Install repository then Sync"

Plz Someone help me.

Koustuv Ganguly
  • 897
  • 7
  • 21
Farooq Ahmad
  • 41
  • 1
  • 9
  • Did u specify the versions for the dependency? you should add latest dependancy. or else this error can happen. – Bivin Sep 14 '17 at 05:46
  • Take a look at this web page. It could help you https://developer.android.com/things/sdk/index.html – Samuel Robert Sep 14 '17 at 05:47
  • you can't install the app without connecting to ADB, but you can build it still. `"Install repository then Sync"` have you tried to do that? usually it is a clickable link – Vladyslav Matviienko Sep 14 '17 at 05:54
  • I am running 4.1 devpreview on my raspberry pi 3 board. therefore, i then add the below provided dependency on app module app.gradle file. { provided 'com.google.android.things:androidthings:0.4.1-devpreview'} – Farooq Ahmad Sep 14 '17 at 05:54
  • I am clicking on it many times, but it didn't give me any response... – Farooq Ahmad Sep 14 '17 at 05:57

1 Answers1

2

You don't need to connect Raspberry Pi to develop a Android Things project. There are three points which you have to keep in mind while developing for Android Things:

  • Update your SDK tools to version 25.0.3 or higher.
  • Update your SDK with Android 8.0 (API 26) or higher.
  • In order to access new APIs for Things, you must create a project or modify an existing project that targets Android 8.0 (API level 26) or higher. Add the library.

In your case, you need to install the latest bulid tools, and repositories to develop an Android Things Project. Your build.gradle should look like this:

apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"

defaultConfig {
    applicationId "com.android.androidthings.id"
    minSdkVersion 21
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}
dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:25.3.1'
        provided 'com.google.android.things:androidthings:0.3-devpreview'
}
Ashish Gupta
  • 737
  • 11
  • 18