2016-01-23 53 views
0

我正在嘗試將Houndify API合併到我的項目中。但是我的gradle文件不會生成。無法解析配置':app:_debugCompile'的所有依賴項Houndify

我從他們的網站下載了一個示例項目,它工作正常。我正在將該項目gradle文件的代碼遷移到我的項目中。

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 22 
    buildToolsVersion "23.0.0" 

    defaultConfig { 
     applicationId "edu.drexel.cs.ptn32.pennapps" 
     minSdkVersion 14 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 
    } 

    compileOptions { 
     sourceCompatibility JavaVersion.VERSION_1_7 
     targetCompatibility JavaVersion.VERSION_1_7 
    } 

    signingConfigs { 
     debug { 
      storeFile file("debug.keystore") 
     } 
    } 

    buildTypes { 
     debug { 
      signingConfig signingConfigs.debug 
     } 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES.txt' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/notice.txt' 
     exclude 'META-INF/license.txt' 
     exclude 'META-INF/dependencies.txt' 
     exclude 'META-INF/LGPL2.1' 
    } 
} 

repositories { 
    maven { 
     // The username and password for this repo is set below 
     url 'https://houndify.com/maven/' 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:22.2.1' 
    compile 'com.android.support:design:22.2.1' 
    compile ('hound.android:hound-sdk:[email protected]'){ 
     transitive=true 
    } 

    compile ('hound.android:phrasespotter:1.4.0'){ 
     transitive=true 
    } 

} 

setHoundifyMavenCredentials("user", "pw") 

def setHoundifyMavenCredentials(username, password) { 
    for (repo in repositories) { 
     if (repo.properties.url.toString().equals("https://houndify.com/maven/")) { 
      repo.properties.credentials.username = username 
      repo.properties.credentials.password = password 
     } 
    } 
} 

回答

1

很抱歉,您在將Houndify SDK遷移到您的應用時遇到問題。爲了簡化操作,我們剛剛刪除了https://houndify.com/maven/網站上的密碼限制。這意味着您可以從build.gradle文件中刪除setHoundifyMavenCredentials()部分。我建議拉取最新版本的Houndify示例應用程序houndify-sdk-sample-0.2.17.zip並確保它在您的系統上生成OK,然後您需要做的就是將這些行添加到您的build.gradle它應該拉入Houndify庫。

repositories { 
    maven { 
     url 'https://houndify.com/maven/' 
    } 
} 

dependencies { 
    compile ('hound.android:hound-sdk:[email protected]'){ 
     transitive=true 
    } 

    compile ('hound.android:phrasespotter:1.4.0'){ 
     transitive=true 
    } 
} 

最後確保您的Android構建系統是最新的。 如果您仍然遇到問題,請告訴我們,並感謝您的反饋。 http://www.soundhound.com/contact

相關問題