Cannot access android.support.v7.widget.AppCompatEditText/androidx.appcompat.widget.AppCompatEditText

80 views
Skip to first unread message

Nathan Knauss

unread,
Sep 11, 2019, 8:30:20 PM9/11/19
to App Inventor Open Source Development
I'm trying to build an extension and I had imported the 
appcompat-v7-28.0.0.jar
lib and also tried the androidX version. What appears to be happening is I'm doing
TextLayout.addView(EditText)
and it's saying at the . of in between that code, the error in the title.

Everything is done right, I did 
import android.support.v7.widget.AppCompatEditText;
and
import android.widget.EditText;

Any ideas on what's wrong?

Evan Patton

unread,
Sep 12, 2019, 10:36:14 AM9/12/19
to App Inventor Open Source Development
We don't include the AndroidX versions of libraries, so I doubt that would help the situation. appcompat is already included, so you also shouldn't need to add it in @UsesLibraries. What are the types of TextLayout and EditText in the addView code snippet?

Regards,
Evan

Nathan Knauss

unread,
Sep 12, 2019, 11:53:43 AM9/12/19
to App Inventor Open Source Development
I have:
import com.google.android.material.textfield.TextInputLayout;
import com.google.android.material.textfield.TextInputEditText;
I also have the lib for this imported... For code that you're probably asking for, I have:
TextInputLayout TIL = new TextInputLayout(context);
TextInputEditText TIET = new TextInputEditText(TextInputLayout.getContext());
/** UNGIVEABLE CODE **/
TextInputLayout.addView(TextInputEditText);


Evan Patton

unread,
Sep 12, 2019, 2:02:18 PM9/12/19
to App Inventor Open Source Development
Assuming that this is representative the actual code, I would expect the last line to be TIL.addView(TIET); rather than using the class names?

Regards,
Evan
Message has been deleted

Nathan Knauss

unread,
Sep 12, 2019, 2:51:14 PM9/12/19
to App Inventor Open Source Development
Can you shine some light on this error: 
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/material/R$style
I can't figure it out, I fixed the other error, but now it's just this

Souvik Bera

unread,
Sep 12, 2019, 3:09:01 PM9/12/19
to App Inventor Open Source Development
This error happened to me too when I tried to use CardView library. I think this issue is because of when we extract the .jar from .aar we loose some files. It works fine in companion because companion already has all the reqired library in it. (Not Sure). I'm also still looking for the solution for this error.

Nathan Knauss

unread,
Sep 12, 2019, 3:20:10 PM9/12/19
to App Inventor Open Source Development
I fixed it everyone, thanks!

Souvik Bera

unread,
Sep 12, 2019, 3:25:48 PM9/12/19
to App Inventor Open Source Development
Can you please share what was the actual problem and how you managed to fix it ?

Nathan Knauss

unread,
Sep 12, 2019, 3:27:46 PM9/12/19
to App Inventor Open Source Development
Can't say what I did, but I removed the Material Lib from Google and used a different one, my result is this... https://community.kodular.io/t/suggestion-textbox/33294/18?u=meteorcoder
Reply all
Reply to author
Forward
0 new messages