1. Black Friday Sale - 50% off

    B4A Standard for $29 instead of $59!
    Buy Now
    Dismiss Notice

B4A Library AppCompat - Make Material Design apps compatible with older Android versions

Discussion in 'Additional libraries, classes and official updates' started by corwin42, Dec 19, 2014.

  1. Joy Garcia

    Joy Garcia Member Licensed User

    I've tried to load this sample project "AppCompatBase.b4a"

    but when i load the Layout1 in Designer this popup message keep on the screen
    and the app won't run. what thus it mean?

    "Error building Property: SubtitleTextColor...."

    err_1.PNG
    Im using B4A 6.0 version.

    Joey
     
  2. DonManfred

    DonManfred Expert Licensed User

    You are using which version of the AppCompat library?
    V3.52 is up to date (i think)

    So; use v3.51 from the #1 of this thread.
     
  3. chompina

    chompina Member Licensed User

    After Update to 3.52


    AppCompat 3.52 + MSMaterialDrawer 0.93 combination i cannot solve.

    there is a large space between Menu icon and Logo Drawable, or Menu icon and Tittle Subtittle without Logo Drawable that cause tittle and subtitle need to be more shortened.

    how to short this space?? .. thanks

    my config.
    b4X 7.30
    targetSdkVersion 27
    path android jar 27
    Core 7.28
    Android SDK Tools 25.2.5
    Android SDK Platform-tools 27
    Android SDK Build-tools 27.0.2
    SDK Platform 27
    Android Support Repository 47
    Google Play Services 46
    Google Repository 58

    see photos
     

    Attached Files:

  4. Peter Simpson

    Peter Simpson Expert Licensed User

    Are you receiving the following error message in your apps using AppCompat and B4A 7.80+

    Error below copied from another users post.
    Code:
    Compiling generated Java code. Error
    javac 
    1.8.0_131
    src\bz\sef\TagItNotes\main.java:
    17: error: cannot find symbol
    public class main extends android.support.v7.app.ActionBarActivity implements B4AActivity{
    ^
    Well if you are you should swap the original line below
    Code:
    #Extends: android.support.v7.app.ActionBarActivity
    With this line
    Code:
    #Extends: android.support.v7.app.AppCompatActivity
    @corwin42 very first post quotes the following line.
    Enjoy...
     
    Last edited: Dec 16, 2017
    lemonisdead, johndb and jimmyF like this.
  5. eSolution

    eSolution Member Licensed User

    I have a different error in my project now:

    "
    Compiling generated Java code. Error
    src\com\myapp\details.java:17: error: cannot find symbol
    public class details extends android.support.v7.AppCompatActivity implements B4AActivity{
    ^
    symbol: class AppCompatActivity
    location: package android.support.v7
    Note: src\com\myapp\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.
    Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
    1 error

    javac 9.0.1

    "
     
    Last edited: Dec 31, 2017
  6. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this.
     
    Peter Simpson likes this.
  7. LucaMs

    LucaMs Expert Licensed User

    Toolbar NumberOfViews function bug.
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    I've added the AndroidX aar file to AppCompatLib4_00.zip.
    This is the file that is generated when running the jetifier tool.
     
    fredo, Myr0n, scsjc and 1 other person like this.
  9. kiki78

    kiki78 Active Member Licensed User

    I use this library with success on an old project and now I Receive error when loading layout.
    I create simplest app to understand and receive same error.
    Just for information I had completely reinstall my computer due to disk crash so I reinstall all newer version.
    I use BA4 9.30, AppCompat 4.00, Java SDK 1.8.0.221, android.jar 29.

    Error Log :

    Logger connecté à : SHi9AirQ64G18123977
    --------- beginning of crash
    --------- beginning of system
    --------- beginning of main
    Copying updated assets files (1)
    *** Service (starter) Create ***
    ** Service (starter) Start **
    ** Activity (main) Create, isFirst = true **
    Error occurred on line: 30 (Main)
    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at b4a.example.main._activity_create(main.java:382)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at b4a.example.main.afterFirstLayout(main.java:104)
    at b4a.example.main.access$000(main.java:17)
    at b4a.example.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:869)
    at android.os.Handler.dispatchMessage(Handler.java:101)
    at android.os.Looper.loop(Looper.java:206)
    at android.app.ActivityThread.main(ActivityThread.java:6735)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:845)
    Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    ... 18 more
    Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/widget/Toolbar;
    at java.lang.Class.classForName(Native Method)
    at java.lang.Class.forName(Class.java:453)
    at java.lang.Class.forName(Class.java:378)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:384)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:453)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:148)
    ... 18 more
    Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.Toolbar" on path: DexPathList[[zip file "/data/app/b4a.example-fsUbHewj_xTWg6JkfkajsQ==/base.apk"],nativeLibraryDirectories=[/data/app/b4a.example-fsUbHewj_xTWg6JkfkajsQ==/lib/arm64, /system/lib64, /vendor/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 24 more
    ** Activity (main) Resume **

    I also try AppCompatWithDynamicMenuAndBadge from https://www.b4x.com/android/forum/threads/appcompat-with-toolbar-minimal-example.79896/ and obtain same error.

    May you help me ?
     

    Attached Files:

  10. kelevra1602

    kelevra1602 Member Licensed User

    Hello, you must declare the subject of your request without the action bar

    you must change in your manifest:
    Code:
    SetApplicationAttribute(android:theme, "@style/Theme.AppCompat")
    for:

    Code:
    SetApplicationAttribute(android:theme, "@style/Theme.AppCompat.NoActionBar")
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    Download v4.00 again. It includes the jetified file which is required for AndroidX SDK. You can also create it yourself by running the jetifier tool. Make sure that the library is in the additional libraries folder and not in the internal one.
     
  12. kiki78

    kiki78 Active Member Licensed User

    Thank you both, this solve my problem :)

    Regards,
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice