当前位置: 首页 > 知识库问答 >
问题:

抖动错误:配置项目“:Telephony”时出现问题

申屠浩歌
2023-03-14

当我在手机上运行应用程序时,我得到了这个错误,即使在重新安装应用程序后,它仍然给我这个错误:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':telephony'.
> Could not resolve all artifacts for configuration ':telephony:classpath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10.
     Required by:
         project :telephony
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.4.10/kotlin-gradle-plugin-1.4.10.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.4.10/kotlin-gradle-plugin-1.4.10.pom'. Received status code 502 from server: Bad Gateway
> Could not get unknown property 'android' for project ':telephony' of type org.gradle.api.Project.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 18s
Exception: Gradle task assembleDebug failed with exit code 1

我正在使用电话套餐通过flutter app发送短信:

final Telephony telephony = Telephony.instance;
  void sendSMS(String number)
  {
    telephony.sendSms(to: number, message: "Hey");
  }

我使用联系人选择器,然后将号码发送到aove函数:

List <String> num = contact.phoneNumber.toString().split(' ');
                        print(num);
                        print(num[0]);
                        sendSMS(num[0]);
  telephony: ^0.1.4
buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.google.gms:google-services:4.3.8'
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {

        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.epicare"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation platform('com.google.firebase:firebase-bom:28.0.1')
    implementation 'com.google.firebase:firebase-analytics'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

共有1个答案

刘骏祥
2023-03-14

这是由于您的分级和电话的分级之间的kotlin-gradle-plugin版本不匹配造成的。

步骤

>

  • kotlin-gradle-plugin版本升级到1.4.10

    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10"
    
    ext.kotlin_version = '1.4.10'
    

  •  类似资料:
    • > 出了什么问题:配置项目“:反应原生矢量图标”时出现问题。 无法解析配置“:反应本机矢量图标:类路径”的所有文件。找不到 com.android.tools.build:gradle:2.3 的任何匹配项。 因为没有可用的com.android.tools.build:gradle版本。在以下位置搜索: https://jcenter.bintray.com/com/android/tools/

    • 我在react-native中构建了一个项目,它在我的计算机上运行良好,但在更改其位置后,问题开始出现。我使用“yarn add@react-native-community/async-storage”安装了这个包

    • 我不理解收到的错误消息,也不知道如何解决它。当我尝试构建项目时,我看到以下错误: 我正在使用带有Ionic框架的Cordova。

    • 我试图查看Eclipse(版本Mars.2)中提供的springboot初学者项目,但遇到了错误。 这就是我所做的: 选择spring boot会给我两个新项目: ` 谷歌搜索此错误导致我进入maven存储库,所以我导入ch.qos.logback 再次运行(运行作为…- ``` 谢谢你的帮助!

    • 当我试图运行我的应用程序时,我遇到了以下错误。 评估项目: app时出现问题。 提供的字符串模块表示法“commons io:common无法解析配置的所有依赖项”:app:debugRuntimeClasspath。s-io:2.6'无效。示例注释:“org。gradle:gradle核心:2.2','组织。mockito:mockito核心:1.9.5:javadoc'。 >

    • 在Windows机器上,我在Eclipse的Gradle项目中使用Groovy已有一段时间了。现在我正在尝试为Linux机器进行配置。(Linux Mint MATE)<代码>uname-a给出: Linuxmike-纬度-E6410 4.4.0-53-通用#74-Ubuntu SMP Fri Dec 2 15:58:04 UTC 2016 i686 i686 GNU/Linux 日蚀氧气。使用以