Android ошибка синхронизации - PullRequest
0 голосов
/ 30 января 2020

Я новичок в android разработке. Я пытаюсь открыть существующий проект и заставить его скомпилировать. это первый раз, когда я использовал android studio, и файл Gradle меня немного смутил. Я пытаюсь синхронизировать это, но это терпит неудачу. Это содержимое Gradle.build

apply plugin: 'com.android.application'

    android {
        compileSdkVersion 25
        buildToolsVersion "25.0.1"

        defaultConfig {
            applicationId "de.establishement.packagelist"
            minSdkVersion 16
            targetSdkVersion 25
            versionCode 1
            versionName "1.0"

            testInstrumentationTrial "android.support.test.trial.AndroidJUnitRunner"

        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                debuggable= true
            }
        }
    }
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        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.0-beta4'
        testCompile 'junit:junit:4.12'
    }

Я скачал этот проект и у меня он есть на рабочем столе. вот что я получаю в своих сообщениях сборки:

    FAILURE: Build failed with an exception.

* Where:
Build file '/mac/Desktop/javaproject/build.gradle' line: 21

* What went wrong:
Could not compile build file '/Users/mac/Desktop/javaproject/build.gradle'.
> startup failed:
  build file '/Users/mac/Desktop/javaproject/build.gradle': 21: Statement labels may not be used in build scripts.
  In case you tried to configure a property named 'debuggable', replace ':' with '=' or ' ', otherwise it will not have the desired effect.
   @ line 21, column 25.
                 debuggable: true
                             ^

  1 error


* 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 10s
ERROR: startup failed:
build file '/Users/mac/Desktop/javaproject/build.gradle': 21: Statement labels may not be used in build scripts.
In case you tried to configure a property named 'debuggable', replace ':' with '=' or ' ', otherwise it will not have the desired effect.
 @ line 21, column 25.
               debuggable: true
                           ^

1 error

Open File

Ответы [ 2 ]

0 голосов
/ 30 января 2020

Неправильное использование. Попробуйте это;

apply plugin: 'com.android.application'

    android {
        compileSdkVersion 25
        buildToolsVersion "25.0.1"

        defaultConfig {
            applicationId "de.establishement.packagelist"
            minSdkVersion 16
            targetSdkVersion 25
            versionCode 1
            versionName "1.0"

            testInstrumentationTrial "android.support.test.trial.AndroidJUnitRunner"

        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                debuggable true //This row is wrong.
            }
        }
    }
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        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.0-beta4'
        testCompile 'junit:junit:4.12'
    }
0 голосов
/ 30 января 2020

При просмотре журналов вы должны изменить debuggable: true на debuggable = true

Вы пробовали это?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...