IndexNotReadyException - Android Studio - android

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()
}

Related

Here SDK Flutter 3.0

Im Using Here SDK for Flutter. Now with the Flutter 3.0 update it broke.
I tried to change the null aware operators inside that package and the
plugins/here_sdk/lib/src/sdk/mapview/here_map.dart
---> No more errors.
inside
plugins/here_sdk/android/src/main/kotlin/com/here/mapview/MapController.kt
line 52
plugin.registrar!!.activity().application.registerActivityLifecycleCallbacks(this)
changed to:
plugin.registrar!!.activity()!.application.registerActivityLifecycleCallbacks(this)
line 114:
plugin.registrar!!.activity().application.unregisterActivityLifecycleCallbacks(this)
changed to :
plugin.registrar!!.activity()!.application.unregisterActivityLifecycleCallbacks(this)
Now the maps Builds but is in some kind of between state. There is no error and the map is not controllable.
---> Rest of my UI doesn't build.
Should i wait for the Offical update or stay with Flutter 2.10.5 ?
As told in comment the we are not supporting the Flutter 3.
Please check the minimum-requirements for the HERE SDK flutter.
since 4.12.7 you actually do. Forgot to answer.
https://developer.here.com/documentation/flutter-sdk-navigate/4.12.7.0/dev_guide/topics/about.html

java.lang.NullPointerException when dataBinding enabled = true

Whenever I enable this in my app gradle
dataBinding {
enabled = true
}
and then sync -> It completely succeed.
but when I "run" it, It builds fail and shows this error
java.lang.NullPointerException
at android.databinding.tool.store.LayoutFileParser.parseOriginalXml(LayoutFileParser.java:135)
at android.databinding.tool.store.LayoutFileParser.parseXml(LayoutFileParser.java:93)
...
my app has little amount of Kotlin code, and android version is 3.5, minSdkVersion 19, targetSdkVersion 28, and upgraded to androidX
How can I solve this? which part should I search for solve this problem???
except above code, every thing works perfect.
Edit
And when I rolled back my code before upgrading to androidX and compiled it, it also shows "Null point exception" and at this time, there are no extra message without just "Null point exception".
Finally I got answer. (cc. android databinding error:Execution failed for task ':app:dataBindingProcessLayoutsDebug')
I guessed it was because of BOM. Someone said it will happen when the code is used in two different circumstances(Window and Mac).
So in 'res' folder, I clicked 'remove BOM' button in android studio and that action changed some xml files.
<?xml version="1.0" encoding="utf-8"?>
But it wasn't worked in Mac. This solution worked only in Window.
I tried a little too much but I figured it out. I created the project on the Mac computer and it wasn't a problem when I switched to windows later. When I tried to create a new file, I got this error and just understood why. Every time I right-clicked on the file I just added, I saw an option called "remove BOM". Clicking this solved my problem. But I did not find the solution to the problem logically, I just found it random.
ex: https://prnt.sc/riw6ex

Android Studio Rendering: "high_quality" in attribute "breakStrategy" is not a valid integer

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.

Context.MEDIA_PROJECTION_SERVICE error while using MediaProjectionManager

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.)

android lint still give "Call requires API ..." error after I put check there

I have the following code:
if(android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1){
enter_pos.callOnClick();
}
But I still get error from Lint:
Call requires API level 15 (current min is 12): android.widget.Button#callOnClick
Why Lint is still giving error even after I put a check for the API version? I am using
Android Developer Tools
Build: v22.0.5-757759
Under Windows 8. Thanks in advance for any suggestions!
You should put #SuppressLint("NewApi") above the method you are using this. Lint cannot decide if you do your check right by looking at your code
In your eclipse Window -> preferences -> Android -> Lint error checking uncheck the two check boxes and apply changes and then clean the project.

Categories

Resources