Я пытаюсь реализовать Gemini AI в своем приложении, но застрял на этом этапе: я могу импортировать com.google.mlkit.nl.smartreply.SmartReplySuggestion и
com.google.mlkit .nl.smartreply.TextMessage, но не com.google.mlkit.nl.smartreply.SmartReplyClient
Вот мой файл градиента уровня приложения:
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.gms.google-services'
android {
compileSdk 34
defaultConfig {
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
applicationId "com.uomini.myaiassistantben"
minSdk 24
targetSdk 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
packagingOptions {
resources {
excludes += ['META-INF/DEPENDENCIES', 'META-INF/LICENSE', 'META-INF/LICENSE.txt', 'META-INF/license.txt', 'META-INF/NOTICE', 'META-INF/NOTICE.txt', 'META-INF/notice.txt', 'META-INF/ASL2.0', 'META-INF/*.kotlin_module']
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_16
targetCompatibility JavaVersion.VERSION_16
}
namespace 'com.uomini.myaiassistantben'
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:33.1.2')
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-database'
implementation 'com.google.firebase:firebase-firestore'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.firebaseui:firebase-ui-auth:4.3.2'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-config'
implementation 'com.google.firebase:firebase-dynamic-links'
implementation 'com.google.firebase:firebase-perf'
implementation 'com.android.billingclient:billing:7.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.2.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.2.0'
implementation 'com.google.android.gms:play-services-auth:21.2.0'
implementation 'com.google.android.gms:play-services-base:18.5.0'
implementation "com.google.android.gms:play-services-location:21.3.0"
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.paging:paging-runtime:3.3.0'
implementation 'com.google.android.play:app-update:2.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0' // If you are using Gson as your JSON converter
implementation 'com.google.android.play:review:2.0.1'
implementation 'androidx.browser:browser:1.8.0'
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
implementation 'com.google.android.gms:play-services-speech:10.2.0'
implementation 'com.google.android.gms:play-services-mlkit:17.0.0'
implementation libs.common// Assuming this is the Gemini SDK
def lifecycle_version = "2.8.3"
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
// Google Calendar API
implementation 'com.google.api-client:google-api-client-android:1.33.0'
implementation 'com.google.apis:google-api-services-calendar:v3-rev20220715-1.32.1'
implementation 'com.google.mlkit:smart-reply:17.0.3'
// Gemini AI SDK (Note: This is a placeholder, as the actual SDK might not be publicly available yet)
// implementation 'com.google.ai.gemini:gemini-sdk:1.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
// implementation 'com.google.android.gms:play-services-mlkit-face-detection:17.1.0'
implementation 'com.google.firebase:firebase-ml-common:24.0.0'
// implementation 'com.google.mlkit:text-to-speech:18.0.0'
// CameraX for camera interaction
implementation 'androidx.camera:camera-core:1.3.4'
implementation 'androidx.camera:camera-camera2:1.3.4'
implementation 'androidx.camera:camera-lifecycle:1.3.4'
implementation 'androidx.camera:camera-view:1.3.4'
implementation 'androidx.camera:camera-extensions:1.3.4'
/**
// Cloud vision libraries
implementation 'com.google.cloud:google-cloud-vision:3.43.0'
implementation 'com.google.cloud:google-cloud-texttospeech:2.46.0'
implementation 'com.google.cloud:google-cloud-speech:2.6.1'
// Required for one-shot operations (to use `ListenableFuture` from Guava Android)
implementation 'com.google.guava:guava:32.1.2-android'
// Required for streaming operations (to use `Publisher` from Reactive Streams)
implementation 'org.reactivestreams:reactive-streams:1.0.4'
implementation 'androidx.activity:activity:1.9.0'**/
}
My project-level gradle file is as follows:
buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven {
url 'https://ci.android.com/builds/submitted ... epository/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:8.5.1'
classpath 'com.google.gms:google-services:4.4.2'
classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.2'
// classpath 'com.google.firebase:perf-plugin:1.4.2' // Performance Monitoring plugin
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url 'https://ci.android.com/builds/submitted ... epository/'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Подробнее здесь: https://stackoverflow.com/questions/787 ... import-oth
Мое приложение для Android не может импортировать библиотеку com.google.mlkit, но может импортировать другие библиотеки. ⇐ Android
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Не удалось создать приложение iOS при добавлении сканирования штрих-кода Google MLkit
Anonymous » » в форуме IOS - 0 Ответы
- 26 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Не удалось создать приложение iOS при добавлении сканирования штрих-кода Google MLkit
Anonymous » » в форуме IOS - 0 Ответы
- 12 Просмотры
-
Последнее сообщение Anonymous
-