0

I'm trying to import this custom view: https://github.com/zerokol/JoystickView into Android Studio by following these instructions: Importing a custom view in Android Studio.

So I go File -> New -> Import Module, leave everything as default and import.

I then get this error:

enter image description here

I clicked the link and updated everything to the latest versions but it still doesn't work.

build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "jacobpihl.bluetoothcar"
        minSdkVersion 15
        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'])
    compile 'com.android.support:appcompat-v7:23.1.0'
}
Community
  • 1
  • 1
Lightvvind
  • 155
  • 1
  • 8
  • have a look here at a simmilar issue -- http://stackoverflow.com/questions/32715418/failed-to-find-target-with-hash-string-android-22 – Tasos Nov 11 '15 at 18:22
  • @Tasos I looked at that question and updated everything then restarted, still get the error – Lightvvind Nov 11 '15 at 18:26
  • put the gradle build code in the Q to have a look – Tasos Nov 11 '15 at 18:27
  • @Tasos added build.gradle in the Q – Lightvvind Nov 11 '15 at 18:31
  • if you look here -- https://github.com/zerokol/JoystickView/blob/master/project.properties -- target android version is 7 -- so perhaps changing (minSdkVersion 15) to 7 might do the trick – Tasos Nov 11 '15 at 18:32
  • @Tasos Nope, still getting the same error – Lightvvind Nov 11 '15 at 18:36
  • not sure then, it looks like it wants to build with 7, looking at this screenshot -- https://github.com/zerokol/JoystickView -- after when it says (7º Passo: Click with right button on your project go to PROPERTIES -> ANDROID and the ADD) -- if you dont find a resolution from someone login to github and raise an issue – Tasos Nov 11 '15 at 18:42
  • hi again, go to github and search (joystick view). looks like there's a few so you may find a more updated one -- like this one --- https://github.com/clkasd/JoystickView – Tasos Nov 11 '15 at 18:49

1 Answers1

0

As it doesn't have any resources, you can just copy the class and put where you want in your project.

Rafael Toledo
  • 5,599
  • 6
  • 23
  • 33