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"?>
    <manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="dark.shadow"
    android:versionCode="12"
    android:versionName="secondTime"
    android:installLocation="internalOnly">

    <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"/>
    <application
    android:icon="@drawable/icon"
    android:label="DarkSide"
    android:theme="@android:style/Theme.DeviceDefault.Light">

    <meta-data android:name="com.google.android.wearable.beta.app"
    android:resource="@xml/wearable_app_desc"/>
    <activity
    android:windowSoftInputMode="stateHidden"
    android:launchMode="singleTop"
    android:name=".main"
    android:label="DarkSide"
    android:screenOrientation="unspecified">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

    </activity>
    <service android:name=".starter">
    </service>
    <receiver android:name=".starter$starter_BR">
    </receiver>
    </application>
    </manifest>

    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.
     
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