Exception java.lang.NoClassDefFoundError: com.google.android.gms.common.AccountPicker

前端 未结 1 1632
谎友^
谎友^ 2020-12-18 10:10

I\'m trying the Quickstart: Run a Drive App on Android from Google Drive SDK. I have followed the hole process, but when I ran the app in my devices (real ones), it crashes

相关标签:
1条回答
  • 2020-12-18 10:31

    I had the same issue with the jtwitter.jar library. If you're running Android Studio, you have to do a clean & build (which AS doesn't truly do right now).

    Go to your command line, navigate to your project root and execute ./gradlew clean

    BEFORE YOU DO THIS

    Ensure that your .jar file is added to your /libs folder (if you're using build 17 or later, it has to be libs, and not lib). Right-click and select Add as Library...

    Then you're going to have to edit your build.gradle file (located in your /src directory).

    It should look something like this:

    buildscript {
        repositories {
            maven { url 'http://repo1.maven.org/maven2' }
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:0.4'
        }
    }
    apply plugin: 'android'
    
    dependencies {
        compile files('libs/android-support-v4.jar')
    }
    
    android {
        compileSdkVersion 17
        buildToolsVersion "17.0.0"
    
        defaultConfig {
            minSdkVersion 5
            targetSdkVersion 16
        }
    }
    

    Change the dependencies block to look like this:

    dependencies {
        compile files('libs/android-support-v4.jar')
        compile files('[path/to/.jar]')
    }
    

    Then you can build and run your project.

    0 讨论(0)
提交回复
热议问题