Error on Android studio for opening a project - android

I am trying to open an Android Studio News App project but getting this error agian and again i.e.
Project :News-Android-App declares a dependency from configuration 'implementation' to configuration 'default' which is not declared in the descriptor for project :MaterialShowcaseView:library.

You need to specify the configuration for your dependency. If you don't, it assumes a "default" configuration, which will give you an error. The MaterialShowcaseView Library has a GitHub page and they give you the directions for how to add to Gradle. The link is
https://github.com/deano2390/MaterialShowcaseView
Since you didn't provide any details, I don't know if you already tried this. But the error indicates that you must have failed to add something in the gradle files.
here's a screen shot of the gradle directions

Related

Android Studio could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10

Thank you for taking the time to read this.
The Problem
I have been working on an app for sometime and it has been working fine until I tried to add a settings fragment via the "nav_graph". After I add it I am presented with a gradle error that on the surface seems simple enough but I have been unable to find the cause. If I revert the changes ie remove the settings fragment then my app builds again.
The Error
Could not resolve all artifacts for configuration ':classpath'.
Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10.
The consumer was configured to find a runtime of a component compatible with Java 11, packaged as a jar, and its dependencies declared externally. However we cannot choose between the following variants of org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10:
My Thoughts
To me it seems like I need to select the correct variant compatible with Java 11? but I have not found how. I initially thought that one of my "implementations" might have been causing it but if I revert adding the settings fragment everything builds and works. I could use Shared Preferences instead but I have decided not to as it is now depreciated.
Any ideas would be a great help.
Many thanks.
Update your gradle version in build.gradle and gradle-wrapper.properties
If you build by Android Studio, go to File -> Invalidate Caches and then try again after Android Studio restarted

Manifest attributes not allowed when adding app as external librairy (android)

I'm currently new on Android. I try to create an app using another app project as an external library. For the moment, the two projects (two apps just created via Android Studio) are in the same folder like :
Project1
|--build.gradle
|--settings.gradle
Project2
|--build.gradle
|--settings.gradle
To add project2 as an external library, I just added to Project1/settings.gradle :
include ':MyDependency'
project(':MyDependency').projectDir = new File('D:/Projects/Project1', '../Project2')
and in the build.gradle of the application : compile project(':MyDependency').
Then, Project2 appears on the project window, so I guess it found the project.
When I then try to sync with gradle, I obtain the message
"Error:Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve project :MyDependency." and the same message for each other task in compileClassPath.
When I click on show details, the following message is displayed :
"Unable to find a matching configuration of project :MyDependency: None of the consumable configurations have attributes."
I tried each solution given for each problem, (buildTypes, clear caches, etc), but it does not work.
I also remarked that when I open Project2/app/src/main/AndroidManifest.xml, most attributes are not allowed here. Weird thing because if I open Project2 in another window on Android Studio, I don't get this message (and it builds perfectly). Once again, i tried each solution given on internet, which did not resolve my problem. I think that it's the cause of the problem.
Does anyone have an idea ?
I'm using Android Studio 3.0.1 and gradle 4.1.
Thank you very much!
Regards :)
You can change your Project2 to another module in Project1 as android library. In your project build.gradle you put include ':app', ':library-module' and in your app dependencies:
dependencies {
compile project(":library-module")
}
More info: https://developer.android.com/studio/projects/android-library.html
Dude you need to create a framwork that ‘ll share the code between your 2 apps

How can I run kinetise(framework) source code in Android studio?

I do one template project from "kinetise"(framework) and downloaded the android source code,
but not able to run this source code in android studio for editing.the downloaded source code was combining of javascript files also.
https://www.kinetise.com/user/dashboard
In kinetise while build code for Android and iOS both it will provide a template in which there are too much irrelevant code you have to search your required file by your own and done changes accordingly.
You must have to share your error here.
Most common error:
Error:Project :Kinetise declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project :facebook-android-sdk.

How to fix "Error:Cannot find JAR 'ivy-2.2.0.jar' required by module 'gradle-dependency-management' using classpath or distribution directory"?

I'm trying to create an Android application in Android Studio. When I try to create the project, it tells me that the Gradle refresh failed, with the error message
Error:Cannot find JAR 'ivy-2.2.0.jar' required by module 'gradle-dependency-management' using classpath or distribution directory 'C:\Gradle\gradle-2.10'
What is ivy-2.2.0.jar, and how do I fix this?
As of 7/19/2017, I have seen that the ivy-2.2.0.jar file is included in both the binaries-only and the complete installations for Gradle.
The file is located here:
gradle-4.0.1\lib\plugins\ivy-2.2.0.jar
Ironically, I received the same issue when attempting to build one of Oculus's VR sample projects.
When switching to the complete installation, I no longer received this specific error.
Perhaps try switching to the complete installation, or migrating the project to use any Gradle Wrappers that might be available.
This might happen if you are using the complete distribution with sources of Gradle. Try out the binary only distribution. It should work.

Configuration with name 'default' not found

I would like to start a project in Android Studio, using Simple Facebook library.
I used to develop in Eclipse and things were fine, but now i had to face an issue while trying to make the libraries work with gradle.
I made a new project.
I made a module for official Facebook SDK inside "libraries" folder
I made a module for Simple Facebook library inside "libraries" folder
I got the following error:
Error:A problem occurred configuring project ':app'.
> Cannot evaluate module simplefacebook : Configuration with name 'default' not found.
I did my research and as everybody experienced this error message is not really informative, and i also tryed to solve this problem from stack overflow's other smiliar questions but just coudnt get it work.
Please help if you can.
And please mention in comment which gradle file you would like to see, because there are 5 of them.
Look in the docs from Facebook!
You don't need to place the hole project as library module anymore in android studio.
Facebook and many other API Providers provide ther Libs now over Maven and you only have to add the dependcy to the correct artifact in your apps build.gradle file.
Here example for Facebook SDK:
dependencies {
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
}
Copied from here: https://developers.facebook.com/docs/android/getting-started
I havn't searched for the other lib, but you should find it your self on developers.facebook.com.

Categories

Resources