Search result for Question Taged android-studio
There are some results of your Tag: android-studio
    how to solve Could not find or load main class org.gradle.wrapper.GradleWrapperMain

    1. FAILURE
    2. execution of the command ./gradlew leads to the following output:
      usr$ ./gradlew tasks
      Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
      

    3. What is gradle wrapper
    4. gradlew is the gradle wrapper executable - batch script on windows and shell script elsewhere. The wrapper script when invoked, downloads the defined gradle version and executes it. By distributing the wrapper with your project, anyone can work with it without needing to install Gradle beforehand. Even better, users of the build are guaranteed to use the version of Gradle that the build was designed to work with.

    5. Restoring gradle wrapper
    6. It used to be that you needed to add a wrapper task to your build.gradle to restore gradle wrapper and all its dependencies. For instance:

      task wrapper(type: Wrapper) {
          gradleVersion = '4.1'
      }
      

      Newer versions of gradle do not require this. It is now a built-in task. Just run:

      gradle wrapper
      

      You can also supply additional flags to specify versions etc

      gradle wrapper --gradle-version 6.2 --distribution-type all
      

      When you run this task, a gradle wrapper script, and the required jar files are added to your source folders. Properties are stored in gradle/wrapper/gradle-wrapper.properties

      (You may need to install gradle locally to run this. brew install gradle on mac for instance. See more detailed instructions here)

    7. Why was it missing in the first place?
    8. OP seems to have deleted something that gradle wrapper depends on.

      But a common reason is that a .gitignore entry prevents wrapper jars from being checked into git. Note that the .gitignore in effect may be in the source folder, or a global one in your user home folder or git global configuration. It is common to have a *.jar entry in .gitignore.

      You can add an exception for gradlew's jar files in .gitignore

      *.jar
      !gradle/wrapper/gradle-wrapper.jar
      

      or force add the wrapper jar into git

      git add -f gradle/wrapper/gradle-wrapper.jar
      

      --
      Ref: Gradle Wrapper

    9. Other Solution
    10. What worked for me is to first run:

       gradle wrapper
      

      After successful build I was able to run

      ./gradlew assembleRelease
      

      Note: To be able run gradle wrapper first run brew install gradle. If installation successful run gradle wrapper from project root.

      Source and thanks: http://gradle.org/docs/current/userguide/gradle_wrapper.html and https://stackoverflow.com/users/745574/rage

      In my case it was a global .gitignore, as explained in @HankCa's answer.

      Instead of forcefully adding the jar, which you'll need to remember to do in each Gradle project, I added an override to re-include the wrapper jar in my global .gitignore:

      *.jar
      !gradle/wrapper/gradle-wrapper.jar
      

      This is useful to me as I have many projects that use Gradle; Git will now remind me to include the wrapper jar.

      This override will work so long as no directories above gradle-wrapper.jar (such as gradle and wrapper) are ignored -- git will not descend in to ignored directories for performance reasons.

    Laxmi Queenie 2022-08-11
    How to move to previous caret position in Android Studio

    How can one move to previous caret position(s) in android studio? It was possible in Eclipse.

    Filibert Nosizwe 2022-08-16
    android - Couldn't resolve resource @id/visible when using TextInputLayout

    Couldn't resolve resource @id/visible when using TextInputLayout on appcompat-v7:25.x.x

    Tried these steps below, but the problem is still persist:

    1. Rebuild Project
    2. Clean and Rebuild Project
    3. Clear Cache and Restart Android Studio

    Below is the code in the layout file.

        <android.support.design.widget.TextInputLayout
                android:id="@+id/tilFirstName"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
    
                <android.support.design.widget.TextInputEditText
                    android:id="@+id/etFirstName"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/first_name"
                    android:inputType="textPersonName"/>
        </android.support.design.widget.TextInputLayout>
    

    Below is the message displayed in Android Studio

    Rendering Problems.

    Couldn't resolve resource @id/visible

    Tip: Try to refresh the layout.

    NOTE: @id/visible is not present in the code.

    Sisu Célio 2022-08-17
    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0

    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.

    Could not resolve com.android.support:appcompat-v7:26.1.0.

    Required by: project :app

    No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode.

    Error log:

    Could not resolve all files for configuration ':app:debugCompileClasspath'.
    Could not resolve com.android.support:appcompat-v7:26.1.0.
    Required by:
    project :app
    No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode.
    No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode.
    Could not resolve com.android.support.constraint:constraint-layout:1.1.0-beta3.
    Required by:
    project :app
    No cached version of com.android.support.constraint:constraint-layout:1.1.0-beta3 available for offline mode.
    No cached version of com.android.support.constraint:constraint-layout:1.1.0-beta3 available for offline mode.
    Could not resolve com.android.support:design:26.1.0.
    Required by:
    project :app
    No cached version of com.android.support:design:26.1.0 available for offline mode.
    No cached version of com.android.support:design:26.1.0 available for offline mode.
    Could not resolve com.android.support:cardview-v7:26.1.0.
    Required by:
    project :app
    No cached version of com.android.support:cardview-v7:26.1.0 available for offline mode.
    No cached version of com.android.support:cardview-v7:26.1.0 available for offline mode.
    Could not resolve com.google.android.gms:play-services-ads:11.4.2.
    Required by:
    project :app
    No cached version of com.google.android.gms:play-services-ads:11.4.2 available for offline mode.
    No cached version of com.google.android.gms:play-services-ads:11.4.2 available for offline mode.
    Could not resolve com.android.support:support-v4:26.1.0.
    Required by:
    project :app
    No cached version of com.android.support:support-v4:26.1.0 available for offline mode.
    No cached version of com.android.support:support-v4:26.1.0 available for offline mode.

    Error log image:

    Click here for image

    Steve 2022-08-17
    android - In Gradle, how to print out a message in the console / Event Log?

    I'm trying to verify that my source and target paths are properly setup when I execute a deploy command.

    See the example below:
    (copied from: http://eppz.eu/blog/unity-android-plugin-tutorial-2/)

    android.libraryVariants.all { variant ->
        // Task names.
        String variantName = "${variant.name.capitalize()}"; // Like 'Debug'
        String deployTaskGroup = "plugin";
        String deployTaskName = "deploy${variantName}PluginArchive"; // Like 'deployDebugPluginArchive'
        String dependencyTaskName = "assemble${variantName}"; // Like 'assembleDebug'
        // Source.
        String sourceAARFolder = "${buildDir.getPath()}/outputs/aar/";
        String sourceAARName = "${project.name}-${variant.name}.aar";
        // Target.
        String targetAssetFolder = "Assets/Plugins/My Plugin";
        String targetAARFolder = "${rootDir.getPath()}/../../${targetAssetFolder}"; // Navigate into 'Assets'
        String targetAARName = "My Plugin Android.aar"; // The form you ship your plugin
    
        String targetProjDir = System.env.UNITY_PROJECT; // <-- Need to confirm this line!
        //Log.i(targetProjDir); //??????????? something like this?
    
        // Create task.
        task(deployTaskName, dependsOn: dependencyTaskName, type: Copy) {
            from(sourceAARFolder)
            into(targetAARFolder)
            include(sourceAARName)
            rename(sourceAARName, targetAARName)
        }.group = deployTaskGroup;
    }
    

    Is there any way to display the above targetProjDir string variable to some sort of console, or the Event Log in Android Studio (assuming that is it's console's name)?

    Konrad Adrianna 2022-08-17
    java - Error: Could not find com.google.gms:google-services:1.0. when adding google service plugin in build.gradle in android studio

    I am integrating OAuth login for Google+ on my android application, following the tutorial.

    According to the tutorial, I should add the Google Service plugin by adding classpath 'com.google.gms:google-services:1.0' dependency to top-level build.gradle in my android project.

    However, when I sync the gradle with the changes, I see the error as follows:

    Error:Could not find com.google.gms:google-services:1.0.

    Searched in the following locations: file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/1.0/google-services-1.0.pom file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/1.0/google-services-1.0.jar https://jcenter.bintray.com/com/google/gms/google-services/1.0/google-services-1.0.pom https://jcenter.bintray.com/com/google/gms/google-services/1.0/google-services-1.0.jar

    In my build.gradle:

    // 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.2.3'
            classpath 'com.google.gms:google-services:1.0'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
        }
    }
    

    It seems that the android studio is not able to find google-services plugin from repositories.

    Does anybody have the same issue? Or, am I missing something?

    Marie-José Brunihild 2022-08-19
    java - Remove all unused classes,methods from Android Studio project

    I have used the lint(Analyze->Inspect Code...) and find out unused methods and resources. All the unused resources removed by Refractor->Remove unused Resources but not found any option like this to remove java classes and methods. Is there any feature in the android studio or any Plugin which can remove all the java classes, the methods which are not used in code to save manual refracting?

    Lotta Daisy 2022-08-20
    java - Android Studio layout editor cannot render custom views

    In Android Studio, the layout editor cannot preview custom views in xml.

    Very simple example:

    public class MyCustomView extends FrameLayout {
        public MyCustomView(Context context) {
            super(context);
        }
    
        public MyCustomView(Context context, AttributeSet attrs) {
            super(context, attrs);
        }
    
        public MyCustomView(Context context, AttributeSet attrs, int defStyle) {
            super(context, attrs, defStyle);
        }
    }
    

     

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">
    
        <com.myprojectxxx.view.MyCustomView
            android:layout_width="48dp"
            android:layout_height="48dp" />
    
    </LinearLayout>
    

    Android Studio always says,

    Rendering Problems

    The following classes could not be found:

    • com.myprojectxxx.view.MyCustomView (Fix Build Path, Create Class)

    Tip: Try to build the project

    Of course, I HAVE that class. If I click "Create Class", it complains that the same class already exists. If I rebuild that project, nothing changes.

    And, yes, the project works very well on my Android device. Also, it is rendered very well in Eclipse ADT. However, in Android Studio, it always says that "CLASSES COULD NOT BE FOUND."

    Android Studio does not have the ability to preview a xml file with custom views? What's wrong with this?

    Blodeuwedd Anoushka 2022-08-19
    how can I add the aidl file to Android studio (from the in-app billing example)

    I am currently migrating an Eclipse app to Android Studio. This app was using the in app billing.

    My main problem is to compile the project and the aidl file (I guess you all use this file)

    I get this error message:

    Gradle: error: cannot find symbol class IInAppBillingService
    Gradle: error: package IInAppBillingService does not exist
    

    So, following some tutorials, I move this file from com.mypackage.billing to src/main/aidl (see this reference)

    But as soon, as I do that, I get this message:

    Gradle: Execution failed for task ':xxxxxxxxxxx:compileDebugAidl'.

    Failed to run command: (...) C:\Users\xxxx\AndroidStudioProjects\xxxxxxProject\xxxxxxx\src\main\aidl\IInAppBillingService.aidl:45 interface IInAppBillingService should be declared in a file called com\xxxxxxxx\billing\IInAppBillingService.aidl.

    The message is clearly a contradiction with the post from the Google bug page I linked above.

    Anyone suceeded to make this aidl file to work and can help me?

    enter image description here

    Just to inform, some links I followed:

    • http://tools.android.com/tech-docs/new-build-system/user-guide
    • http://developer.android.com/guide/components/aidl.html
    Margrit Simon 2022-08-15
    Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified -keypass value. in Android Studio

    I am trying to create a new Keystore to generate a signed apk but I am getting an error like this, please help me to get rid of this error.

    enter image description here

    enter image description here

    Zawar Pascal 2022-08-19
    java - Gradle - Error Could not find method implementation() for arguments [com.android.support:appcompat-v7:26.0.0]

    I am trying to open existing android project in android studio and it gradle cannot build the app without the error

    Error android studio keeps on throwing

    Error:(74, 1) A problem occurred evaluating project ':app'.
    > Could not find method implementation() for arguments 
    [com.android.support:appcompat-v7:26.0.0] on object of type 
    org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
    

    My Code in build.gradle Which can help to understand my issue My dependencies

    dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    
    // google & support
    implementation "com.android.support:appcompat-v7:$supportVersion"
    implementation "com.android.support:cardview-v7:$supportVersion"
    implementation "com.android.support:recyclerview-v7:$supportVersion"
    implementation "com.android.support:design:$supportVersion"
    implementation "com.android.support:palette-v7:$supportVersion"
    implementation "com.android.support:customtabs:$supportVersion"
    implementation "com.android.support:support-v4:$supportVersion"
    implementation 'com.google.android.exoplayer:exoplayer:r2.0.4'
    
    // utils
    implementation 'com.github.bumptech.glide:glide:4.0.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
    implementation 'com.koushikdutta.ion:ion:2.1.7'
    implementation 'com.github.Commit451:bypasses:1.0.4'
    implementation 'com.jakewharton:butterknife:8.8.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.0'
    implementation 'com.drewnoakes:metadata-extractor:2.9.1'
    implementation "com.orhanobut:hawk:2.0.1"
    
    }
    

    Please help to solve the issue

    Eudocia Girolamo 2022-08-16
    Android Studio Could not find method runProguard() for arguments?
    /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin/java "- com.intellij.rt.execution.application.AppMain org.gradle.launcher.GradleMain --build-file /Users/Tom/Documents/Git_open_sources/android-material-drawer-template/app/build.gradle
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file '/Users/Tom/Documents/Git_open_sources/android-material-drawer-template/app/build.gradle' line: 16
    
    * What went wrong:
    A problem occurred evaluating project ':app'.
    > Could not find method runProguard() for arguments [false] on BuildType_Decorated{name=release, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, applicationIdSuffix=null, versionNameSuffix=null, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}}.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    BUILD FAILED
    
    Total time: 6.741 secs
    
    Process finished with exit code 1
    

    apply plugin: 'com.android.application'
    
    android {
    compileSdkVersion 21
    buildToolsVersion "21.1.0"
    
    defaultConfig {
        applicationId "com.poliveira.apps.materialtests"
        minSdkVersion 11
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    }
    
    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:21.0.0'
    //noinspection GradleDependency
    compile "com.android.support:appcompat-v7:21.0.0"
    compile 'com.android.support:recyclerview-v7:21.0.0'
    }    
    
    Baptist Slaven 2022-08-18
    How to build signed apk from Android Studio for Flutter

    Is there a way to build an apk for flutter in Android Studio?

    I have seen this guideline: https://flutter.dev/docs/deployment/android
    But here flutter console is used to build apk.

    Marko Yalwa 2022-08-19
    Syncing Android Studio project with Gradle files

    I was working on a project, and then I got a prompt to update Android Studio. After I did that, I started getting this error when trying to run my app Error

    It says

    The project may need to be synced with Gradle files

    How do I solve this?

    Grażyna Jalil 2022-08-19
    Is there a way to show a preview of a RecyclerView's contents in the Android Studio editor?

    When I add the RecyclerView to the layout, it shows up as a blank screen. Is there a way, such as through the tools namespace, to show a preview of the content of the RecyclerView?

    Simon Yitro 2022-08-14
    android - How to use Monitor (DDMS) tool to debug application

    I'm switching my development environment from Eclipse to Android Studio these days. And I really enjoy its autocompletion and many other features this IDE provide. However, I have some problem when doing debugging.

    I hope to use Monitor tool which this IDE provided, self-included DDMS and very nice visual interface to track memory usage, thread condition and so on. But I can't find a way that this could support step by step using breakpoints I have to create (That red dot in editor)

    I can only do step by step debug by not open this Monitor. Since when I try to use Monitor while the debugger is running, it will popup a window asking me to disconnect the ADB first. I also can't find a place to start the application from Monitor.

    Is there a way to do step by step debug while using Monitor at the same time in Android Studio?

    Grażyna Jalil 2022-08-20
    Android Studio Gradle: Error:Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package

    I am trying to upgrade my google play services dependencies to 8.4.0 by following the example Google gives here, but I am getting the following error ('com.example.exampleapp' is a replacement for my app package name):

    Error:Execution failed for task ':app:processDebugGoogleServices'.
    > No matching client found for package name 'com.example.exampleapp'
    

    Project build.gradle:

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
            classpath 'com.google.gms:google-services:2.0.0-alpha3'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            jcenter()
        }
    }
    

    Module app/build.gradle:

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.2"
    
        defaultConfig {
            applicationId "com.example.exampleapp"
            minSdkVersion 19
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
        }
        useLibrary 'org.apache.http.legacy'
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.1.1'
        compile 'com.android.support:cardview-v7:23.1.1'
        compile 'com.android.support:design:23.1.1'
        compile 'com.google.android.exoplayer:exoplayer:r1.5.2'
        compile 'com.google.android.gms:play-services-auth:8.4.0'
        compile 'com.google.android.gms:play-services-maps:8.4.0'
        compile('com.mapbox.mapboxsdk:mapbox-android-sdk:3.0.0@aar') {
            transitive = true
        }
        compile files('libs/commons-lang3-3.3.2.jar')
    }
    
    apply plugin: 'com.google.gms.google-services'
    

    gradle-wrapper.properties:

    #Fri Jan 01 08:23:56 CST 2016
    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
    

    Any ideas as to why gradle can't recognize my own app package name?


    EDIT:

    Ok, I'm getting different errors this time.

    Based on the link Shawn Thye provided, I added this to the bottom of app/build.gradle:

    apply plugin: 'com.google.gms.google-services'
    

    and leaving everything else what I listed previously I got this error:

    Information:Gradle tasks [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugAndroidTestSources]
    /Users/user/Documents/AndroidStudio/ExampleApp/app/build.gradle
    Error:(1, 1) A problem occurred evaluating project ':app'.
    > Failed to apply plugin [id 'com.android.application']
       > Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in /Users/user/Documents/AndroidStudio/ExampleApp/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip
    Information:BUILD FAILED
    Information:Total time: 0.921 secs
    Information:1 error
    Information:0 warnings
    Information:See complete output in console
    

    and the Gradle console:

    Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources]
    
    Configuration on demand is an incubating feature.
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file '/Users/user/Documents/AndroidStudio/ExampleApp/app/build.gradle' line: 1
    
    * What went wrong:
    A problem occurred evaluating project ':app'.
    > Failed to apply plugin [id 'com.android.application']
       > Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in /Users/user/Documents/AndroidStudio/ExampleApp/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    BUILD FAILED
    
    Total time: 1.211 secs
    

    So, then I changed gradle-wrapper.properties as requested to "gradle-2.10-all" and got this error:

    Information:Gradle tasks [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources]
    google-services plugin could not detect any version for com.google.android.gms, default version: 8.3.0 will be used.
    please apply google-services plugin at the bottom of the build file.
    :clean
    :app:clean
    :app:preBuild UP-TO-DATE
    :app:preDebugBuild UP-TO-DATE
    :app:checkDebugManifest
    :app:preReleaseBuild UP-TO-DATE
    :app:prepareComAndroidSupportAppcompatV72311Library
    :app:prepareComAndroidSupportCardviewV72311Library
    :app:prepareComAndroidSupportDesign2311Library
    :app:prepareComAndroidSupportGridlayoutV72311Library
    :app:prepareComAndroidSupportRecyclerviewV72311Library
    :app:prepareComAndroidSupportSupportV42311Library
    :app:prepareComDigitsSdkAndroidDigits192Library
    :app:prepareComFacebookAndroidFacebookAndroidSdk470Library
    :app:prepareComGoogleAndroidExoplayerExoplayerR152Library
    :app:prepareComGoogleAndroidGmsPlayServicesAuth840Library
    :app:prepareComGoogleAndroidGmsPlayServicesBase840Library
    :app:prepareComGoogleAndroidGmsPlayServicesBasement840Library
    :app:prepareComGoogleAndroidGmsPlayServicesMaps840Library
    :app:prepareComGoogleAndroidGmsPlayServicesMeasurement830Library
    :app:prepareComMapboxMapboxsdkMapboxAndroidSdk230Library
    :app:prepareComTwitterSdkAndroidTweetComposer102Library
    :app:prepareComTwitterSdkAndroidTweetUi180Library
    :app:prepareComTwitterSdkAndroidTwitter1110Library
    :app:prepareComTwitterSdkAndroidTwitterCore162Library
    :app:prepareIoFabricSdkAndroidFabric1310Library
    :app:prepareDebugDependencies
    :app:compileDebugAidl
    :app:compileDebugRenderscript
    :app:generateDebugBuildConfig
    :app:generateDebugAssets UP-TO-DATE
    :app:mergeDebugAssets
    :app:processDebugManifest
    :app:fabricGenerateResourcesDebug
    :app:generateDebugResValues UP-TO-DATE
    :app:processDebugGoogleServices
    Found com.google.android.gms:play-services-auth:8.4.0, but version 8.3.0 is needed for the google-services plugin.
    Found com.google.android.gms:play-services-maps:8.4.0, but version 8.3.0 is needed for the google-services plugin.
    :app:processDebugGoogleServices FAILED
    Error:Execution failed for task ':app:processDebugGoogleServices'.
    > Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 8.3.0.
    Information:BUILD FAILED
    Information:Total time: 5.724 secs
    Information:1 error
    Information:0 warnings
    Information:See complete output in console
    

    And the Gradle console:

    Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources]
    
    Configuration on demand is an incubating feature.
    google-services plugin could not detect any version for com.google.android.gms, default version: 8.3.0 will be used.
    please apply google-services plugin at the bottom of the build file.
    Incremental java compilation is an incubating feature.
    :clean
    :app:clean
    :app:preBuild UP-TO-DATE
    :app:preDebugBuild UP-TO-DATE
    :app:checkDebugManifest
    :app:preReleaseBuild UP-TO-DATE
    :app:prepareComAndroidSupportAppcompatV72311Library
    :app:prepareComAndroidSupportCardviewV72311Library
    :app:prepareComAndroidSupportDesign2311Library
    :app:prepareComAndroidSupportGridlayoutV72311Library
    :app:prepareComAndroidSupportRecyclerviewV72311Library
    :app:prepareComAndroidSupportSupportV42311Library
    :app:prepareComDigitsSdkAndroidDigits192Library
    :app:prepareComFacebookAndroidFacebookAndroidSdk470Library
    :app:prepareComGoogleAndroidExoplayerExoplayerR152Library
    :app:prepareComGoogleAndroidGmsPlayServicesAuth840Library
    :app:prepareComGoogleAndroidGmsPlayServicesBase840Library
    :app:prepareComGoogleAndroidGmsPlayServicesBasement840Library
    :app:prepareComGoogleAndroidGmsPlayServicesMaps840Library
    :app:prepareComGoogleAndroidGmsPlayServicesMeasurement830Library
    :app:prepareComMapboxMapboxsdkMapboxAndroidSdk230Library
    :app:prepareComTwitterSdkAndroidTweetComposer102Library
    :app:prepareComTwitterSdkAndroidTweetUi180Library
    :app:prepareComTwitterSdkAndroidTwitter1110Library
    :app:prepareComTwitterSdkAndroidTwitterCore162Library
    :app:prepareIoFabricSdkAndroidFabric1310Library
    :app:prepareDebugDependencies
    :app:compileDebugAidl
    :app:compileDebugRenderscript
    :app:generateDebugBuildConfig
    :app:generateDebugAssets UP-TO-DATE
    :app:mergeDebugAssets
    :app:processDebugManifest
    :app:fabricGenerateResourcesDebug
    :app:generateDebugResValues UP-TO-DATE
    :app:processDebugGoogleServices
    Found com.google.android.gms:play-services-auth:8.4.0, but version 8.3.0 is needed for the google-services plugin.
    Found com.google.android.gms:play-services-maps:8.4.0, but version 8.3.0 is needed for the google-services plugin.
    :app:processDebugGoogleServices FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:processDebugGoogleServices'.
    > Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 8.3.0.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    BUILD FAILED
    
    Total time: 5.724 secs
    

    It's asking for the google-services plugin at the bottom of the build file, which it is already, and it's asking me to run 8.3.0 again... which I will do since that's the only thing working right now...

    Elise Pankaj 2022-08-16
    How to open Android Device Monitor in latest Android Studio 3.1

    Recently I updated my android studio, after the update, I am unable to find android device monitor option in the tools section. In the previous update it was there in tools->android->android device monitor. But now in the updated version, it is not present. You can check screenshot of my android studio.

    enter image description here

    Edna Morgen 2022-08-17
    Failure on build with Gradle on command line with an android studio project : Xlint error

    When I try to build an android project with gradle with this command :

    > gradlew clean build assembleRelease
    

    It gives me this error :

    Note: Some input files use or override a deprecated API.  
    Note: Recompile with -Xlint:deprecation for details.  
    Note: Some input files use unchecked or unsafe operations.  
    Note: Recompile with -Xlint:unchecked for details.
    

    I can build this project and make the APK in Studio.

    Is there a way to configure Gradle to make a compilation ignoring Xlint notifications ?

    OR, can I use other parameters, to make the release from command-line with gradle/gradlew ?

    Yitro Usman 2022-08-19
    How to completely uninstall Android Studio from windows(v10)?

    I have already seen this question. But that's for Mac OS. I am using windows. Every time I create a new project or try to build/rebuild the project it freezes!! I have installed the latest version(9/10/2016). But things are getting worse. I want to completely remove it and install it as if I would be installing it for the first time. Any help be Appreciated.

    Mandlenkosi Shantelle 2022-08-15
    android - Error:Execution failed for task ':app:transformClassesWithDexForDebug'

    The error

    Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 1

    My app gradle file:

    apply plugin: 'com.android.application'
    apply plugin: 'com.google.gms.google-services'
    
    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.1"
        defaultConfig {
            applicationId 'Hidden application ID'
            minSdkVersion 15
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
            multiDexEnabled true
        }
        buildTypes {
            debug {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
            release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        lintOptions {
            disable 'InvalidPackage'
        }
        packagingOptions {
            exclude 'META-INF/services/javax.annotation.processing.Processor'
        }
        productFlavors {
        }
    }
    
    repositories {
        mavenCentral()
    }
    
    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile 'com.android.support:multidex:1.0.1'
        compile 'com.android.support:appcompat-v7:23.1.1'
        compile 'com.android.support:design:23.1.1'
        compile 'com.android.support:cardview-v7:23.1.1'
        compile 'com.jakewharton:butterknife:7.0.1'
        compile 'com.mcxiaoke.volley:library-aar:1.0.0'
        compile 'com.google.android.gms:play-services:8.1.0'
        compile 'com.facebook.android:facebook-android-sdk:4.7.0'
        compile 'com.googlecode.libphonenumber:libphonenumber:7.2.1'
        compile 'com.getbase:floatingactionbutton:1.10.1'
        compile 'com.android.support:preference-v7:23.1.1'
    }
    

    While debugging, if I set minifyEnabled to true, then it compiles. However, then I cannot debug my application.

    I checked this other question: Execution failed for task ':app:transformClassesWithDexForDebug' while implementing Google sign in for Android, but there is only one answer and implementing it does not resolve the issue unfortunately.

    AFAIK, the error is caused due to addition of too many Gradle dependencies, but I may be wrong (I really hope to be wrong because all these packages are really important!).

    Please help me to resolve this error. Much thanks!

    Gábor Pasha 2022-08-18
    android - Can an AAR include transitive dependencies?

    Right now I have a library project, say project Foo that depends on a library like OkHttp.

    Now, Foo has a Maven buildstep that generates an AAR and pushes it up to a public place.

    Now lets say I have project B, we'll call it Bar. Bar is an Android application, and Bar depends on Foo.

    Well, I have that. However, when I make a call to a public static function in Foo from Bar that calls OkHttp, I get this message:

    java.lang.NoClassDefFoundError: com.squareup.okhttp.OkUrlFactory
                at com.foo.sdk.utils.OkHttpStack.<init>(OkHttpStack.java:15)
    

    Is such a thing possible? Or will Bar need to manually depend on OkHttp as well as any other dependencies Foo has?

    Jožica Lidiya 2022-08-18
    git - Android Studio Update Project: Merge vs Rebase vs Branch Default

    Apologies if this seems redundant as I know there are fair amount of questions regarding Merge vs Rebase, but there doesn't seem to be any that throw in 'Branch Default' as well.

    You are given a case where you have multiple people working on something (i.e. an Android app in Android Studio) concurrently. What is the best option to update project/pull if someone pushes to the master branch and you want to pull in the new master such that it doesn't overwrite the work you are still working on and have yet to commit and push to master? Android Studio lists 'Merge' 'Rebase' and 'Branch Default' when clicking 'Update Project'. From what it sounds like, I would want to do 'Rebase' (followed by 'Merge'?), but I'm not entirely sure.

    Zawar Pascal 2022-08-19
    How to export library to Jar in Android Studio?

    I have downloaded some library sources and would like to export it as a Jar file using Android Studio. Is there a way to export to jar file using Android studio ?

    edit:

    The library I want to export as jar is an Android library. It's called "StandOut" and can be downloaded from GitHub. https://github.com/pingpongboss/StandOut

    Filibert Nosizwe 2022-08-17
    unit testing - How can I create tests in Android Studio?

    Just downloaded Android Studio which is based off of the Intellij Idea.

    How would one create tests?

    I notice there is a option for create a Test Module but this doesn't seem to do anything, only create a new project with src

    I also tried pressing the hot key CTRL+AlT+T which allows to create unit tests on an existing class but it seems to want to place it in the current project. Of course this doesn't help with TDD

    Does anyone have any experience here ?

    Salvatrix Ngải 2022-08-16
    android - Gradle: More than one variant of project :myLib matches the consumer attributes

    A library that I wrote myLib uses RemoteMessage from Firebase, the app itself also uses Firebase.

    Using gradle 4.7. Also facing this in 4.4.1.

    How to fix it?

    project.gradle

    buildscript {
        
        repositories {
            google()
            jcenter()
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.2'
            classpath 'com.google.gms:google-services:3.3.0'
        }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
            mavenCentral()
            mavenLocal()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    app.gradle

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 27
        defaultConfig {
            applicationId "com.test.app"
            minSdkVersion 19
            targetSdkVersion 27
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            multiDexEnabled true
        }
    
        dexOptions {
            preDexLibraries = false
            jumboMode = false
            javaMaxHeapSize "2048M"
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
        productFlavors {
        }
    }
    
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
    
        implementation 'com.android.support:appcompat-v7:27.1.1'
    
        implementation 'com.google.android.gms:play-services-gcm:12.0.1'
        implementation 'com.google.android.gms:play-services:12.0.1'
        implementation 'com.google.firebase:firebase-core:12.0.1'
        implementation 'com.google.firebase:firebase-messaging:12.0.1'
        implementation 'com.google.firebase:firebase-crash:12.0.1'
    
        implementation project(":myLib")
    }
    
    apply plugin: 'com.google.gms.google-services'
    

    myLib.gradle

    apply plugin: 'com.android.library'
    
    android {
        compileSdkVersion 27
    
    
    
        defaultConfig {
            minSdkVersion 19
            targetSdkVersion 27
            versionCode 1
            versionName "1.0"
    
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    
    }
    
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
    
        implementation 'com.android.support:appcompat-v7:27.1.1'
    
        implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.2'
        implementation 'com.j256.ormlite:ormlite-core:5.0'
        implementation 'com.j256.ormlite:ormlite-android:5.0'
    
        implementation 'com.google.firebase:firebase-messaging:12.0.1'
    }
    

    Error output from testApp\myLib> gradle clean assembleDebug and testApp\app> gradle clean assembleDebug

    More than one variant of project :myLib matches the consumer attributes:

    • Configuration ':myLib:debugApiElements' variant android-aidl:
      • Found artifactType 'android-aidl' but wasn't required.
      • Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
      • Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
      • Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
      • Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
    • Configuration ':myLib:debugApiElements' variant android-classes:
      • Found artifactType 'android-classes' but wasn't required.
      • Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
      • Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
      • Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
      • Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
    • Configuration ':myLib:debugApiElements' variant android-manifest:
      • Found artifactType 'android-manifest' but wasn't required.
      • Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
      • Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
      • Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
      • Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
    • Configuration ':myLib:debugApiElements' variant android-renderscript:
      • Found artifactType 'android-renderscript' but wasn't required.
      • Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
      • Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
      • Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
      • Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
    • Configuration ':myLib:debugApiElements' variant jar:
      • Found artifactType 'jar' but wasn't required.
      • Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
      • Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
      • Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
      • Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
    Adrianne Siavash 2022-08-17
    java - Android Studio: failed to complete gradle execution, cause is empty

    When I try to run an Android emulator, I get the following error screen. The same occurs when I export the apk. When I go to the directory where the apk will be saved, the apk file is not there.

    Thank you,
    christophe

    enter image description here

    Margrit Simon 2022-08-18
    Can't Delete AVD from AVD Manager in Android Studio

    I am running Android Studio on OS X Yosemite. I am trying to simply delete an AVD from Android Studio AVD Manager. Every time I attempt to delete it I get the message "The selected AVD is currently running in the Emulator. Please exit the emulator instance and try deleting again." The problem is that the emulator is NOT running. I even closed down all the studio and rebooted the computer. It still says the same thing. Anybody seen this before? I would really like to remove the AVD.

    Thanks in Advance!

    Ibrahim Yaron 2022-08-21
    how to overcome Android Studio cannot resolve symbol for android classes

    I'v just installed Android Studio 0.8.2 for my first time and I have a lot of "Cannot resolve symbol" errors. The errors occur on both new projects and projects which were exported from eclipse.

    JDK version: jdk1.8.0_11

    Android studio errors: Android studio errors

    Project's grade file enter image description here

    Konrad Adrianna 2022-08-20
    android - Project with path ':mypath' could not be found in root project 'myproject'

    I'm migrated from Eclipse to android studio 0.5.8, after importing my project to android studio i was getting the error Project with path ':progressfragment' could not be found in root project 'project_name'.

    Project Struture :

    Libs

    enter image description here

    Complete Structure (edit 2) :

    enter image description here

    Gradle.build:

    apply plugin: 'android'
    
    dependencies {
        compile fileTree(dir: 'libs', include: '*.jar')
        compile project(':progressfragment')
        compile project(':viewpagerindicatorlibrary')
        compile project(':ZBarScannerActivity')
        compile project(':google-play-services_lib')
        compile project(':SwitchCompatLibrary')
        compile project(':actionbarsherlock')
        compile project(':librarymultichoice')
    }
    
    
    
    buildscript {
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:0.9.+'
        }
    }
    
    android {
        compileSdkVersion 14
        buildToolsVersion "19.0.1"
    
        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src']
                resources.srcDirs = ['src']
                aidl.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                res.srcDirs = ['res']
                assets.srcDirs = ['assets']
            }
    
            // Move the tests to tests/java, tests/res, etc...
            instrumentTest.setRoot('tests')
    
            // Move the build types to build-types/<type>
            // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
            // This moves them out of them default location under src/<type>/... which would
            // conflict with src/ being used by the main source set.
            // Adding new build types or product flavors should be accompanied
            // by a similar customization.
            debug.setRoot('build-types/debug')
            release.setRoot('build-types/release')
        }
    }
    
    Mandlenkosi Shantelle 2022-08-17
    Cannot resolve symbol HttpGet,HttpClient,HttpResponce in Android Studio

    I just copy all the jar files of Http but Android Studio cann't import all these jar files.It gives an error : Cannot resolve symbol HttpGet,HttpClient,HttpResponse.

    My Activity file is here:-

    public class MainActivity extends AppCompatActivity {
    
    ArrayList<Product>  productslist;
    ProductAdapter adapter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    
    
        productslist = new ArrayList<Product>();
        new JSONAsyncTask().execute("http://opencart.codeniques.com/myshop/?route=feed/web_api/products&id=60&key=test123");
    
        ListView listView = (ListView)findViewById(R.id.list);
        adapter = new ProductAdapter(getApplicationContext(),R.layout.row,productslist);
    
        listView.setAdapter(adapter);
    
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Toast.makeText(getApplicationContext(),productslist.get(position).getName(),Toast.LENGTH_LONG).show();
            }
        });
    }
    
    class JSONAsyncTask extends AsyncTask<String,Void,Boolean>{
    
        ProgressDialog dialog;
    
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            dialog = new ProgressDialog(MainActivity.this);
            dialog.setMessage("Loading, please wait");
            dialog.setTitle("Connecting server");
            dialog.show();
            dialog.setCancelable(false);
        }
    
        @Override
        protected Boolean doInBackground(String... params) {
            try{
                HttpGet httppost = new HttpGet(params[0]);
                HttpClient httpclient = new DefaultHttpClient();
                HttpResponse response = httpclient.execute(httppost);
    
                int status = response.getStatusLine().getStatusCode();
    
                if(status == 200){
                    HttpEntity entity = response.getEntity();
                    String data = EntityUtils.toString(entity);
    
                    JSONObject jsono = new JSONObject(data);
                    JSONArray jarray = jsono.getJSONArray("products");
    
                    for (int i = 0; i < jarray.length(); i++) {
                        JSONObject object = jarray.getJSONObject(i);
    
                        Product actor = new Product();
    
                        actor.setId(object.getString("id"));
                        actor.setName(object.getString("name"));
                        actor.setDescription(object.getString("description"));
                        actor.setHref(object.getString("href"));
                        actor.setPrice(object.getString("pirce"));
                        actor.setImage(object.getString("thumb"));
                        actor.setSpecial(object.getString("special"));
                        actor.setRating(object.getString("rating"));
    
                        productslist.add(actor);
                }
                    return  true;
                }
            }catch (JSONException e){
                Log.e("Error :",e.getMessage());
            }catch (ParseException e){
                Log.e("Error :",e.getMessage());
            }catch (IOException e){
                Log.e("Error :",e.getMessage());
            }catch (Exception e){
                Log.e("Error :",e.getMessage());
            }
            return  false;
        }
        @Override
        protected void onPostExecute(Boolean aBoolean) {
            dialog.cancel();
            adapter.notifyDataSetChanged();
            if(aBoolean == false){
                Toast.makeText(getApplicationContext(), "Unable to fetch data from server", Toast.LENGTH_LONG).show();
            }
        }
    }}
    

    and here my gradle is here:-

    apply plugin: 'com.android.application'
    android {
    compileSdkVersion 23
    buildToolsVersion "22.0.1"
    
    defaultConfig {
        applicationId "android.catalyst.com.newjsonarray"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }}}
    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'}
    
    Alícia Ugochukwu 2022-08-20