I decided to add a App Widget to my application , I follow this guide on official Android developer page (link). Done everything what they have there and still I get this error:
I have my app-widget provider in /res/xml. Having widget layout in /layout folder and having AppWidgetProvider.java in Java folder.
So everything should be fine. Also I am using latest Android Studio with latest SDK (23) and latest build tools (23.0.2) and also using appcompat-v7 suppport library.
I pasted code from the page, just to be sure everything is in order. Seems like it's not.
I am frustrated after several hours of trying everything. My appplication is long term project, I am almost at the code version 200, so I have some experience, but not with this. I also read almost the whole thing.
PS: Any code would be useless to post in here, since it's the same code from that official Android Developer page. I wanted to do "prototype", which I can then customize to my needs. I never worked with widgets.
Related
I have a problem running my project on Android Studio. I am working on an Android project that has a native Java library inside it. It was running fine all the time. But suddenly when I open Android Studio, I find this error:
There is also an error in the .gradle of the project:
It says that URI is not registered.
When Android Studio is started, I find this message:
It seems that there is something wrong in Java configuration, but I can't find out what is the problem?
It was running fine all the time
Not on Android, it wasn't.
It seems that there is something wrong in Java configuration
No. You are using classes that are not part of the Android SDK.
The java Swing and AWT API are not part of the Android SDK and thus aren't including with it. You must find an Android equivalent image library to use in your app. There are few good ones around just depends on what functionality you need to have available to you in you app. Try searching Picasso and or Volley. Picasso is very popular and well known. it has a lot of feature including networking functionality for loading images from the web. The Volley library isn't an image library but an networking library that contains some predefined classes for loading images over the internet.
So this just happened to me. I'm not 100% on the details of how I got it working again, but its roughly this (on my Mac):
Quit Android Studio
I went to ~/Library/Application%20Support/ and deleted the AndroidStudio3.2 directory
I relaunched Android Studio and I got some warning dialog about plugins not existing.
Chose the button that is something about reinstalling or fixing (or whatever isn't deleting or ignoring)
Another dialog comes up. There are a bunch of plugins that are in red. Deselect all the red ones. Then reselect all those ones that were previously red.
Android Studio asks you something and if you want to restart Android Studio. Pick the thing that includes restarting.
And once Android Studio restarts, chose to rebuild your project, and then it worked.
Good Luck and I hope this works for you too.
I am trying to get time from an Internet Time Server. And I found that android.net.SntpClient is a good solution that I could use.
But my Android SDK (Android API 19) does not contain that class. I downloaded the "Sources for Android SDK" via SDK Manager and the source code contains the SntpClient.java (source file for class android.net.SntpClient)
Please view the images links I uploaded. (sorry, I dont have enough reputation for images right here)
The android SDK:
https://scontent-a-sea.xx.fbcdn.net/hphotos-xpa1/v/t1.0-9/s720x720/1888504_897281990284152_2310291065247680835_n.jpg?oh=989c5f49848a8914d77bb0d4aac8897d&oe=54F8E9D6
The sources:
https://scontent-a-sea.xx.fbcdn.net/hphotos-xpa1/v/t1.0-9/s720x720/10659310_897281993617485_1823842706987095742_n.jpg?oh=27ee6a075967731dc7265352c22002cd&oe=54DCBB73
Could anyone tell me why this file is not compiled? If I want to use this class, I have to explain to my boss why android SDK doesn't contain it.
Thanks a lot
Google has chosen not to make all public classes available as part of the SDK. Visibility is controlled by the #hide comment tag as described here.
I'm not sure why they chose to hide SntpClient particularly, but provided you respect the terms of the Apache license you can copy the source into your application without much modification.
I am really sorry to ask such a bland and stupid question, but I am having the greatest of frustrations with trying to load the Google Maps project library into my project resources.
I have downloaded all the tools and necessities needed from the SDK to get Google Maps.
However, whenever I try to load the Google Maps library, I get 2 errors.
The first is that for some reason,
the Class known as FragmentActivity is missing. I have no idea what
it is or where to find it to get things going with an Android project.
The second distinct problem is that the console shoots off the following message:
"google_maps] Unable to resolve target 'android-16'"
Although I have a fairly strong idea of what this means, I don't quite know how to troubleshoot so that the library is built towards the desired API level.
I do apologize as I am new to Android and absolutely love the platform, but this one really has me dumbfounded. Any and all information and suggestions is always most appreciated.
Thanks and once again, sorry for asking something so silly.
Well for the first question:
FragmentActivity is part of the google-support-v4 library and designed for application that are developed to SDK < 11 for supporting fragments. So you didn't added the referencing of this library to you project.
you can get a better idea of the imports you need to make and how to make them by reading this
blog post I wrote on Google Map API V2:
Google Map API V2 guide
about your second question, you probably trying to run this project against an API level you didn't downloaded from the SDK Manager, you have two options:
downloaded the needed API package from the SDK Manager.
right click on your project -> Properties -> Android -> change the project build target to a target that you have its API level downloaded.
Try this answer, Generate Google Map key for android - step by step.
Or take a look to this very helpful step by step tutorial. I struggle for 3 days with the maps stuff, but that tutorial showed me the light.
I'm doing a REALLY simple app, a basic hello world to test AndEngine and I am currently having some problems when running it:
I set my emulator properties as RealMayo suggests in his videos and it should work but I get this error instead
07-23 13:10:23.014: E/AndroidRuntime(1485): java.lang.IllegalArgumentException: No EGLConfig found!
Anyone has encountered the same situation, or may know how to solve it?
I am almost tempted to not us AndEngine at all... as a simple app has been really difficult to run.
NOTE: I have found some posts but they are at least 3 months old and the use of emulators has been fixed not long ago.
Anyways Thank you! :)
make sure your AVD is at least Android version 4.0.3
see this thread http://www.andengine.org/forums/gles2/api-level-t8230.html
just to add a small addition to the answer above (answer #1): make sure along creating an AVD with API level 15 (Android 4.0.3), that imported AndEngine library's project target is also built with Android 4.0.3. To validate: right click on AndEngine library in eclipse project, choose "properties", in the left pane of opened window click on "Android" label; in right pane verify that "Android 4.0.3" checkbox is checked. If "Android 4.0.3" option is not listed there, just import it with Android SDK Manager.
The comment from Ravikumar11 about GPU helped me get this resolved.
Additionally, I had to:
Update the SDK with all options for my current API (17) and the general tools (binary downloads that are not API-specific)
As eclipse suggests after SDK update, run Check for Updates in eclipse and a bunch of stuff gets loaded subsequently
From there, I was able to run my AndEngine app in the emulator
i'm adding facebook post button to my app (phonegap 1.0), it seems that the only method to have this working is using the plugin here:
https://github.com/jos3000/phonegap-plugins/tree/master/Android/Facebook
But it's not working for me, first i saw in the log PluginManager not found, reading the docs it seems plugins are not being loaded like that anymore.
But the intent and dialog of facebook appear when calling
window.plugins.facebook.authorize(appID, function(res){...})
I can see the facebook page being loaded but just after it finished the page automatically goes back with no response.
Anyboy has used succesfully this plugin??. actually the whole phonegap-plugin system seems to be very buggy... but i can't change the framework right now all the rest of the app is working.
At the end i managed to have it working by changing the Facebook authentication option in the java file, not using single sign on.
By the way i do NOT recommend phonegap... it seems to me the library is still full of bugs
I've only ever had very minor issues working with PhoneGap and iOS. Most we were able to find quick workarounds to resolve.
The issue is Android itself. I'm trying to avoid supporting it until Google steps in and enforces standards on every phone device manufacturer. Otherwise, you're guaranteeing yourself a swiss cheese codebase to deal with workarounds on every single device out there.