Hello Guys, please to generate build in ionic 6 cordova
Task :app:injectCrashlyticsMappingFileIdDebug FAILED
FAILURE: Build failed with an exception.
- What went wrong:
A problem was found with the configuration of task ‘:app:injectCrashlyticsMappingFileIdDebug’ (type ‘InjectMappingFileIdTask’).
-
In plugin ‘com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsPlugin’ type ‘com.google.firebase.crashlytics.buildtools.gradle.tasks.InjectMappingFileI
dTask’ field ‘resourceFile’ without corresponding getter has been annotated with @OutputFile.
Reason: Annotations on fields are only used if there’s a corresponding getter for the field.
Possible solutions:
- Add a getter for field ‘resourceFile’.
- Remove the annotations on ‘resourceFile’.
Thanks
Same problem after upgrade from Ionic 5.
> Task :app:injectCrashlyticsMappingFileIdDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:injectCrashlyticsMappingFileIdDebug' (type 'InjectMappingFileIdTask').
- In plugin 'com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsPlugin' type 'com.google.firebase.crashlytics.buildtools.gradle.tasks.InjectMappingFileIdTask' field 'resourceFile' without corresponding getter has been annotated with @OutputFile.
Reason: Annotations on fields are only used if there's a corresponding getter for the field.
Possible solutions:
1. Add a getter for field 'resourceFile'.
2. Remove the annotations on 'resourceFile'.
Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem.
I experience the same issue, Do you find any solution
I have upgraded my all packages (Check your package.json)
existing cordova-plugin-file-transfer issue, i have install from here
npm install GitHub - apache/cordova-plugin-file-transfer: Apache Cordova Plugin file-transfer
“cordova-plugin-file-transfer”: “git+https://github.com/apache/cordova-plugin-file-transfer.git”
After that you will get whitelist issue because ionic whitelist functionality added in @ionic-native/core package.
if you get issue of whitelist when generate build then go to that file and comment that line as like
I am using themeable-browser there i have comment out below line
My file location plugins/cordova-plugin-themeablebrowser/src/android/ThemeableBrowser.java
// import org.apache.cordova.Whitelist;
// shouldAllowNavigation = new Whitelist().isUrlWhiteListed(url);
** shouldAllowNavigation = true; (added)**
After that one more issue generated File package that is not creating any directory or file.
After updated your package remove node_module, package-lock.json, platforms/android and run npm install, ionic cordova platform add android@latest
Some thing about android-studio update it latest version, SDK, use jdk-11.0.16 instead of jdk-1.8
Environment Variable:
JAVA_HOME = C:\Program Files\Java\jdk-11.0.16
ANDROID_HOME = C:\Users\YourUserName\AppData\Local\Android\Sdk
ANDROID_SDK_ROOT = C:\Users\YourUserName\AppData\Local\Android\Sdk
Update in path
C:\Users\YourUserName\AppData\Local\Android\Sdk\build-tools
C:\Users\YourUserName\AppData\Local\Android\Sdk\emulator
C:\Users\YourUserName\AppData\Local\Android\Sdk\platform-tools
C:\Users\YourUserName\AppData\Local\Android\Sdk\tools
I hope it will be helpful for you.
Thanks