0

I got the following error, can you all look at my code, how can I solve it?

I already download the file and restart a few times....

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.orbotix.ovalfreefall"
        minSdkVersion 18
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

my other gradle file

I dk is it this the file or not, I am really confused apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.orbotix.orbbasicloader"
        minSdkVersion 18
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    //compile fileTree(dir: 'libs', include: ['*.jar'])

    releaseCompile project(path: ':RobotCommonLibrary', configuration: 'release')
    releaseCompile project(path: ':RobotLeConnectorLibrary', configuration: 'release')
    releaseCompile project(path: ':RobotLibraryUmbrella', configuration: 'release')

    debugCompile project(path: ':RobotLeConnectorLibrary', configuration: 'debug')
    debugCompile project(path: ':RobotCommonLibrary', configuration: 'debug')
    debugCompile project(path: ':RobotLibraryUmbrella', configuration: 'debug')
}

enter image description here

enter image description here

enter image description here

Ryan
  • 155
  • 1
  • 5
  • 19

1 Answers1

1

enter image description hereenter image description here

Go here & hit download zip, then unzip it, then create a new Android project. In your file explorer, you will go to Sphero-Android-SDK-master/libs/RobotLibrary.jar and you will copy this file to the new projectname/app/libs/ directory of the new android project. Then ensure the build.gradle(module:app) has this at the bottom. Then you can use the SDK.

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
}
Daniel
  • 2,355
  • 9
  • 23
  • 30
  • [![enter image description here][1]][1] [1]: http://i.stack.imgur.com/IjVFG.png – Ryan May 22 '16 at 05:58
  • The extra file you refer to is the old gradle file right? – Ryan May 22 '16 at 06:45
  • I not quite sure which one you refer to, I do not have a app folder http://i.stack.imgur.com/8519T.png, I have change the current gradle file, but still have error – Ryan May 22 '16 at 07:30
  • I am using window, I open my file explorer, there are only 1 gradle file [3]: http://i.stack.imgur.com/LKZJ2.png, simply put, I should move the build.gradle file into my src folder, and create a new build.gradle in the root folder. Right? – Ryan May 22 '16 at 14:47
  • There is no app folder in window – Ryan May 22 '16 at 14:48
  • You can take a look at here, some sample file I can make it work, some I couldn't https://github.com/orbotix/Sphero-Android-SDK – Ryan May 23 '16 at 01:29
  • Guess I have to move on, thanks for ur help – Ryan May 23 '16 at 01:29
  • Just to test this SDK out – Ryan May 23 '16 at 01:53
  • Nope just follow the exact instructions. – Daniel May 23 '16 at 14:21
  • I don't get it, if I create a new project, how am I going to run the old SDK? – Ryan May 24 '16 at 01:29
  • @Ryan, their SDK is nothing more than a Java library, as long as you have that library in your project, you'll be able to use it. – Daniel May 24 '16 at 01:32
  • What i did now is import the project from the Sphero-Android-SDK-master project folder, they prompt me to do use don't know what gradle wrapper, I just click Okay, and I ghet the gradle-wrapper.properties....I not sure what that mean. right now I only have one build.gradle (Project: OrbBasicLoader)...fine I will upload the github file you later, what I get is just error after error – Ryan May 24 '16 at 01:33
  • @Ryan, okay do you want to use their project samples or do you want to do a project from scratch? – Daniel May 24 '16 at 01:36
  • I want to get the app working from the existing code https://github.com/zero88/stackfolder, just try and compile this folder, I alrdy add dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.4.0' } This line to the gradle, it is not working....the lib is there, I don't know what is happening, just do whatever you want – Ryan May 24 '16 at 01:45
  • @Ryan, I got it to work. [Here](https://www.dropbox.com/s/2hprigilsx4uixn/TestRobotApp.zip?dl=0) is the project zipped. Just open it from AndroidStudio & deploy. Let me know when you download it so I can delete it. – Daniel May 24 '16 at 02:45
  • alright, it work, manage to run without error, you can delete the file. However, whenever I connect to my Sphero via bluetooth, it seem to crash – Ryan May 24 '16 at 03:45
  • did you create a new project? or did you just edit the file from my file? – Ryan May 24 '16 at 03:46
  • @Ryan, I don't have a Sphero to try it with and help, but what you can do is keep this project and swap out the classes and activities from the sample folders. You may have to update the manifest, values or strings sometimes but the Gradle scripts are set. So don't lose this project! – Daniel May 24 '16 at 03:50
  • I had to create a new project and then I imported the necessary classes, activities, values.xml and strings.xml, etc – Daniel May 24 '16 at 03:51
  • Thanks I will work on it – Ryan May 24 '16 at 03:52
  • I try to recreate a new project, but import com.orbotix.ConvenienceRobot;, my orbotix become red in colour, I am not able to import anything related to orbotix, what could be the problem? – Ryan May 24 '16 at 09:20
  • @Ryan, you have to add the RobotLibrary every time you make a new project. I actually had inconsistent results with the process in my answer but more consistent results with another one, so I'll update my answer one more time either today or tomorrow. I'll comment here when I do that. – Daniel May 24 '16 at 21:56
  • I try your method on the buttondrive sample, however, my app seem to crash whenever I connected to the sphero, it work well when I off my bluetooth, it is kinda weird – Ryan May 25 '16 at 01:21