• 14
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

I added an external library to my android project. After gradle sync I got the following error:

ERROR: Could not get unknown property 'supportLibraryVersion' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

This is the build.gradle file of the library I added:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 26
    buildToolsVersion "28.0.3"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 26
        testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main.java.srcDirs += 'src/main/base'
        main.java.srcDirs += 'src/main/api9'
        main.java.srcDirs += 'src/main/api14'
        main.java.srcDirs += 'src/main/api21'
        main.java.srcDirs += 'src/main/api23'
    }
}

dependencies {
    implementation "com.android.support:support-annotations:$supportLibraryVersion"
    implementation "com.android.support:support-v4:$supportLibraryVersion"

    // Tests
    testCompile 'junit:junit:4.12'
    androidTestCompile('com.android.support.test:runner:0.5') {
        exclude module: 'support-annotations'
    }
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') {
        exclude module: 'support-annotations'
    }
}

The supportLibraryVersion was declared in my app gradle file as follows:

ext {
    supportLibraryVersion = '27.1.0'
}

I tried to manually declare the supportLibraryVersion in the gradle file.

implementation "com.android.support:support-annotations: '27.1.0'"
implementation "com.android.support:support-v4:'27.1.0'"

Then the following error occurs:

ERROR: Failed to resolve: com.android
Affected Modules: library

For your first problem, you did not declare property $supportLibraryVersion in your library's build.gradle file. You need to declare this property like below

ext {
    supportLibraryVersion = '27.1.0'
}

For your second problem, you need to remove quote around the dependency version. So you need to rewrite dependency like below-

implementation "com.android.support:support-annotations:27.1.0"
implementation "com.android.support:support-v4:27.1.0"
  • 1
Reply Report