I am trying to use Media projection API to enable screen capturing ability in my app. I am not able to call getsystemservice in Android Studio. I am getting an error on Context.MEDIA_PROJECTION_SERVICE :Must be one of the context.power_service,context.window_service error. Any suggestions to get it working?? or why am I getting this error??
It is a wrong warning and it's okay to ignore. This was fixed in a later update, as I no longer get that warning (I used to).
Either:
Update Android Studio
Update your compileSdkVersion and buildToolsVersion in your build.gradle file (Make sure you update in the SDK Manager also.)
Related
I try to learn Gesture Handling in Android and I tried this tutorial: www.techotopia.com/index.php/Implementing_Android_Custom_Gesture_Recognition_with_Android_Studio
My problem is, that I can not download Samples for SDK in my Android Studio 3.0.1 because there is just no option called like that:
So I tried this App on Appstore: https://play.google.com/store/apps/details?id=pack.GestureApp
But when I try to read the file like this:
gLibrary = GestureLibraries.fromRawResource(this, R.raw.gesture);
the gLibrary is always empty.
So I tried to find the official Gesture Builder Application here: https://developer.android.com/samples/index.html and in Android Studio: File/New/Import Sample:
as u can see, nothing there too.
I also tried to get a old (API 17) version running: https://github.com/Miserlou/Android-SDK-Samples
but I just got errors over and over again.
So lets get to my question. How to build a gesture file today with API 26/27 or how to get the old Gesture Builder (running).
I solve this problem by downloading all API 27 package
Rendering Problems
"high_quality" in attribute "breakStrategy" is not a valid integer
([N] similar errors not shown)
Tip: Try to refresh the layout.
([N] is a variable number.)
This message was produced after I restarted Android Studio, for all activities and any other design-able files (such xml/pref_XXX.xml files)!
I searched all project files (Ctrl+Shift+F) for "high_quality" and "breakStrategy" but found nothing!
The interesting note is no problem in designing! Just show this message.
Also, I tried Clean Project, Rebuild Project, Synchronize (Ctrl+Alt+Y), Synchronize app, pressing the refresh hyperlink inside the mentioned message, restarting Android Studio again, ... But no avail!
I have updated the android sdk build-tools, platfom-tools, API 25 and works.
i am looking for a working barcode-scanner plugin..
i´ve already found this one:
https://github.com/phonegap/phonegap-plugin-barcodescanner
..but unfortunately it doesn´t work with the Google API 23 (there are errors occurring by the bookmarkcolumns plugin included).. as far as i know it works with api 22 or less
so the errors ocurr in the CaptureActivity (src folder) > com.google.zxing.client.android.share
files:
AppPickerActivity.java
BookmarkPickerActivity.java
ShareActivity.java
Error: BookmarkColumns cannot be resolved or is not a field
so my question is, is there any other barcode-scanner-solution for phonegap or is there a way to fix these errors?
any help would be appreciated!
thanks!
BarCode Scanner :
Click on the below link you will find multiple numbers of barcode scanner plugin. Please add which ever shoots your API level.
Barcode Scanner plugins
I was about to work on swipe tabs and upon creating a new android application project, I set the minimum required SDK in Honeycomb (3.0), my target SDK in Kitkat (4.4) and to compile it with Jellybean (4.3). Now, the first problem I encountered was I wasn't able to create a new project. I clicked the finish button but nothing happens.
As soon as I was able to create a file, I haven't typed a code but there were already several errors saying that "R cannot be resolved to a variable" I figured out it was because of the compatibility measurements so I quickly updated my SDK. Every single possible update, I updated it. I have also read that I need to update my ADT Plugins as well so I did what Murtuza Kabul said here How to update ADT. I ran my Eclipse as admin and this is the error message I got
Error when loading the SDK
Error: Error parsing
C:\adt-bundle-windows-x86-20140702\sdk\system-images\android-22\android-wear\armeabi-v7a\devices.xml
cvc-complex-type.2.4.d: Invalid content was found starting with
element 'd:skin'. No child element is expected at this point. Error:
Error parsing
C:\adt-bundle-windows-x86-20140702\sdk\system-images\android-22\android-wear\armeabi-v7a\devices.xml
cvc-complex-type.2.4.d: Invalid content was found starting with
element 'd:skin'. No child element is expected at this point.
Would somebody please give me some guidance?
There´s a kind of problem with android wear packages for API 22, so my solution was deleting this two packages from the API 22
Now the problem is solved =)
Error: Error Parsing
C:\Android\sdk\system-images\android-22\android-wear\armeabi-v7a\devices.xml
Invalid content was found starting with element 'd:Skin'. No child
element is expected at this point.
While changing the values of a widget in properties tab, AndroidStudio keeps on throwing IndexNotReadyException. But after few minutes while retrying, the error is not occurring.
Here is the error log:
com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
at com.intellij.util.indexing.FileBasedIndexImpl.handleDumbMode(FileBasedIndexImpl.java:856)
at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:805)
at com.intellij.util.indexing.FileBasedIndexImpl.processExceptions(FileBasedIndexImpl.java:930)
at com.intellij.util.indexing.FileBasedIndexImpl.collectFileIdsContainingAllKeys(FileBasedIndexImpl.java:1190)
at com.intellij.util.indexing.FileBasedIndexImpl.processFilesContainingAllKeys(FileBasedIndexImpl.java:1018)
at com.intellij.psi.impl.search.PsiSearchHelperImpl$26.compute(PsiSearchHelperImpl.java:1096)
at com.intellij.psi.impl.search.PsiSearchHelperImpl$26.compute(PsiSearchHelperImpl.java:1093)
I've updated the AndroidStudio, to latest one. But still the error occurs. Any fix or work around?
Happens because of the background indexing processes.
When the IDE is indexing, if we try to change the values in properties tab, then IndexNotReadyException is thrown.
Wait till indexing is complete.
Hope Google fixes this in AndroidStudio's next release!
File-> Invalidate Cache and Restart
This will stop the old indexing process and start a new one.
After that wait for indexing, and let that project build.
I faced the same problem and found solution according to this, I have changed the API level 22 to 21, problem solved.
API Level for XML layout was set **Automatically Pick Best ** which was API 22
And I change this API 22 to API 21:
and the exception removed.
Hope this help. Thanks
If you have tried opening the project built in esclipse from default Open Project option from Android Studio, try Importing the project and open it.
when that happend, run gradle method,
then incremental builds are rebuild and indexing is restarted:
task _deleteIncrementals << {
def dirName = new File("${rootDir}/$project.name/build/intermediates/builds/debug/")
dirName.deleteDir()
}