Code Monkey home page Code Monkey logo

Comments (14)

AniFichadia avatar AniFichadia commented on July 20, 2024 7

@zuxie Looks like you're also missing some of the other (transitive) dependencies, like the API AI models lib. Check out the readme.md file on this repo:
https://github.com/api-ai/apiai-android-client/blob/master/README.md

You need to also add

compile 'ai.api:libai:1.4.8'
compile 'com.google.code.gson:gson:2.3.1'
compile 'commons-io:commons-io:2.4'

You should be fine with newer versions of gson (eg. gson v 2.7)

Correct me if I'm wrong, but I think when you have an aar dependency, it doesn't include the transitive dependencies. You have to explicitly include them or force the dependency to be transitive (as long as there's a pom file or similar also published).

from dialogflow-android-client.

yyuripp avatar yyuripp commented on July 20, 2024 4

@meetferoz
usa o compile 'ai.api:libai:1.6.12' ao invés do compile 'ai.api:libai-base:1.6.12'.

Pra mim funcionou.

from dialogflow-android-client.

Aashit-Sharma avatar Aashit-Sharma commented on July 20, 2024 1

did you add the dependency : compile 'ai.api:sdk:2.0.4@aar' ?
if not , do so in your app-level build.gradle
that should solve it

from dialogflow-android-client.

zuxie avatar zuxie commented on July 20, 2024 1

@AniFichadia Thank you so much! That fixed the issue. For those who have the same problem, make sure to follow the format shown in the example, make sure to include the packagingOptions { exclude 'META-INF/LICENSE.txt' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' exclude 'META-INF/NOTICE.txt' exclude 'LICENSE.txt' } part.

Now the app crashes when I click on the listen button, displaying java.lang.NoClassDefFoundError. Does anyone have a fix for this issue?
screen shot 2017-06-21 at 11 18 27 pm

from dialogflow-android-client.

meetferoz avatar meetferoz commented on July 20, 2024 1

Hi, i did all the above but i still get Error:(8, 20) error: package ai.api.model does not exist
what could be the issue?

here is my build.gradle (module app)

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.feroz.testapp1"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'LICENSE.txt'
}
}

repositories {
mavenLocal()
mavenCentral()

maven { url "https://oss.sonatype.org/content/repositories/snapshots" }

}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'ai.api:sdk:2.0.7@aar'
compile 'com.google.code.gson:gson:2.8.1'
compile 'commons-io:commons-io:20030203.000550'
compile 'ai.api:libai-base:1.6.12'
}

from dialogflow-android-client.

 avatar commented on July 20, 2024

Same problem here, please help!

from dialogflow-android-client.

AniFichadia avatar AniFichadia commented on July 20, 2024

Try Re-syncing gradle or invalidating your caches and restarting Android Studio. If that doesn't work, please post your build.gradle files (module and project). You may not have the correct repositories setup in your project build.gradle (the API AI libs are published on maven central not jcenter) file or there's some other dependency resolution issue

from dialogflow-android-client.

zuxie avatar zuxie commented on July 20, 2024

can someone give more insights on this issue? I've tried adding 'ai.api:sdk:2.0.4@aar' dependency as well as using maven central. This is my project build.gradle and app build.gradle
screen shot 2017-06-21 at 8 02 33 pm
screen shot 2017-06-21 at 8 02 24 pm

from dialogflow-android-client.

imanpakii avatar imanpakii commented on July 20, 2024

Hello
I'm trying to add dependency of ai.api to https://github.com/Kitt-AI/snowboy project.
when I try to add all dependency I get Failed to resolve :ai.api:libai-base:1.4.8 and other dependency
this is my build.gradle

apply plugin: 'com.android.application'
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0'
    }
}
android {
    signingConfigs {
    }
    compileSdkVersion 25'
    buildToolsVersion '25.0.0'
    compileOptions.encoding = 'ISO-8859-1'
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
    buildTypes {
        release {
        }
    }
    defaultConfig {
    }
    productFlavors {
    }
    externalNativeBuild {
        ndkBuild {
            path '../../../../../../Tools/example-wiringPi/jni/Android.mk'
        }
    }
}

dependencies {
    compile 'ai.api:libai-base:1.4.8'
}

please help
thank you

from dialogflow-android-client.

imanpakii avatar imanpakii commented on July 20, 2024

for somebody who has the same issue I had:
I fix this issue by adding this:

repositories {
    mavenCentral()
}

and later on added this:

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'LICENSE.txt'
    }

for this issue:

Error:Execution failed for task ':transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
  	File1: /Users/imanyazdansepas/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.2/d7ef6ad7ff0711dd12fe409d62d72d6ed14516e0/log4j-api-2.2.jar
  	File2: /Users/imanyazdansepas/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.2/c707664e020218f8529b9a5e55016ee15f0f82ac/log4j-core-2.2.jar

from dialogflow-android-client.

folomeev avatar folomeev commented on July 20, 2024

Please try to use new library version: 2.0.6 instead of 2.0.5

from dialogflow-android-client.

akhilreso avatar akhilreso commented on July 20, 2024

Please tell m how can i add api.ai sdk??tried to import ailib module in my project but gives an error
Error:(5, 0) Could not get unknown property 'ANDROID_BUILD_SDK_VERSION' for project ':ailib' of type org.gradle.api.Project.

from dialogflow-android-client.

diegodromer avatar diegodromer commented on July 20, 2024

vlw cara, apenas essa linha solucionou o problema. Tinha feito um monte de coisae nada solucionou. vlwwww!!!

from dialogflow-android-client.

balaji-purusothaman-2794 avatar balaji-purusothaman-2794 commented on July 20, 2024

Me too had the same. Please help to fix, i'm using android studio 3.0 and kotlin here is my build.gradle

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.balajip.riya"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'LICENSE.txt'
}
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'ai.api:sdk:2.0.7@aar'
compile 'com.google.code.gson:gson:2.8.2'
compile 'commons-io:commons-io:2.4'
compile 'ai.api:libai-base:1.6.12'
}

from dialogflow-android-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.