4

I am using some of the Jetpack libraries and also using instantstart.

I am getting these errors:

Android resource linking failed Output: /base/build/intermediates/merged_manifests/debugFeature/processDebugFeatureManifest/merged/AndroidManifest.xml:66: error: resource bool/enable_system_alarm_service_default (aka farm.app:bool/enable_system_alarm_service_default) not found.

/base/build/intermediates/merged_manifests/debugFeature/processDebugFeatureManifest/merged/AndroidManifest.xml:71: error: resource bool/enable_system_job_service_default (aka farm.app:bool/enable_system_job_service_default) not found.

/base/build/intermediates/merged_manifests/debugFeature/processDebugFeatureManifest/merged/AndroidManifest.xml:122: error: resource bool/enable_system_alarm_service_default (aka farm.app:bool/enable_system_alarm_service_default) not found.

/base/build/intermediates/merged_manifests/debugFeature/processDebugFeatureManifest/merged/AndroidManifest.xml:137: error: resource integer/google_play_services_version (aka farm.app:integer/google_play_services_version) not found. error: failed processing manifest.

And one example of what is in the combined AndroidManifest is:

<receiver
    android:name="androidx.work.impl.background.systemalarm.ConstraintProxyUpdateReceiver"
    android:enabled="@bool/enable_system_alarm_service_default"
    android:exported="false" >
    <intent-filter>
        <action android:name="androidx.work.impl.background.systemalarm.UpdateProxies" />
    </intent-filter>
</receiver>

I looked at Error processing / merging manifest but it is different as I didn't create these values.

Should I just create a res/values for these booleans or should they be there and I missed including something.

The files that seem to be the cause are:

def work_version = "1.0.0-alpha04"

implementation "android.arch.work:work-runtime-ktx:$work_version" // use -ktx for Kotlin

// optional - Firebase JobDispatcher support implementation "android.arch.work:work-firebase:$work_version"

// optional - Test helpers androidTestImplementation "android.arch.work:work-testing:$work_version"

James Black
  • 41,583
  • 10
  • 86
  • 166

3 Answers3

5

You should also add a dependency to your app module or core module:

implementation 'androidx.work:work-runtime-ktx:2.3.4'

Once you add, then again add in your module where you need it.

Sagar Maiyad
  • 12,655
  • 9
  • 63
  • 99
1

You are definitely lacking declaration of these values. Are you trying to work on an existing project and probably are changing the API (compileSdkVersion and targetSdkVersion)?

Try compiling the project with the version it was delivered with. If the module was compiling successfully before then you may have changed the API to a lower version where these bool values are not defined.

You can do one of the two:

a) change the API back to the higher version if no compelling reason to support old library
b) remove these values if you don't need them in java source or define them by yourself

I recently ran in similar issues and hope these ideas help you - probably already solved as the question was asked two months ago. Would be interesting to hear what solved your issue.

tuxdost
  • 133
  • 1
  • 14
  • I have the same problem in my project. This error only shows up when I try to run Instrumentation Tests. The app builds and runs just fine otherwise. I am using only AndroidX versions of all libraries in my project, so I don't know what could be the problem. – harold_admin Aug 02 '19 at 07:24
1

I also had similar issue when I had dynamic feature in my code base. The solution was to include dependency of workManager for test module as well using androidTestImplementation.

androidTestImplementation androidx.work:work-runtime-ktx:<version>

I added in common gradle file and it solved the problem for me.

TheGraduateGuy
  • 1,450
  • 1
  • 13
  • 35