kotlin problem,not able to go through this problem
Title
Question
<ul> <li>Type inference failed. Please try to specify type arguments explicitly. </li><li>Type mismatch: inferred type is kotlin.collections.ArrayList<string>? /* = java.util.ArrayList<string>? */ but (MutableCollection<out string!="">..Collection<string!>) was expected</string!></out></string></string> </li></ul>
Android-app-using-Kotlin Creating-a-Search-App 11-12 min 40-50 sec
Answers:
The source code used in this tutorial are available in the Code files link of this tutorial page. You can find the link below the video player.
Please download and open the file and check/compare the code with your code.
or
Go through the below link:
https://discuss.kotlinlang.org/t/type-mismatch-inferred-type-is-java-util-arraylist-org-example-domain-orderdetail-but-java-util-list-org-example-domain-orderdetail-was-expected/424
yes i did go through it and the problem comes again and again
languageOptions.addAll(ArrayList(fossVsLanguage.get(selectedFoss)))
this line I got the problem again
:app:compileDebugAidl
:app:compileDebugRenderscript
after step bu step I get this in the problem
Click on the File menu in the menu bar and Select Invalidate Caches/ Restart menu.
Close the project and open it again.
Please check this:
https://stackoverflow.com/questions/29766830/execution-failed-for-task-appcompiledebugaidl-aidl-is-missing
Please you can also use this line of code "languageOptions.addAll(ArrayList<String>(fossVsLanguage.get(selectedFoss)!!))" in place of this "languageOptions.addAll(ArrayList(fossVsLanguage.get(selectedFoss)))"
Login to add comment