70 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			ReStructuredText
		
	
	
	
			
		
		
	
	
			70 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			ReStructuredText
		
	
	
	
| ===================
 | |
| Flutter Plugin Bugs
 | |
| ===================
 | |
| 
 | |
| 
 | |
| .aar android library issues fsck'n flutter
 | |
| ------------------------------------------
 | |
| 
 | |
| Flutter has a lot of cascading gradle build files and they are using black magic to get things workings. For example
 | |
| it is difficult to code for the flutter plugin because of all the gradle build depedencies. You cannot use another
 | |
| gradle file in the android project that is part of the plugin. So either add the library in ./libs or add it to Maven...
 | |
| either Maven local or Maven remote.
 | |
| 
 | |
| mavenLocal(): 
 | |
|   * ISSUES: with using gradle to add the nextcrypto library "wolfssl-jni.aar"
 | |
|     - FIX:  use ./libs/ locally pulled in by "implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])"
 | |
|     - FIX:  use mavenLocal() and store in ~.m2/...    pull using "implementation 'io.malloc.ccc:nc-jni:1.1@aar'"
 | |
| 
 | |
|   * Solution
 | |
|     - https://stackoverflow.com/questions/50971022/how-to-use-local-aar-inside-flutter-plugin
 | |
| 
 | |
|   * No solutions
 | |
|     - https://stackoverflow.com/questions/55475576/add-plain-android-library-to-a-flutter-plugin
 | |
|     - https://stackoverflow.com/questions/55005818/how-do-i-add-library-module-dependency-to-a-flutter-plugins-android-folder-corr
 | |
| 
 | |
|   * for examples see
 | |
|     - -->  dev_maven.rst
 | |
|     - -->  build_mavenLocal.gradle
 | |
| 
 | |
| 
 | |
| 
 | |
| .aar library bugs after ./libs and mavenLocal()
 | |
| -----------------------------------------------
 | |
| 
 | |
| It is interesting that it "merges" the AndroidManifest.xml files. I did some reading and I discovered 
 | |
| that all the resources within the library (.aar) are public. Therefore collisions will happen. So the 
 | |
| string property of "@string/app_name" was colliding because it was defined twice. So after removing all
 | |
| resources (./src/main/res/..) from the library project ("wolfssl-jni"), then removed all stuff within the 
 | |
| libraries AndroidManifest.xml file too...because of the merging. So with all resources removed and the 
 | |
| AndroidManifest.xml cleaned...there will be no collisions.
 | |
| 
 | |
| ::
 | |
| 
 | |
|   > Task :app:processDebugManifest FAILED
 | |
|   /Volumes/malloc-dev/nextcrypto/source/nc-ww/app/ccc_fplugin/example/android/app/src/debug/AndroidManifest.xml:11:9-44 Error:
 | |
|     Attribute application@label value=(ccc_fplugin_example) from AndroidManifest.xml:11:9-44
 | |
|     is also present at [wolfssl-jni.aar] AndroidManifest.xml:13:9-41 value=(@string/app_name).
 | |
|     Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:9:5-32:19 to override.
 | |
|   /Volumes/malloc-dev/nextcrypto/source/nc-ww/app/ccc_fplugin/example/android/app/src/debug/AndroidManifest.xml Error:
 | |
|     uses-sdk:minSdkVersion 16 cannot be smaller than version 23 declared in library [wolfssl-jni.aar] /Users/j3g/.gradle/caches/transforms-2/files-2.1/d60f1db6c5cf298a03f176d7f25dc8f6/AndroidManifest.xml as the library might be using APIs not available in 16
 | |
|     Suggestion: use a compatible library with a minSdk of at most 16,
 | |
|       or increase this project's minSdk version to at least 23,
 | |
|       or use tools:overrideLibrary="io.malloc.ccc" to force usage (may lead to runtime failures)
 | |
| 
 | |
|   See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
 | |
| 
 | |
|   10 actionable tasks: 1 executed, 9 up-to-date
 | |
|   ERROR: Manifest merger failed with multiple errors, see logs
 | |
| 
 | |
|   WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
 | |
|   It will be removed at the end of 2019.
 | |
|   For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
 | |
|   To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
 | |
|   Affected Modules: app
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 |