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

angel_

Well-Known Member
Licensed User
Longtime 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_

Well-Known Member
Licensed User
Longtime 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
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime 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:
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime 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.
 
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime 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
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime 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.
 
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime 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

  • Captura.JPG
    33.4 KB · Views: 410
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime 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
 
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime 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
 
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime User
Thank you very much, it is very generous of you, I will review in depth the threads of the forum about this topic
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime 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:
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime 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

  • ejemplo.zip
    15.9 KB · Views: 387
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…