Android Question 14.2 beta R8 error compiling

Scantech

Well-Known Member
Licensed User
Longtime User

I enabled it and added the manifest codes.
 

Scantech

Well-Known Member
Licensed User
Longtime User
Compiling now is not easy as it used to be. Now, I have to worry about adding keep and dontwarn in manifest. thankfully, AI showed me the direction.

 
Last edited:
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
My new laptop crashed few days ago and I still have not tested it in runtime if it has issues or not. I had an old laptop from 2015 took 20 minutes to compile in R8 mode. I'm not compiling anymore with this junk laptop. It did compile ok, not sure in runtime.
Large list of libraries attached.
 

Attachments

  • libraries3.jpg
    23.1 KB · Views: 67
  • libraries2.jpg
    73.4 KB · Views: 62
  • libraries1.jpg
    77 KB · Views: 63
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
debug runtime all kinds of errors. I get the feeling this old project is stuck with D8. R8 is pain in a##.

 
Upvote 0

ilan

Expert
Licensed User
Longtime User
i think the question is which libraries are you not using

i have never seen a project with so many libraries. i try to avoid as much as i can 3rd party libraries for my projects since every time we have updates sdk or b4a with 3rd party libraries you risk to have issues. if you can avoid them even if it means to remove those features from your app, avoid them.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
R8 is pain in a##.
It will become easier as we progress. The issues you encounter are related to compiled libraries missing their rules.
1. The compiler now generates those rules during library compilation.
2. With the community help, rules for older libraries will be collected and documented.

Once you say that these rules work, I will add them to the relevant libraries pages.
 
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
Erel, thanks for showing me how to add keep class. I get the idea now. The error above is gone, but there are more to come. The app still wont start because of other missing class. I have way too many libraries and takes 5 minutes to compile R8. I'm building a keep class list for my project and will post the relevant ones not my private library which is not needed. Thanks again.
 
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
B4X:
AddProguardText(
    -dontwarn androidx.concurrent.futures.**
    -dontwarn androidx.datastore.**
    -dontwarn com.google.common.util.concurrent.internal.**
    -dontwarn kotlinx.coroutines.tasks.**
  
    -keep class flm.scrollpanel.** { *; }
    -keep class b4a.example.** { *; }
    -keep class cargauge.customlistview4.** { *; }
  
    -keep class XTEALIB.** { *; }
    -keep class de.amberhome.preferences.** { *; }
    -keep class de.amberhome.** { *; }
    -keep class njdude.custom.** { *; }
    -keep class edsmith.click.** { *; }
    -keep class com.georgieapps.backster.** { *; }
    -keep class androidx.recyclerview.** { *; }
    -keep class dudu.paint.** { *; }
    -keep class com.google.android.material.snackbar.** { *; }

)

Finally the app starts. I have tested 70 percent of its functions. As i was testing, clicking here and there i discovered more missing class error. I suggest you guys test your app 100 percent. The above code is proguard rules required on my app. First 3 Keep Class is my private library which you will not need. The rest of the keep class are for the libraries available at the forum. They are really old libraries, not all. Turns out it was not that bad after all. Have faith.
 
Last edited:
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
B4X:
    -keep class androidx.appcompat.app.** { *; }
    -keep class androidx.core.widget.** { *; }
2 more to the list. Related to old preference library (de.amberhome). It was weird adding a complete name does not work on some of them? i had to cut off few name words on these 2.

B4X:
-keep class net.xpece.android.support.widget.** { *; }
This one too
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…