Please help me to resolve this error...
Added Dependency in build.gradle
**// https://mvnrepository.com/artifact/com.microsoft.sqlserver/sqljdbc4
testCompile group: 'com.microsoft.sqlserver', name: 'sqljdbc4', version: '4.0'**
After Refresh Gradle Project, getting the error below:
**Could not resolve: com.microsoft.sqlserver:sqljdbc4:4.0**
"It worked for me after adding in locally, here are my Steps in Eclipse Neon."
Step 1.
create 'lib' folder under main project
Step 2.
copy the jar file 'sqljdbc4' to lib folder
Step 3.
Add below dependency in 'build.gradle' file
repositories {
jcenter()
mavenCentral()
flatDir {
dirs 'lib'
}
}
dependencies {
compile name: "sqljdbc4-4.0"
}
Step 4.
Right click on main Project and refresh gradle
I am not sure about your build.gradle file.
It should work.
testCompile group: 'com.microsoft.sqlserver', name: 'sqljdbc4',
version: '4.0'`
is available in maven repository.
Did you gave
repositories {
mavenCentral();
}
as the repository in your build.gradle file? If you gave this , then it should work.
If it is not working please share your full build.gradle file here, and the error trace so that we can get more idea about your question
To resolve the dependency properly you need to add the maven url where the jar is located at.
Add this under repositories:
maven { url "http://repo.spring.io/plugins-release/" }
Should look something like this (this declares multiple repositories):
repositories {
mavenCentral()
maven { url "https://repo.spring.io/milestone" }
maven { url "http://repo.spring.io/plugins-release/" }
}
Related
Where Should I paste this?
AS in docs it shows to paste this in Root-level (project-level) Gradle file (/build.gradle):
but this is showing error when I am trying to paste this.
allprojects {
repositories {
// Make sure that you have the following two repositories
google() // Google's Maven repository
mavenCentral() // Maven Central repository
}
}
Following the video given by Firebase website as I have noticed that many things have changed in Android studio so its hard for me to follow the video.
my build.gradle file has these
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "PUCabz"
include ':app'
WHere should I paste the "allprojects repositories" code
I resolved this issue by commenting out 'dependencyResolutionManagement' section which is present in the settings.gradle.
Go to Gradle Scripts -> settings.gradle -> comment out 'dependencyResolutionManagement'
//dependencyResolutionManagement {
// repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
// repositories {
// google()
// mavenCentral()
// }
//}
Then paste the all project repository in
Gradle Scripts -> build.gradle -> paste it below 'plugins' section
like this-
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
}
allprojects {
repositories {
// Make sure that you have the following two repositories
google() // Google's Maven repository
mavenCentral() // Maven Central repository
}
}
I'm very new to Gatsby and have a project bootstrapped with the gatsby-ghost-starter starter. The starter works just fine and now I'm attempting to install a theme for the blog section of the site.
I'm attempting to use gatsby-theme-blog for the blog section. I've ran npm install gatsby-theme-blog in the root of my project and configured gatsby-config to contain:
`gatsby-plugin-theme-ui`,
{
resolve: `gatsby-theme-blog`,
options: {
// basePath defaults to `/`
basePath: `/blog`,
},
},
Note: this is not my entire config file, the file is longer and I'm just showing what I added for the sake of installing this theme.
After installing the theme and configuring it in the config I ran gatsby build and got the following error:
The error is occurring in my node_modules file located at node_modules/gatsby-plugin-theme-ui/src/provider.js:1:1 and node_modules/gatsby-plugin-theme-ui/gatsby-ssr.js:1:1. I tried deleting the comment /* #jsx jsx */ on line 1 and restarting the server. When I remove that comment and restart I get the same error on line 2.
What is causing this error? This is my first time trying to install a theme within an existing project, am I forgetting something?
I have a Google App Engine project in Android Studio. In the past I have successfully deployed to my project to GAE many times. However, some project setting has changed and I can no longer deploy. I get the message:
java.lang.IllegalArgumentException: Class file is Java 8 but max supported is Java 7: javax/ws/rs/ApplicationPath.class in /Users/rob/AndroidStudioProjects/SpeedyMovingInventory/backend/build/exploded-app/WEB-INF/lib/javax.ws.rs-api-2.1-m02.jar
Unable to update app: Class file is Java 8 but max supported is Java 7: javax/ws/rs/ApplicationPath.class in /Users/rob/AndroidStudioProjects/SpeedyMovingInventory/backend/build/exploded-app/WEB-INF/lib/javax.ws.rs-api-2.1-m02.jar
Please see the logs [/var/folders/cn/3ktx4pj50hs7338v88b0sckh0000gn/T/appcfg3087406806803083082.log] for further information.
I have tried to set the source and target compatibility in my build.gradle, it is shown below:
// If you would like more information on the gradle-appengine-plugin please refer to the github page
// https://github.com/GoogleCloudPlatform/gradle-appengine-plugin
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.34'
}
}
repositories {
jcenter();
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.34'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.google.appengine:appengine-api-1.0-sdk:1.9.34'
compile 'joda-time:joda-time:2.8.2'
compile 'net.sargue:mailgun:1.0.0'
compile 'com.google.code.gson:gson:2.7'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
// Set this dependency if you want to use Hamcrest matching
testCompile 'org.hamcrest:hamcrest-library:1.1'
testCompile fileTree(include: ['*.jar'], dir: '/Users/rob/appengine-java-sdk-1.9.34/lib/impl')
testCompile fileTree(include: ['*.jar'], dir: '/Users/rob/appengine-java-sdk-1.9.34/lib/testing')
}
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
}
I have also used Android Studio to generate a sample GAE module and successfully deployed the sample to GAE. I compared the gradle files and settings and I don't see any differences. Please help, what am I doing wrong?
After lots of research, I have figured a fix. The library 'net.sargue:mailgun:1.0.0' apparently has a dependency of some sort on a java 8 lib (or something along those lines). I don't know why this hasn't caused me issues in the past, but it is now. Upgrading the lib to 'net.sargue:mailgun:1.3.2" resolves the issue.
I have had a conversation with the author of the mailgun library:
https://github.com/sargue/mailgun/issues/11
He had a dependency which were updated to Java 8, he fixed it in the new release.
My Android studio version is 1.3.1,
When I add the plugin of butterknife zelezny 1.3.2 by the step:
download it and install via Preferences → Plugins → Install plugin from disk.
but, failed to show the button of "Generate ButterKnife Injections" in the menu of generate.
what's reason of this issue? How can resolve it?
Thanks.
restart your AS
right click on R.layout.my_layout
choose generate(or click Alt+Insert)
you may see "generate Butterknife injections" item in the menu
I also faced the same .So if am correct you have not added butter knife dependencies in your gradle file.
dependencies {
compile 'com.jakewharton:butterknife:7.0.1'
}
Add this in your projecct build.gradle(Module:app)
Once you are done with you will get Generate ButterKnife Injections option on right click of layout.
as #Woi mentioned from above you can do this way.
For Windows you can do the same by following below steps.
1.right click on R.layout.my_layout in activity or fragment
2.Click generate(Alt+Inser)
3.Generate butterknife injection(Ctrl+Shift+B)
It works on 7.0.1. Not works on 8.0.1
1.works:
compile 'com.jakewharton:butterknife:7.0.1'
2.not works:
compile 'com.jakewharton:butterknife:8.0.1'
I had this same issue but restarting didn't fix it. I resolved it by adding classpath 'com.jakewharton:butterknife-gradle-plugin:8.7.0' to my gradle build file at project level so that it's buildscript section looks like
buildscript {
repositories {
google()
jcenter()
}
dependencies {
...
classpath 'com.jakewharton:butterknife-gradle-plugin:8.7.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Secondly, to see the "Generate ButterKnife Injections" in the menu, you'll need to focus the mouse cursor on the layout file and right-click on it then select "Generate".
e.g. in Fragment, View v = inflater.inflate(R.layout.fragment_create_new_order, container, false); right click on "fragment_create_new_order" and select "Generate"
My Android studio version is 3.1.2, When I add the plugin of butterknife zelezny 1.6.0 by the step: download it and install via Preferences → Plugins → Browse repositories and search for ButterKnife Zelezny.
I had this same issue.
I resolved it by adding classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1' to my gradle build file at project level so that it's buildscript section looks like:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
}
}
https://github.com/JakeWharton/butterknife README.md is uesful.
I am using Grunt in my project (Yeoman based), but when I try to build my app with the grunt build command, I have the following errors when images are loaded :
GET http://mydomain.com/dist/images/login_user.png 404 (Not Found)
I understand that they are not found after the building process because they have been minified and now they have this name :
3f59e511.login_user.png
But I can not find what to change in my bower.json file to change their name by the minified one in my app's files. Thanks for your help
UPDATE
I used the dependency below to correct a problem I had before ( see AngularJS Inject service in .run function
uglify: {
options: {
mangle: false
}
},
And I think the error could come from that but I don't know exactly why.
Actually when you build your application the dist folder will be cleaned up, and grunt then will create new files using the source files that you specified in the gruntfile. So use the grunt copy dependency to move the image to the dist folder at runtime.