Android Question [Solved] Public class android.support.v7.app not exist

angel_

Active Member
Licensed User
I try to do this


I have this line in activity and add it to the public class
B4X:
#Extends: android.support.v7.app.AppCompatActivity
And appears this error
B4X:
javac 1.8.0_201
src\com\dd\aa\m00_bb.java:9: error: package android.support.v7.app does not exist
public class m00_bb extends android.support.v7.app.AppCompatActivity implements BA.SubDelegator{
                                                             ^
 

angel_

Active Member
Licensed User
Not enough informations.
Are you using AndroidX? If so then Redownload AppCompat 4.0
This is the error
B4X:
B4A Version: 9.80
Java Version: 8
Parsing code.    (0.62s)
Building folders structure.    (0.10s)
Running custom action.    (0.05s)
Running custom action.    (0.13s)
Running custom action.    (0.05s)
Running custom action.    (0.05s)
Running custom action.    (0.05s)
Running custom action.    (0.05s)
Running custom action.    (0.05s)
Running custom action.    (0.05s)
Running custom action.    (0.05s)
Running custom action.    (0.05s)
Compiling code.    (2.91s)
Compiling layouts code.    (0.27s)
Organizing libraries.    (0.07s)
    (AndroidX SDK)
Generating R file.    (3.59s)
Compiling debugger engine code.    (7.54s)
Compiling generated Java code.    Error
javac 1.8.0_201
src\com\dd\aa\m00_bb.java:9: error: package android.support.v7.app does not exist
public class m00_bb extends android.support.v7.app.AppCompatActivity implements BA.SubDelegator{
                                                             ^
Note: src\com\dd\aa\starter.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Manifest
B4X:
SetApplicationAttribute(android:theme, "@style/MyAppTheme")

CreateResource(values, MyAppTheme.xml,
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
    </style>
</resources>
)
I'm using AppCompat 4.00
 

DonManfred

Expert
Licensed User
No.
When i want you to uncheck and recheck the library in the librarytab then i would have said it like this.

When i say ReDownload then i mean. Do the download of v4.0 again. The new download also contains a correct androidX artifact.
Use the files from the newdownload. Make sure to place all files from the download in your additional library folder.

REFRESH the librarylist after updated the files.
Clean your project and try again.
 
Last edited:

angel_

Active Member
Licensed User
I did all steps but I have the same error.

If I delete #Extends: android.support.v7.app.AppCompatActivity in the public class I don't have any problem, despite having #Extends:... in the Main.
 

angel_

Active Member
Licensed User
I have install all recommended items, maybe I have not explained myself well, the error only appears when I add that line to a public class
 

Erel

Administrator
Staff member
Licensed User
I have install all recommended items, maybe I have not explained myself well, the error only appears when I add that line to a public class
We all did it.

The problem is that you are still using an unjetified version of AppCompat. My guess is that you have an old copy in the internal libraries folder. Delete it.

Download the library again and copy it to the additional libraries folder.
 

angel_

Active Member
Licensed User
I don't know what I'm doing wrong, I have the same problem.

I have deleted the android-support-v7-appcompat file from the internal libraries, reinstalled B4A and downloaded Appcompat again and applied jetified.
 

Attachments

angel_

Active Member
Licensed User
Have you checked the internal libraries folder?
I don't see any problem, I have AppCompat in the adicional libraries, android-support-v7 file is not in the internal library (I deleted it), I've probe in other app with #Extends: android.support.v7.app.AppCompatActivity in the activities and it works well, but in this case with #Extends: android.support.v7... in the Class doesn't work
 

angel_

Active Member
Licensed User
Nobody mentioned this file.
You should delete AppCompat.xml and AppCompat.jar from the internal libraries folder.
I cannot further help here. Sorry.
Thank you for your patience, I will continue testing
 

angel_

Active Member
Licensed User
Thank you very much, it is very generous of you, I will review in depth the threads of the forum about this topic
 

f0raster0

Well-Known Member
Licensed User
I have this line in activity and add it to the public class
B4X:
#Extends: android.support.v7.app.AppCompatActivity
maybe you can not use:
#Extends: android.support.v7.app.AppCompatActivity in a public class and it should be only added in Main like you are doing
 
Last edited:

angel_

Active Member
Licensed User
Attached an example where you can see the problem, I solved it by creating an activity template which includes #Extends: android.support.v7.app.AppCompatActivity and I removed #Extends from the class, then I load each class on this template, I would like your opinions about this option
 

Attachments

Top