Android Question B4A 8.5 compile error

Discussion in 'Android Questions' started by Raywingit, Oct 4, 2018.

  1. Raywingit

    Raywingit Member Licensed User

    Here is the log:
    B4A Version: 8.50
    Parsing code. (0.12s)
    Building folders structure. (0.03s)
    Running custom action. (0.23s)
    Running custom action. (0.06s)
    Compiling code. (0.18s)
    Compiling layouts code. (0.05s)
    Organizing libraries. (0.66s)
    Running custom action. (0.06s)
    Running custom action. (0.06s)
    Generating R file. Error
    AndroidManifest.xml:18: error: Error: No resource found that matches the given name (at 'resource' with value '@xml/wearable_app_desc').

    Now what's happening, is I have a Wear App, which has an XML/ Manifest file (wearable_app_desc) and a raw/ .APK sitting in the objects/res folder, which both get blown away during the compile process. This was working OK before July 2018. Sometime between July and end of September I updated Android Studio, and also switched to B4A 8.5. The Android Manifest XML reads:

    <?xml version="1.0" encoding="utf-8"?>

    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="26"/>
    <uses-feature android:name="android.hardware.location.gps"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

    <meta-data android:name=""
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />

    <service android:name=".starter">
    <receiver android:name=".starter$starter_BR">

    This is now broken on 3 previous app revisions. How is the compiler deciding to delete the files, before needing them? How do I prevent that?
  2. Raywingit

    Raywingit Member Licensed User

    It appears to be an issue with version 8.5 Going back to 8.3 solves it.
    A possible clue is the "custom actions" which occur just before the error are:

    #CustomBuildAction: 1, c:\windows\system32\cmd.exe, /c "attrib +R" res\xml\wearable_app_desc.xml
    #CustomBuildAction: 1, c:\windows\system32\cmd.exe, /c "attrib +R" res\raw\dswearable.apk

    #CustomBuildAction: 2, c:\windows\system32\cmd.exe, /c "attrib -R" res\xml\wearable_app_desc.xml
    #CustomBuildAction: 2, c:\windows\system32\cmd.exe, /c "attrib -R" res\raw\dswearable.apk
  3. Erel

    Erel Administrator Staff Member Licensed User

    Would be simpler to use #AdditionalRes and add another folder for the resource files. The compiler will never delete those files.
  4. Raywingit

    Raywingit Member Licensed User

    In mid 2016 this code was somehow borrowed from a Canal Run project while we were trying to get Wear apps functional. It's still a convoluted process involving bait-and-switch tactics. Thanks for your reply, I will investigate when I get time.
  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