I want to use Air brake SDK in my project
, but while creating the jar file I am getting the error.
BUILD FAILED
/Users/standarduser/Downloads/airbrake-android-master/build.xml:30: /usr/local/android_sdk/platforms/android-7 does not exist.
In the build.xml, I tried updating the
to
but again the same error. Please help.
if you are looking to use Airbrake Bug Tracker then you can easily add in gradle file if you are using Android Studio
dependencies {
compile 'io.airbrake:airbrake-java:2.2.8'
}
Related
I'm working with my first project in Android Studio 2.2. When I try to Sync the project with the Gradle, it shows an error error: package org.hamcrest does not exist
Therefore I had downloaded the hamcrest.jar library and added manually it under myfirstproject\app\libs
But, I got the following error when I add hamcrest.jar to my project.
Could not find method compile() for arguments(file collection) on object of type org.gradle.api.internal.artifacts.DSL.dependencies.DefaultDependencyHandler
This is my build.gradle file
-
Have I missed anything during the installation of my Android Studio?
Or should I need to add any libraries to the project?
If needed how it is to be done?
You added that to the wrong gradle file. Read the comment in that file that says not to add app dependencies there
Open app/build.gradle and you should notice that you already have
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
So, which means you don't have to add anything else to compile any jar files.
You really should not use a Jar file, though.
Add this
testCompile 'org.hamcrest:hamcrest-library:1.3'
Hamcrest library is something that is automatically configured with Android Studio during the installation.
Here the error is due to the incomplete installation of Android Studio. That is, most of the important external packages haven't get downloaded during the installation (including hamcrest.jar).This happened may be due to the loss of network connection at the time of installation.
So the best solution is
Uninstall the Android Studio,
Delete all the belonged files (AndroidStudioProjects,.AndroidStudio2.2 and .android folders ). Don't forget to move your current project to any other folder.
Once again install the Android Studio by making sure that you have a good network connection.
Open your last project from where it was moved
Sync the project with Gradle.
See that everything works fine!
I have an android project here that includes local file aars in gradle via
dependencies {
compile project(':packagename_0.3')
}
I am unable to translate that to the appropriate sbt syntax so that during the build sbt is actually able to resolve the dependencies. Does anyone have an idea ? I checked scala on android but still did not manage to find a working way. Does anyone have a suggestion?
Well I ended up extracting the jars from the aars and adding them to the default unmanagedBase folder (src/main/libs).
You need to add a setting:
localAars += path_to_aar_file
I am facing an error when including Realm API in to my Android project
Please provide instructions to set it up in Android studio.
make sure you have included
compile 'io.realm:realm-android:0.80.0'
under dependencies in your build.gradle file
I am new to Android Studio. I am trying to work using the android-map-utils library. But it is giving me the following error.
`Error:(64) A problem occurred evaluating project ':library'.
> No such property: sonatypeUsername for class: org.gradle.api.internal.project.DefaultProject_Decorated`
Can anyone help me with this issue and also tell me a easy way to import libraries in android studio?
I had a similar problem while I was migrating from eclipse. I resolved my issue by using the gradle method of including the library (as opposed to importing it as a module and using it as a dependency).
Add the following dependency to your Gradle build file:
dependencies {
compile 'com.google.maps.android:android-maps-utils:0.3+'
}
source: http://googlemaps.github.io/android-maps-utils/#start
I wasn't able to comment.
Applying gradle dependency as link doesn't allow us to view it's source properly.
So if you are interested in viewing source too, in Android Studio itself
You should try adding library as a module project, i.e.,
File -> New -> Import Module -> (Dir of Library)
after importing, you'll face an error, which can be resolved from - Adding Maps Utils Module
I used libgdx to build my project and I am having issues using the JSONObject class. When I add import org.json.JSONObject, it says it cannot resolve. How do I add that library to my project?
Here is what I have tried without success:
I downloaded the json-simple-1.1.jar and put it in core/build/libs folder. Could not use import.org.json.simple.JSONObject either.
When browsing the tree in Android Studio as "Packages" dropdown, I can see the classes I want under "Core -> Libraries -> org -> json" but I cannot add them to my project. I get a "cannot refractor, class is in a jar file" error.
Is there something I have not tried yet to solve this issue? I feel I will run into this again as I try to use other external libraries.
Thank you.
If you are using LibGdx, it does not come with a Gradle setup, making multi-project builds streamlined.
You need to add implementation 'org.json:json:<version>' to the dependencies block of your top-level build.gradle.
To find the latest version, see http://mvnrepository.com/artifact/org.json/json/
For example, using the latest version at the time of writing:
dependencies {
implementation 'org.json:json:20200518'
}