Gradle не удается найти Tuya SDK 6.11.1 (com.thingclips.smart) – проблема с репозиторием?JAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Gradle не удается найти Tuya SDK 6.11.1 (com.thingclips.smart) – проблема с репозиторием?

Сообщение Anonymous »

Уже 3 месяца я сталкиваюсь с постоянным сбоем сборки Gradle при попытке интегрировать Tuya SmartLife App SDK для Android. Основная зависимость не может быть решена. Я использую React Native (Expo). Я использую собственный мост для выполнения собственных функций Android Tuya SDK, настроенных в папке android/.
Вы найдете мой код ниже:
Ошибка:
Could not determine the dependencies of task ':app:mergeReleaseNativeLibs'.
> Could not resolve all dependencies for configuration ':app:releaseRuntimeClasspath'.
> Could not resolve all dependencies for configuration ':app:releaseRuntimeClasspath'.
> Could not find com.thingclips.smart:thingsmart:6.11.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2 ... 6.11.0.pom
- https://repo.maven.apache.org/maven2/co ... 6.11.0.pom
- https://www.jitpack.io/com/thingclips/s ... 6.11.0.pom
- https://maven-other.tuya.com/repository ... 6.11.0.pom
- https://central.sonatype.com/repository ... 6.11.0.pom
Required by:
project :app

Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/usergui ... ories.html

android/build.gradle:
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://www.jitpack.io' }
maven { url 'https://maven-other.tuya.com/repository/maven-releases/' }
}
dependencies {
classpath('com.android.tools.build:gradle')
classpath('com.facebook.react:react-native-gradle-plugin')
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
}
}

allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://www.jitpack.io' }
maven { url 'https://maven-other.tuya.com/repository/maven-releases/' }
}
}

apply plugin: "expo-root-project"
apply plugin: "com.facebook.react.rootproject"

android/settings.gradle:
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url 'https://maven-other.tuya.com/repository/maven-releases/' }
}

def reactNativeGradlePlugin = new File(
providers.exec {
workingDir(rootDir)
commandLine("node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })")
}.standardOutput.asText.get().trim()
).getParentFile().absolutePath
includeBuild(reactNativeGradlePlugin)

def expoPluginsPath = new File(
providers.exec {
workingDir(rootDir)
commandLine("node", "--print", "require.resolve('expo-modules-autolinking/package.json', { paths: [require.resolve('expo/package.json')] })")
}.standardOutput.asText.get().trim(),
"../android/expo-gradle-plugin"
).absolutePath
includeBuild(expoPluginsPath)
}

plugins {
id("com.facebook.react.settings")
id("expo-autolinking-settings")
}

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_PROJECT)
repositories {
google()
mavenCentral()
maven { url 'https://www.jitpack.io' }
maven { url 'https://maven-other.tuya.com/repository/maven-releases/' }
}
}

extensions.configure(com.facebook.react.ReactSettingsExtension) { ex ->
if (System.getenv('EXPO_USE_COMMUNITY_AUTOLINKING') == '1') {
ex.autolinkLibrariesFromCommand()
} else {
ex.autolinkLibrariesFromCommand(expoAutolinking.rnConfigCommand)
}
}
expoAutolinking.useExpoModules()

rootProject.name = 'PowUp'

expoAutolinking.useExpoVersionCatalog()

include ':app'
includeBuild(expoAutolinking.reactNativeGradlePlugin)

android/app/build.gradle:
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"

def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()

react {
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", projectRoot, "android", "absolute"].execute(null, rootDir).text.trim())
reactNativeDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()
hermesCommand = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc"
codegenDir = new File(["node", "--print", "require.resolve('@react-native/codegen/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()

enableBundleCompression = (findProperty('android.enableBundleCompression') ?: false).toBoolean()
cliFile = new File(["node", "--print", "require.resolve('@expo/cli', { paths: [require.resolve('expo/package.json')] })"].execute(null, rootDir).text.trim())
bundleCommand = "export:embed"

autolinkLibrariesWithApp()
}

def enableMinifyInReleaseBuilds = (findProperty('android.enableMinifyInReleaseBuilds') ?: false).toBoolean()

def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'

android {
ndkVersion rootProject.ext.ndkVersion

buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion

namespace 'com.arlux.powup'
defaultConfig {
applicationId 'com.arlux.powup'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0.0"

buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withInputStream { localProperties.load(it) }
}

def tuyaAppKey = localProperties.getProperty('TUYA_ANDROID_APP_KEY')
?: findProperty('EXPO_PUBLIC_TUYA_ANDROID_APP_KEY')
?: findProperty('TUYA_ANDROID_APP_KEY')
?: System.getenv('EXPO_PUBLIC_TUYA_ANDROID_APP_KEY')

def tuyaAppSecret = localProperties.getProperty('TUYA_ANDROID_APP_SECRET')
?: findProperty('EXPO_PUBLIC_TUYA_ANDROID_APP_SECRET')
?: findProperty('TUYA_ANDROID_APP_SECRET')
?: System.getenv('EXPO_PUBLIC_TUYA_ANDROID_APP_SECRET')

if (!tuyaAppKey || !tuyaAppSecret) {
throw new GradleException("Variables Tuya manquantes!\n" +
"Ajoutez-les dans android/local.properties:\n" +
"TUYA_ANDROID_APP_KEY=votre_app_key\n" +
"TUYA_ANDROID_APP_SECRET=votre_app_secret")
}

buildConfigField "String", "TUYA_APP_KEY", "\"${tuyaAppKey}\""
buildConfigField "String", "TUYA_APP_SECRET", "\"${tuyaAppSecret}\""

manifestPlaceholders = [
TUYA_APP_KEY: tuyaAppKey,
TUYA_APP_SECRET: tuyaAppSecret
]

ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.debug
def enableShrinkResources = findProperty('android.enableShrinkResourcesInReleaseBuilds') ?: 'false'
shrinkResources enableShrinkResources.toBoolean()
minifyEnabled enableMinifyInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
def enablePngCrunchInRelease = findProperty('android.enablePngCrunchInReleaseBuilds') ?: 'true'
crunchPngs enablePngCrunchInRelease.toBoolean()
}
}
packagingOptions {
pickFirst 'lib/*/libc++_shared.so'
jniLibs {
def enableLegacyPackaging = findProperty('expo.useLegacyPackaging') ?: 'false'
useLegacyPackaging enableLegacyPackaging.toBoolean()
}
}
androidResources {
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}

configurations.all {
exclude group: "com.thingclips.smart", module: 'thingsmart-modularCampAnno'
}

["pickFirsts", "excludes", "merges", "doNotStrip"].each { prop ->
def options = (findProperty("android.packagingOptions.$prop") ?: "").split(",");
for (i in 0.. 0) {
println "android.packagingOptions.$prop += $options ($options.length)"
options.each {
android.packagingOptions[prop] += it
}
}
}

dependencies {
implementation("com.facebook.react:react-android")

def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true";
def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true";
def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true";

if (isGifEnabled) {
implementation("com.facebook.fresco:animated-gif:${expoLibs.versions.fresco.get()}")
}

if (isWebpEnabled) {
implementation("com.facebook.fresco:webpsupport:${expoLibs.versions.fresco.get()}")
if (isWebpAnimatedEnabled) {
implementation("com.facebook.fresco:animated-webp:${expoLibs.versions.fresco.get()}")
}
}

if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}

implementation files('libs/security-algorithm/security-algorithm-1.0.0-beta.aar')
implementation 'com.alibaba:fastjson:1.1.67.android'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.14.9'
implementation 'com.thingclips.smart:thingsmart:6.11.0'
}


Подробнее здесь: https://stackoverflow.com/questions/798 ... tory-issue
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»