Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Android Studio-找不到从项目引用的类_Java_Android_Android Studio - Fatal编程技术网

Java Android Studio-找不到从项目引用的类

Java Android Studio-找不到从项目引用的类,java,android,android-studio,Java,Android,Android Studio,android studio一直存在这个问题。我有子文件夹(包)和A。Studio似乎没有正确链接它们——或者我做错了什么 这是我的项目结构 我的activity helper类使用ActivityUIHelper类,但A.Studio会抛出错误 Could not find class 'com.mface.mcall.ui.base.ActivityUIHelper', referenced from method com.mface.mcall.ui.base.ActivityHelpe

android studio一直存在这个问题。我有子文件夹(包)和A。Studio似乎没有正确链接它们——或者我做错了什么

这是我的项目结构

我的activity helper类使用ActivityUIHelper类,但A.Studio会抛出错误

Could not find class 'com.mface.mcall.ui.base.ActivityUIHelper', referenced from method com.mface.mcall.ui.base.ActivityHelper.<init>
这是主版本,格雷德尔

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
ext.compileSdkVersion = 21
ext.buildToolsVersion = '21.1.2'
ext.minSdkVersion = 14
ext.targetSdkVersion = 21
ext.versionName = '1.0'
ext.versionCode = 25

ext.prodDebug = false
ext.devDebug = true

// Dependencies versions
ext.universalImageLoaderVersion = '1.9.3'
ext.googlePlayServicesVersion = '6.1.+'
ext.croutonVersion = '1.8.4'
ext.cropperVersion = '0.9.10'
ext.viewPagerIndicatorVersion = '2.4.1'
ext.picassoVersion = '2.4.0'
ext.guavaVersion = '18.0'
ext.roundedImageViewVersion = '1.1.0'
ext.stickyListHeadersVersion = '2.5.2'
ext.FButtonVersion ='1.0.5'
ext.croutonVersion = '1.8.5'
这是应用程序的渐变

buildscript {
    repositories {
        maven { url 'http://download.crashlytics.com/maven' }
    }

    dependencies {
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
    }
}
apply plugin: 'com.android.application'
//apply plugin: 'crashlytics'
repositories {
    maven { url 'http://download.crashlytics.com/maven' }
}

dependencies {
    compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':Q-municate_core')
    compile "com.google.android.gms:play-services:${rootProject.googlePlayServicesVersion}"
    compile "com.soundcloud.android:android-crop:${rootProject.cropperVersion}@aar"
    compile "com.nostra13.universalimageloader:universal-image-loader:${rootProject.universalImageLoaderVersion}"
    compile "fr.avianey.com.viewpagerindicator:library:${rootProject.viewPagerIndicatorVersion}@aar"
    compile group: 'com.squareup.picasso', name: 'picasso', version: "${rootProject.picassoVersion}"
    compile "com.google.guava:guava:${rootProject.guavaVersion}"
    compile "com.makeramen:roundedimageview-apklib:${rootProject.roundedImageViewVersion}"
    compile "se.emilsjolander:stickylistheaders:${rootProject.stickyListHeadersVersion}"
    compile "info.hoang8f:fbutton:${rootProject.FButtonVersion}"
    compile "de.keyboardsurfer.android.widget:crouton:${rootProject.croutonVersion}@aar"
    compile 'com.android.support:appcompat-v7:21.0.3'
    //compile 'com.android.support:support-v4:21.0.3'
    compile 'com.nineoldandroids:library:2.4.0'
}

android {
    compileSdkVersion rootProject.compileSdkVersion
    buildToolsVersion rootProject.buildToolsVersion
    defaultConfig {
        applicationId 'com.mface.mcall'
        minSdkVersion rootProject.minSdkVersion
        targetSdkVersion rootProject.targetSdkVersion
        versionCode 1
        versionName "1.0"
        multiDexEnabled = true
    }
    dexOptions {
        incremental true
        javaMaxHeapSize "4g"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    lintOptions {
        abortOnError false
    }
}
尝试了构建,并从.Studio菜单和命令行清除。不帮忙!


没有生成错误,但应用程序崩溃。这是我在gradle和A.Studio的第一个项目,情况并不乐观:(

找到解决方案了吗???面临同样的问题:(我也面临同样的问题@Veeru你找到什么了吗
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
ext.compileSdkVersion = 21
ext.buildToolsVersion = '21.1.2'
ext.minSdkVersion = 14
ext.targetSdkVersion = 21
ext.versionName = '1.0'
ext.versionCode = 25

ext.prodDebug = false
ext.devDebug = true

// Dependencies versions
ext.universalImageLoaderVersion = '1.9.3'
ext.googlePlayServicesVersion = '6.1.+'
ext.croutonVersion = '1.8.4'
ext.cropperVersion = '0.9.10'
ext.viewPagerIndicatorVersion = '2.4.1'
ext.picassoVersion = '2.4.0'
ext.guavaVersion = '18.0'
ext.roundedImageViewVersion = '1.1.0'
ext.stickyListHeadersVersion = '2.5.2'
ext.FButtonVersion ='1.0.5'
ext.croutonVersion = '1.8.5'
buildscript {
    repositories {
        maven { url 'http://download.crashlytics.com/maven' }
    }

    dependencies {
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
    }
}
apply plugin: 'com.android.application'
//apply plugin: 'crashlytics'
repositories {
    maven { url 'http://download.crashlytics.com/maven' }
}

dependencies {
    compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':Q-municate_core')
    compile "com.google.android.gms:play-services:${rootProject.googlePlayServicesVersion}"
    compile "com.soundcloud.android:android-crop:${rootProject.cropperVersion}@aar"
    compile "com.nostra13.universalimageloader:universal-image-loader:${rootProject.universalImageLoaderVersion}"
    compile "fr.avianey.com.viewpagerindicator:library:${rootProject.viewPagerIndicatorVersion}@aar"
    compile group: 'com.squareup.picasso', name: 'picasso', version: "${rootProject.picassoVersion}"
    compile "com.google.guava:guava:${rootProject.guavaVersion}"
    compile "com.makeramen:roundedimageview-apklib:${rootProject.roundedImageViewVersion}"
    compile "se.emilsjolander:stickylistheaders:${rootProject.stickyListHeadersVersion}"
    compile "info.hoang8f:fbutton:${rootProject.FButtonVersion}"
    compile "de.keyboardsurfer.android.widget:crouton:${rootProject.croutonVersion}@aar"
    compile 'com.android.support:appcompat-v7:21.0.3'
    //compile 'com.android.support:support-v4:21.0.3'
    compile 'com.nineoldandroids:library:2.4.0'
}

android {
    compileSdkVersion rootProject.compileSdkVersion
    buildToolsVersion rootProject.buildToolsVersion
    defaultConfig {
        applicationId 'com.mface.mcall'
        minSdkVersion rootProject.minSdkVersion
        targetSdkVersion rootProject.targetSdkVersion
        versionCode 1
        versionName "1.0"
        multiDexEnabled = true
    }
    dexOptions {
        incremental true
        javaMaxHeapSize "4g"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    lintOptions {
        abortOnError false
    }
}