So I've been searching around for days trying to figure out why I can't implement admob into my Android Studio project.
Things I've tried:
I have the google play services installed and latest Android SDKs
File->Project Structure->ads->ticking admob
--this will try to load in the dependencies, and always fails with
(Error:Could not find method dependencies() for arguments [build_23ysmkvnpvbphbg3g4deijgq4$_run_closure6#4afc19b] on org.gradle.plugins.ide.idea.model.IdeaModel_Decorated#18b40be.)
I've tried deleting the .gradle folder, restarting AS and rebuilding with the same Error.
I've tried creating a new blank LibGDX project and importing that and directly getting the admob dependencies and still the same error message.
I'm honestly not sure what I'm overlooking here.
If there's any info you feel I've left out, please let me know.
So, I'm coming from the Eclipse environment, and whenever I built a libgdx project, I've never had to go into the "advanced" settings. so messing around some more I went into the advanced settings and saw a checkbox for IDEA(generates intellij IDEA project files) which has seemed to work in getting rid of that error.
Related
I have encountered issues in my android studio regarding java classes/symbols not found, despite these classes and symbols being placed in the same directory, or under the same parent directory. I am making use of the DJI's mobile SDK for android.
Example of errors:
Cannot resolve symbol 'DJISampleApplication'
For illustration, here are 2 screenshots
First example. Clicking on "import class" causes android studio to create a brand new class instead of linking it to the existing one.
second example
However, oddly, when I go under "Build >> Make Project" , or "Run" to deploy on a real android device, the app can be installed, and there are no errors (only warnings).
Things I have tried:
Uninstalling and re-installing android studio
copying the whole project from the original files in again
Trying on another computer, which works. However, as i am only assigned this pc, i have to get this to work here as well.
Thank you in advance !
Your best bet is to invalidate caches and restart. Solves 99% of problems like this for me.
You can also try to reimport the project using the gradle tool window ...
Click the reload button here ...
About two weeks ago i started doing some small apps in Android Studio.
Im pretty new to this environment so im having this problem.
Last night i was working on my app, everything was running so i saved and turned off my pc.
Today i opened Android studio and the message:
Unable to load class 'com.google.common.base.Preconditions'.
And i dont know how to solve it , i already tried this things:
Do a clean install of Android Studio
Clean Project & Build project (Tried it but no solution)
Check "Offline mode" (It was already checked off)
Invalidate Cache/Restart (Done it but no solution)
Erase "gradle" folder from my "Android" folder, but no "Automatic" download happened when i reopened so i had to reinstall the application
Ive already saw a lot of posts from differente forums but im not getting any solution
Thanks to all
Try deleting the .gradle directories both in your home directory and in your project's directory and see if it works. I believe that, since Android Studio will be forced to re-download all the files for the current version of gradle, it might solve your problem.
So I have been using IntelliJ with Gradle perfectly fine for the past few days. I tried to create a second Gradle project in the same workspace and since, IntelliJ crashes when i open it. The start screen appears, the project opens then a few seconds later it just closes. There is a crash report that appears, which is attached.
I tried deleting the new project and just opening the old one but it made no difference. It seems to be happening permanently now. I even tried reinstalling IntelliJ but it had the same problem the moment I created a second project.
Does anyone know how to fix this? Thanks.
Log File
After having a look around and being very close to contacting support, I found a post (I cannot find where) that suggested these errors are to do with my JDK version. After following this tutorial, the problem was fixed. Hope this helps someone else with the same issues!
I tried importing the sample, but I got an error saying
"Error:(1, 0) SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable."
I then tried importing the Facebook SDK module into a blank activity. I can't seem to get it working. If not the error above, it has a strange gradle error. I spent hours trying to fix it, but no luck.
Please note that I'm very new to Android and I'm not even sure how to handle the gradle things. Any advice would be helpful.
Android studio is not very fast in my opinion. Im using Eclipse which is better i think. I never did use android studio much but lets see if this works it is used in Eclipse.
Right click on your libs. Add the facebook sdk. Right click on the facebook sdk. Then build path. Im not sure if this qill work for Android atudio since its made by the same company who made IntelliJ. JetBrains.
I am currently developing an Android app with Eclipse Indigo (including Android plugin).
Everything was fine in the beginning. Then I made some changes and saw that the debugging perspective doesn't apply any of the changes. It always loads the same outdated version.
Restarting debug-perspective doesn't help.
Cleaning the project doesn't help.
Relocating the workspace or restarting Eclipse or the computer doesn't work either.
I once could load the whole new project by completly deleting everything (including Eclipse, Android plugin etc.) and reinstalling. But this is not an option for every time I wanna try out a new method.
Funny thing: if I write some text in the EditText-fields the text will still be there when I restart the debugging.
Any ideas how I can fix this problem to get the actual project?
Solution: Create a device with snapshot deactivated.
It was on auto-activate in my version of android sdk.