bsorrentino / cordova-broadcaster

Cordova Plugin to allow message exchange between javascript and native (and viceversa)
MIT License
113 stars 53 forks source link

Android Build Failure/Solution #35

Closed kyle9292 closed 6 years ago

kyle9292 commented 6 years ago

Yesterday, I came across this error when building my android platform in my Ionic 3 project.


:processDebugResources ERROR: In FontFamilyFont, unable to find attribute android:fontVariationSettings ERROR: In FontFamilyFont, unable to find attribute android:ttcIndex

FAILED

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':processDebugResources'. com.android.ide.common.process.ProcessException: Failed to execute aapt

Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 9.294 secs Error: cmd: Command failed with exit code 1 Error output: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. ERROR: In FontFamilyFont, unable to find attribute android:fontVariationSettings ERROR: In FontFamilyFont, unable to find attribute android:ttcIndex

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':processDebugResources'. com.android.ide.common.process.ProcessException: Failed to execute aapt

Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

[ERROR] An error occurred while running cordova build android (exit code 1).


Removing this plugin, then removing and re-adding the android platform allows me to build successfully. If I have this plugin installed it kills the build. Initially, I had plugin v2.3.0 and updating to v3.0.1 didn't help.

Via this ionic forum topic, that's had some recent activity, I tried editing this line in the plugin.xml in the node_modules and plugin directory from <framework src="com.android.support:support-v4:+" /> to <framework src="com.android.support:support-v4:26+" /> and got it to build after adding the android platform. (26 is my targetSdkVersion)

I've been using the broadcaster for iOS events for months and have had no issues building any of the platforms up to this point. I figured I'd put this here just in case anyone else has this problem and so it can be addressed in subsequent builds.

bsorrentino commented 6 years ago

Hi thanks fo feedback

I’ll verify and apply your fix asap