Android Question My R8 test results

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all.

I just tried to test it - here is a result

I believe the reason is a SQL Cipher lib adjusted for 16KB.
What else am I missing?
Please see the attached list of libs that I'm using, compilation results and a manifest_auto.proguard file.

Thank you.
 

Attachments

  • screen.png
    screen.png
    139.6 KB · Views: 94
  • manifest_auto.proguard
    manifest_auto.proguard
    1.8 KB · Views: 67
  • R8 compilation.txt
    R8 compilation.txt
    15.3 KB · Views: 75
I updated the Core.proguard file in internal libraries folder - please see the attached compilation result.
And this is my manifest

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="36"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:usesCleartextTraffic, "true")
SetApplicationAttribute(android:allowBackup, "false")
'Non-SSL permission
CreateResourceFromFile(Macro, Core.NetworkClearText)
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.

'AddPermission (android.permission.WRITE_EXTERNAL_STORAGE)
'AddPermission (android.permission.READ_EXTERNAL_STORAGE)

'    FusedLocationProvider:

'    required manifest entry required for Google Play Services
'AddApplicationText(<meta-data
'    android:name="com.google.android.gms.version"
'    android:value="@integer/google_play_services_version" />)
SetActivityAttribute(MessageDetails, android:windowSoftInputMode, adjustPan|stateHidden)
'Firebase
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)

AddPermission(com.google.android.gms.permission.AD_ID)

AddProguardText(
-dontwarn **.annotation.**
)

Thank you.
 

Attachments

Upvote 0
The manifest changes with AI did the trick - it compiles without error. I adjusted timeout time to 600 secs.

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="36"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:usesCleartextTraffic, "true")
SetApplicationAttribute(android:allowBackup, "false")
'Non-SSL permission
CreateResourceFromFile(Macro, Core.NetworkClearText)
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.

'AddPermission (android.permission.WRITE_EXTERNAL_STORAGE)
'AddPermission (android.permission.READ_EXTERNAL_STORAGE)

'    FusedLocationProvider:

'    required manifest entry required for Google Play Services
'AddApplicationText(<meta-data
'    android:name="com.google.android.gms.version"
'    android:value="@integer/google_play_services_version" />)
SetActivityAttribute(MessageDetails, android:windowSoftInputMode, adjustPan|stateHidden)
'Firebase
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)

AddPermission(com.google.android.gms.permission.AD_ID)

'SetApplicationAttribute(android:theme, "@style/LightTheme")
'CreateResource(values-v20, theme.xml,
'<resources>
'    <style
'        name="LightTheme" parent="@android:style/Theme.Material.Light">
'       <item name="android:actionMenuTextAppearance">@style/LowerCaseMenu</item>
'        <item name="android:windowLightStatusBar">true</item>
'        <item name="android:windowLightNavigationBar">true</item>
'    </style>
'     <style name="LowerCaseMenu" parent="android:TextAppearance.Material.Widget.ActionBar.Menu">
'        <item name="android:textAllCaps">false</item>
'    </style>
'</resources>
')
'CreateResource(values-v14, theme.xml,
'<resources>
'    <style
'        name="LightTheme" parent="@android:style/Theme.Holo.Light">
'    </style>
'</resources>
')
'
'AddProguardText(
'-dontwarn **.annotation.**
')


AddProguardText(
-dontwarn **.annotation.**
    -dontwarn androidx.work.**
    -dontwarn androidx.room.**
    -dontwarn androidx.concurrent.futures.**
    -dontwarn androidx.lifecycle.**
)
 
Upvote 0
This one will not be needed with the next beta / update, as it is included in the "core rules":
-dontwarn **.annotation.**

For the others it is better to add the missing dependencies. Something like:
Code:
#AdditionalJar: androidx.room:room-runtime
#AdditionalJar: androidx.room:room-common
#AdditionalJar: androidx.concurrent:concurrent-futures
#AdditionalJar: androidx.concurrent:concurrent-futures-ktx
#AdditionalJar: androidx.arch.core:core-runtime
 
Upvote 0
This one will not be needed with the next beta / update, as it is included in the "core rules":
-dontwarn **.annotation.**

For the others it is better to add the missing dependencies. Something like:
Code:
#AdditionalJar: androidx.room:room-runtime
#AdditionalJar: androidx.room:room-common
#AdditionalJar: androidx.concurrent:concurrent-futures
#AdditionalJar: androidx.concurrent:concurrent-futures-ktx
#AdditionalJar: androidx.arch.core:core-runtime
I got this error when I added these additional jars


B4X:
B4A Version: 14.20 BETA #1
Parsing code.    (0.90s)
    Java Version: 19
Building folders structure.    (0.01s)
Compiling code.    (1.62s)
Compiling layouts code.    (0.09s)
Organizing libraries.    Error
Maven artifact not found: androidx.room/room-common-jvm
Source: androidx.room:room-runtime


Tip: press Ctrl + R to export IDE state for AI assistants.

and this is my manifest
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="36"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:usesCleartextTraffic, "true")
SetApplicationAttribute(android:allowBackup, "false")
'Non-SSL permission
CreateResourceFromFile(Macro, Core.NetworkClearText)
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.

SetActivityAttribute(MessageDetails, android:windowSoftInputMode, adjustPan|stateHidden)
'Firebase
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)

AddPermission(com.google.android.gms.permission.AD_ID)


'AddProguardText(
'-dontwarn **.annotation.**
'    -dontwarn androidx.work.**
'    -dontwarn androidx.room.**
'    -dontwarn androidx.concurrent.futures.**
'    -dontwarn androidx.lifecycle.**
')

Code:
#Region  Project Attributes
    #ApplicationLabel: HCMS-EVV
    #VersionCode: 377   
    #VersionName: 3.77
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: portrait   
    #CanInstallToExternalStorage: False
    #BridgeLogger: True
    #AdditionalJar: com.android.support:support-v4
    #AdditionalJar: com.google.android.gms:play-services-location
    #AdditionalJar: com.google.firebase:firebase-crashlytics

'For the new version   
#AdditionalJar: com.google.android.datatransport:transport-runtime
#AdditionalJar: com.google.android.datatransport:transport-backend-cct
#AdditionalJar: androidx.concurrent:concurrent-futures   
    
    #IgnoreWarnings: 32
    #MultiDex: true
    
    #AdditionalJar: android-pdf-viewer.aar
    #AdditionalJar: Pdfium.aar
    
    #AdditionalJar: sqlite-2.4.0.aar
    '16KB
    'init string - sql1.Initialize(xui.DefaultFolder,DBName,True,DBPassword)
    #AdditionalJar: sqlcipher-android-4.10.0.aar
    
    'Alex 08/10/2026
    #EdgeToEdgeOldDevices: True

#AdditionalJar: androidx.room:room-runtime
#AdditionalJar: androidx.room:room-common
#AdditionalJar: androidx.concurrent:concurrent-futures
#AdditionalJar: androidx.concurrent:concurrent-futures-ktx
#AdditionalJar: androidx.arch.core:core-runtime
    
    
    #R8Optimizer: True
#End Region
 
Upvote 0
Maven artifact not found: androidx.room/room-common-jvm
Try install from Sdk Manager.

#AdditionalJar: androidx.room:room-runtime
#AdditionalJar: androidx.room:room-common
#AdditionalJar: androidx.concurrent:concurrent-futures
There is an app I need to add these lines but after compile successfully and I commented out it still compiles.
B4X:
'#AdditionalJar: androidx.work:work-runtime
'#AdditionalJar: androidx.work:work-runtime-ktx
'#AdditionalJar: androidx.startup:startup-runtime
'#AdditionalJar: androidx.room:room-runtime
'#AdditionalJar: androidx.room:room-common
'#AdditionalJar: androidx.concurrent:concurrent-futures
1790935017540.png
 
Upvote 0
Try install from Sdk Manager.


There is an app I need to add these lines but after compile successfully and I commented out it still compiles.
B4X:
'#AdditionalJar: androidx.work:work-runtime
'#AdditionalJar: androidx.work:work-runtime-ktx
'#AdditionalJar: androidx.startup:startup-runtime
'#AdditionalJar: androidx.room:room-runtime
'#AdditionalJar: androidx.room:room-common
'#AdditionalJar: androidx.concurrent:concurrent-futures
View attachment 173866
What exactly should I download from the SDK manager?

I tried to search for room-common and it says that my installed version is 2.7.2 and the current version that is under All group is 2.8.5. Do I need to update it?


And why it's not of the part of the IDE?

Thank you.
 
Upvote 0
What exactly should I download from the SDK manager?

I tried to search for room-common and it says that my installed version is 2.7.2 and the current version that is under All group is 2.8.5. Do I need to update it?
Yes, search and check the box for "room-common-jvm" then install it. I have a screenshot showing that on the post I linked.
 
Upvote 0
I commented these lines
B4X:
#AdditionalJar: androidx.room:room-runtime
#AdditionalJar: androidx.room:room-common
#AdditionalJar: androidx.concurrent:concurrent-futures
#AdditionalJar: androidx.concurrent:concurrent-futures-ktx
#AdditionalJar: androidx.arch.core:core-runtime

and instead added a rule into my manifest

B4X:
AddProguardText(
-dontwarn **.annotation.**
    -dontwarn androidx.work.**
    -dontwarn androidx.room.**
    -dontwarn androidx.concurrent.futures.**
    -dontwarn androidx.lifecycle.**
   
    -keep class net.sqlcipher.** { *; }
    -keep class androidx.sqlite.db.** { *; }

)

Compilation is Ok now.

Am I did something wrong?

Thank you.
 
Upvote 0
Back
Top