Nativescript Angular compiling error "mergeDexDebug" - nativescript

I am using nativescript v6.4 and angular v8.2 and in project i have install 4-5 plugin and it work fine but after installing one more plugin i.e nativescript-firebase-plugin i got this error when compiling the project.
Execution failed for task ':app:mergeDexDebug'.
Error: null, Cannot fit requested classes in a single dex file (# methods: 132015 > 65536 ; # fields: 77460 > 65536)

Did you go through the documentation of Firebase Plugin?
Adding multiDexEnabled true to your app/App_Resources/Android/app.gradle should solve the issue

Related

Problem with url_launcher package (Flutter)

I’m working on a Flutter project. I’m starting with the counter app. If a use the following packages, I have not any problem:
cupertino_icons: ^0.1.3
flutter_markdown: ^0.3.3
google_fonts: ^0.3.9
google_maps_flutter: ^0.5.23+1
intl: ^0.16.1
provider: ^4.0.4
rive: ^0.0.1
rxdart: ^0.23.1
shared_preferences: ^0.5.6+1
But if I use the url_launcher: ^5.4.1 package, I receive this error:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':url_launcher:compileDebugAidl'.
> Could not resolve all task dependencies for configuration ':url_launcher:debugCompileClasspath'.
> Could not resolve androidx.annotation:annotation:1.1.0.
Required by:
project :url_launcher
[...]
How can I solve? Thank you!
With version 5.4.2 of the package the problem seems to be solved.

Android-studio 3.5.1 Gradle ERROR: No value has been specified for property lottie-react-native

Upgraded android studio to 3.5.1. Took fresh checkout of project and gradle sync started failing. Searched everywhere but could not find any proper solution. In logs can see error at line 97 of lottie react native android gradle-maven-push.gradle
Have tried downgrading gradle version, android studio version as well but still same error.
Gradle task defined in gradle-maven-push.gradle
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath()
.join(File.pathSeparator))
}
Got it working by changing the code to
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath()
.join(File.pathSeparator)) + configurations.implementation
}
Reference: https://github.com/airbnb/lottie-android/blob/master/lottie/build.gradle
The difference is that of configuration.implementation between what is downloaded in lottie's react native module's build.gradle and and specified in github link.

Nativescript: runtime exception on tns run

When I execute tns run android to test my code, it produces this runtime error:
Gradle build...
+ setting applicationId
+ applying user-defined configuration from C:\Users\Ace\eclipse-workspace\arenamaster\App_Resources\Android\app.gradle
+ using android X library androidx.legacy:legacy-support-v4:1.0.0
+ adding nativescript runtime package dependency: nativescript-optimized-with-inspector
Exception in thread "main" java.lang.RuntimeException: Class not found org.nativescript.widgets.image.Worker.OnImageLoadedListener
at org.nativescript.staticbindinggenerator.Generator.getClass(Generator.java:549)
at org.nativescript.staticbindinggenerator.Generator.getInterfacesFromCache(Generator.java:532)
at org.nativescript.staticbindinggenerator.Generator.writeBinding(Generator.java:283)
at org.nativescript.staticbindinggenerator.Generator.generateBinding(Generator.java:171)
at org.nativescript.staticbindinggenerator.Generator.processRows(Generator.java:234)
at org.nativescript.staticbindinggenerator.Generator.generateBindings(Generator.java:121)
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:97)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:53)
I have tried the following:
Deleting my .tns.ts files and reverting code splitting
Migrating the project to androidX
Deleting the platforms directory then running tns run android
nativescript core modules requires a package called nativescript core modules widgets
If you get this error run npm i nativescript-core-modules-widgets
Just noting that with NativeScript 7.x and higher, the answer from #ace zhang is no longer needed. All that's needed is:
"#nativescript/core": "^7.0.0"

Error when trying to run 'gradlew assembleRelease' in the Windows command line : jest-haste-map: Haste module naming collision

I am trying to generate a .apk file of my react native project with the 'gradlew assembleRelease' command. I'm using AWS Amplify, which is where the naming collision seems to be coming from. The version of react native I'm running is 0.59.9.
I've tried creating a 'rn-cli.config.js' file in the root folder and replacing the code in the 'metro.config.js' with the 'rn-cli.config.js' code, which was unsuccessful. I can't remove the problem folder either because that creates more errors.
I've also tried stopping and restarting the Gradle daemon, which hasn't worked either. This is the error I'm getting:
Configure project :app
WARNING: The specified Android SDK Build Tools version (25.0.0) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.4.0.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.0'" from your build.gradle file, as each version of the Android Gradle Plugin now has a
default version of the build tools.
Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
error jest-haste-map: Haste module naming collision:
Duplicate module name: myreactnativeapp_cfnlambda_ff57ce62
Paths: C:\Users\Kim\Desktop\myReactNativeApp\amplify\backend\interactions\reactLex\src\package.json collides with C:\Users\Kim\Desktop\myReactNativeApp\amplify#current-cloud-backend\interactions\reactLex\src\package.json
This error is caused by hasteImpl returning the same name for different files.. Run CLI with --verbose flag for more details.
Task :app:bundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
Process 'command 'cmd'' finished with non-zero exit value 1
The code in the 'rn-cli.config.js' file looks like this:
const blacklist = require('metro-config/src/defaults/blacklist');
// blacklist is a function that takes an array of regexes and combines
// them with the default blacklist to return a single regex.
module.exports = {
resolver: {
blacklistRE: blacklist([/amplify\/.*/])
}
};'
Do I need to change the code in the 'rn-cli.config.js' file or is there another workaround I could try?

nativescript-onesignal fails android build

I tried installing package nativescript-onesignal. After that, I got an error like UNMET PEER DEPENDANCY. Then I updated my modules following some posts on GitHub and StackOverflow. But, now when I try to build and run the application I got BUILD FAILED error. Unable to understand what went wrong. I followed some posts to resolve this but with no success.
Following is the error I got in the console.
tns run android
Searching for devices...
Preparing project...
Successfully prepared plugin nativescript-camera for android.
Successfully prepared plugin nativescript-carousel for android.
Successfully prepared plugin nativescript-drop-down for android.
Successfully prepared plugin nativescript-filter-select for android.
Successfully prepared plugin nativescript-geolocation for android.
Successfully prepared plugin nativescript-gradient for android.
Successfully prepared plugin nativescript-imagepicker for android.
nativescript-iqkeyboardmanager is not supported for android.
Successfully prepared plugin nativescript-iqkeyboardmanager for android.
Successfully prepared plugin nativescript-loading-indicator for android.
Successfully prepared plugin nativescript-localstorage for android.
Successfully prepared plugin nativescript-locate-address for android.
Successfully prepared plugin nativescript-numeric-keyboard for android.
Successfully prepared plugin nativescript-onesignal for android.
Successfully prepared plugin nativescript-phone for android.
Successfully prepared plugin nativescript-social-share for android.
Successfully prepared plugin nativescript-telerik-ui for android.
Successfully prepared plugin nativescript-theme-core for android.
Successfully prepared plugin nativescript-webview-interface for android.
Successfully prepared plugin tns-core-modules for android.
Successfully prepared plugin tns-i18n for android.
Successfully prepared plugin nativescript-permissions for android.
Successfully prepared plugin tns-core-modules-widgets for android.
Starting a Gradle Daemon, 2 incompatible and 2 stopped Daemons could not be reused, use --status for details
> Configuring > 0/3 projects > root project
:config phase: createDefaultIncludeFiles
> Configuring > 0/3 projects > root project
:config phase: addAarDependencies
+adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\Common-2017.1.719-dev-release.aar
+adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\Data-2017.1.719-dev-release.aar
+adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\List-2017.1.719-dev-release.aar
+adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\Primitives-2017.1.719-dev-release.aar
+adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\widgets-release.aar
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
Incremental java compilation is an incubating feature.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_2xnifqnj4smqh1ggt6ywlsjt4.run(C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\build-tools\android-static-binding-generator\build.gradle:144)
:asbg:clean UP-TO-DATE
:deleteMetadata
:deleteFlavors
:deleteConfigurations UP-TO-DATE
:deleteGeneratedBindings UP-TO-DATE
:clean
BUILD SUCCESSFUL
Total time: 30.954 secs
Project successfully prepared (Android)
Building project...
> Configuring > 0/3 projects > root project
:config phase: createDefaultIncludeFiles
+found plugins: nativescript-camera
+ creating include.gradle file for C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-camera
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-camera -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F0
+found plugins: nativescript-carousel
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-carousel -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F1
+found plugins: nativescript-geolocation
+ creating include.gradle file for C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-geolocation
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-geolocation -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F2
+found plugins: nativescript-imagepicker
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-imagepicker -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F3
+found plugins: nativescript-onesignal
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-onesignal -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F4
+found plugins: nativescript-phone
+ creating include.gradle file for C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-phone
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-phone -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F5
+found plugins: nativescript-telerik-ui
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-telerik-ui -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F6
+found plugins: nativescript-webview-interface
+ creating include.gradle file for C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-webview-interface
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\nativescript-webview-interface -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F7
+found plugins: tns-core-modules-widgets
+ creating include.gradle file for C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\tns-core-modules-widgets
Renaming plugin directory to flavor name: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\tns-core-modules-widgets -> C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F8
> Configuring > 0/3 projects > root project
:config phase: createPluginsConfigFile
Creating product flavors include.gradle file in C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android/configurations folder...
:config phase: pluginExtend
+applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\include.gradle
+applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-camera\include.gradle
+applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-carousel\include.gradle
+applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-geolocation\include.gradle
+applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-imagepicker\include.gradle
+applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-onesignal\include.gradle
+applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-phone\include.gradle
+applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-telerik-ui\include.gradle
+applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\nativescript-webview-interface\include.gradle
+applying configuration from: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\configurations\tns-core-modules-widgets\include.gradle
> Configuring > 0/3 projects > root project
:config phase: addAarDependencies
+adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\Common-2017.1.719-dev-release.aar
+adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\Data-2017.1.719-dev-release.aar
+adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\List-2017.1.719-dev-release.aar
+adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\Primitives-2017.1.719-dev-release.aar
+adding dependency: C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\libs\aar\widgets-release.aar
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
Incremental java compilation is an incubating feature.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_2xnifqnj4smqh1ggt6ywlsjt4.run(C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\build-tools\android-static-binding-generator\build.gradle:144)
:preBuild UP-TO-DATE
:preF0F1F2F3F4F5F6F7F8DebugBuild UP-TO-DATE
:checkF0F1F2F3F4F5F6F7F8DebugManifest
:preF0F1F2F3F4F5F6F7F8ReleaseBuild UP-TO-DATE
:prepareAquaappRuntimeUnspecifiedLibrary
:prepareComAndroidSupportAnimatedVectorDrawable2600Alpha1Library
:prepareComAndroidSupportAppcompatV72600Alpha1Library
:prepareComAndroidSupportDesign2600Alpha1Library
:prepareComAndroidSupportRecyclerviewV72600Alpha1Library
:prepareComAndroidSupportSupportCompat2600Alpha1Library
:prepareComAndroidSupportSupportCoreUi2600Alpha1Library
:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library
:prepareComAndroidSupportSupportFragment2600Alpha1Library
:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library
:prepareComAndroidSupportSupportV42600Alpha1Library
:prepareComAndroidSupportSupportVectorDrawable2600Alpha1Library
:prepareComAndroidSupportTransition2600Alpha1Library
:prepareComGoogleAndroidGmsPlayServicesBase1104Library
:prepareComGoogleAndroidGmsPlayServicesBasement1104Library
:prepareComGoogleAndroidGmsPlayServicesGcm1104Library
:prepareComGoogleAndroidGmsPlayServicesIid1104Library
:prepareComGoogleAndroidGmsPlayServicesLocation1104Library
:prepareComGoogleAndroidGmsPlayServicesTasks1104Library
:prepareComOnesignalOneSignal362Library
:prepareComRomandanylykPageindicatorview020Library
:prepareCommon20171719DevReleaseLibrary
:prepareData20171719DevReleaseLibrary
:prepareList20171719DevReleaseLibrary
:preparePrimitives20171719DevReleaseLibrary
:prepareWidgetsReleaseLibrary
:prepareF0F1F2F3F4F5F6F7F8DebugDependencies
:compileF0F1F2F3F4F5F6F7F8DebugAidl
:compileF0F1F2F3F4F5F6F7F8DebugRenderscript
:generateF0F1F2F3F4F5F6F7F8DebugBuildConfig
:cleanLocalAarFiles
:ensureMetadataOutDir
:collectAllJars
:setProperties
:generateTypescriptDefinitions SKIPPED
:copyTypings SKIPPED
:asbg:generateInterfaceNamesList
:asbg:traverseJsFiles
:asbg:runAstParser
Running full build
finished with reading lines with js files
:asbg:generateBindings
:generateF0F1F2F3F4F5F6F7F8DebugResValues
:generateF0F1F2F3F4F5F6F7F8DebugResources
:mergeF0F1F2F3F4F5F6F7F8DebugResources
:processF0F1F2F3F4F5F6F7F8DebugManifest
[com.onesignal:OneSignal:3.6.2] C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\build\intermediates\exploded-aar\com.onesignal\OneSignal\3.6.2\AndroidManifest.xml:52:13-48 Error:
Attribute meta-data#onesignal_app_id#value at [com.onesignal:OneSignal:3.6.2] AndroidManifest.xml:52:13-48 requires a placeholder substitution but no value for <onesignal_app_id> is provided.
[com.onesignal:OneSignal:3.6.2] C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\build\intermediates\exploded-aar\com.onesignal\OneSignal\3.6.2\AndroidManifest.xml:56:13-67 Error:
Attribute meta-data#onesignal_google_project_number#value at [com.onesignal:OneSignal:3.6.2] AndroidManifest.xml:56:13-67 requires a placeholder substitution but no value for <onesignal_google_project_number> is provided.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F0\AndroidManifest.xml Error:
Attribute meta-data#onesignal_app_id#value at AndroidManifest.xml requires a placeholder substitution but no value for <onesignal_app_id> is provided.
C:\Users\Rajdeep\Documents\aqua-app\src\platforms\android\src\F0\AndroidManifest.xml Error:
Attribute meta-data#onesignal_google_project_number#value at AndroidManifest.xml requires a placeholder substitution but no value for <onesignal_google_project_number> is provided.
> Building 67% > :processF0F1F2F3F4F5F6F7F8DebugManifest
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
:processF0F1F2F3F4F5F6F7F8DebugManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processF0F1F2F3F4F5F6F7F8DebugManifest'.
> Manifest merger failed with multiple errors, see logs
* 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: 1 mins 7.429 secs
Unable to apply changes on device: emulator-5554. Error is: Command gradlew.bat failed with exit code 1.
Please help me solve this.
Thank you..
There are two errors in your Gradle build:
Attribute meta-data#onesignal_app_id#value at [com.onesignal:OneSignal:3.6.2] AndroidManifest.xml:52:13-48 requires a placeholder substitution but no value for <onesignal_app_id> is provided.
Attribute meta-data#onesignal_google_project_number#value at AndroidManifest.xml requires a placeholder substitution but no value for <onesignal_google_project_number> is provided.
According to the onesignal documentation, you need to provide both of these in order to use the plugin - https://documentation.onesignal.com/docs/android-sdk-setup
So, you could include, in your app/App_Resources/Android/app.gradle the following:
android {
defaultConfig {
manifestPlaceholders = [onesignal_app_id: "PUT YOUR ONESIGNAL APP ID HERE",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
}
}

Resources