phongap's error:- Execution failed for task ':transformClassesWithDexForDebug' - phonegap-build

when i am trying to build my phonegap app at that time i am getting this error.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/iid/zzc;
* 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: 3.261 secs
is there anything missing? what is wrong? thanks in advance

below, solution works for me.
i checked the 'project.properties' file in android's folder.
target=android-25
android.library.reference.1=CordovaLib
cordova.system.library.1=com.google.android.gms:play-services-maps:+
cordova.system.library.2=com.google.android.gms:play-services-location:+
cordova.gradle.include.1=phonegap-plugin-push/app-push.gradle
cordova.system.library.3=com.android.support:support-v13:23+
cordova.system.library.4=com.google.android.gms:play-services-gcm:10.2+
cordova.system.library.5=me.leolin:ShortcutBadger:1.1.14#aar
cordova.gradle.include.2=card.io.cordova.mobilesdk/app-build.gradle
cordova.gradle.include.3=com.paypal.cordova.mobilesdk/app-build.gradle
cordova.system.library.6=com.google.android.gms:play-services- location:10.2+
cordova.system.library.7=com.razorpay:checkout:1.3.0
cordova.system.library.8=com.android.support:support-v4:25.+
cordova.system.library.9=com.android.support:appcompat-v7:25.+
cordova.system.library.10=com.google.android.gms:play-services-maps:+
cordova.system.library.11=com.google.android.gms:play-services-location:+
i just removed last two lines because those lines seems duplicated. and it works for me

Related

Execution failed for task ':app:processDebugResources'.1

I clearly have no clue why it shows this error. All solutions are appreciated.
What went wrong:
Execution failed for task ':app:processDebugResources'.
Android resource linking failed
Output: W/ziparchive( 9548): Unable to open 'C:\Users\admin\AppData\Local\Android\sdk\platforms\android-28\android.jar': No such file or directory
error: failed to open APK: I/O error.
Command: C:\Users\admin.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\c8dfbdcc79a1dd8c0cb75349d60f6c77\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
C:\Users\admin\AppData\Local\Android\sdk\platforms\android-28\android.jar\
--manifest\
C:\Users\gaurav\tutorial\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
C:\Users\gaurav\tutorial\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
#C:\Users\gaurav\tutorial\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
C:\Users\gaurav\tutorial\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--custom-package\
com.example.tutorial\
-0\
apk\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 22s
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://flutter.dev/docs/development/androidx-migration for more information on the problem and how to fix it.
Finished with error: Gradle task assembleDebug failed with exit code 1
Update you sdk version to 28. Edit the file build.gradle and change property compileSdkVersion up to 28.

How to fix a diagnostic error in flutter?

When I run the application gradle is failing to build
Compiler message:
file:///C:/Users/Wellick/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sticky_header-0.3.4/lib/src/widgets/sticky_header_layout_builder.dart:147:16:
Error: The argument type 'String' can't be assigned to the parameter
type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart'
('file:///C:/Users/Wellick/Documents/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to
'DiagnosticsNode'.
context: context);
^ Compiler failed on C:\Users\Wellick\Desktop\flutter\rapidinho-master\lib\main.dart
FAILURE: Build failed with an exception.
Where: Script 'C:\Users\Wellick\Documents\flutter\packages\flutter_tools\gradle\flutter.gradle'
line: 665
What went wrong: Execution failed for task ':app:compileflutterBuildDebugArm'.
Process 'command 'C:\Users\Wellick\Documents\flutter\bin\flutter.bat'' finished with
non-zero exit value 1
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 24s Finished with error: Gradle task assembleDebug
failed with exit code 1
It seems that this issue was due to the previous version 0.3.4 to be exact, the issue was reported in GitHub and the fix is to upgrade the version to 0.4.0. Currently, the latest version 0.5.0 is more stable than the previous versions.

NativeScript UI Autocomplete don't compiled

In my nativescript app, I have a problem about using nativescript ui autocomplete. I compile my mobile application to android apps. It has an error as below
<======-------> 50% CONFIGURING [3s]
<====---------> 35% EXECUTING [13s]
<======-------> 51% EXECUTING [20s]
Exception in thread "main" java.lang.ClassNotFoundException: Class: com.telerik.widget.autocomplete.ShowSuggestionListListener
at org.nativescript.staticbindinggenerator.Generator.getClass(Generator.java:776)
at org.nativescript.staticbindinggenerator.Generator.collectInterfaceMethods(Generator.java:703)
at org.nativescript.staticbindinggenerator.Generator.getPublicApi(Generator.java:227)und 0 errors. Watching for file changes.
at org.nativescript.staticbindinggenerator.Generator.writeBinding(Generator.java:342)
at org.nativescript.staticbindinggenerator.Generator.generateBinding(Generator.java:133)
at org.nativescript.staticbindinggenerator.Generator.processRows(Generator.java:172)
at org.nativescript.staticbindinggenerator.Generator.generateBindings(Generator.java:90)
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:66)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:47)
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:runSbg'.
Process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 25s
10:34:24 - Found 0 errors. Watching for file changes.
Unable to apply changes on device: 192.168.80.101:5555. Error is: Command ./gradlew failed with exit code 1.
Executing after-watch hook from /home/andre/nativescript/TigaRoda/hooks/after-watch/nativescript-dev-typescript.js
Stopping tsc watch
Executing after-watch hook from /home/andre/nativescript/TigaRoda/hooks/after-watch/nativescript-dev-webpack.js
Stopping webpack watch
delete node_modules, platforms, hooks folders and package-lock.json file
run
npm i
rebuild the project ->
tns run android
or
tns build android

How to run the Kotlin/Native win32 sample

I'm trying to run Kotlin/Native v0.3 win32 sample by following the blog at https://blog.jetbrains.com/kotlin/2017/06/kotlinnative-v0-3-is-out/
I downloaded the x86-64 Windows zip file as instructed at the end of the blog.
I run kotlin-native-windows-0.3\samples>gradlew.bat and it
downloaded something and said 'BUILD SUCCESSFUL'. (I'm not sure if
this step is necessary)
2.1 But If I run kotlin-native-windows-0.3\samples>gradlew build
in this folder, I got some failures:
C:\Users\OO\Documents\kotlin-native-windows-0.3\samples>gradlew build
:concurrent:assemble UP-TO-DATE
:concurrent:check UP-TO-DATE
:concurrent:downloadKonanCompiler
:concurrent:genMessageChannelInteropStubs UP-TO-DATE
:concurrent:compileCpp FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':concurrent:compileCpp'.
A problem occurred starting process 'command './buildCpp.sh''
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Then I run kotlin-native-windows-0.3\samples\win32>build.bat and I
got another error.
C:\Users\OO\Documents\kotlin-native-windows-0.3\samples\win32>build.bat
exception: java.lang.IllegalStateException: Could not find "win32" in [C:\Users\OO\Documents\kotlin-native-windows-0.3\samples\win32, C:\Users\OO\.konan\klib, C:\Users\OO\DOCUME~1\KOTLIN~1.3\bin\..\klib].
at org.jetbrains.kotlin.backend.konan.library.KonanLibrarySearchPathResolver.resolve(SearchPathResolver.kt:71)
at org.jetbrains.kotlin.backend.konan.KonanConfig$librariesFound$2.invoke(KonanConfig.kt:70)
at org.jetbrains.kotlin.backend.konan.KonanConfig$librariesFound$2.invoke(KonanConfig.kt:34)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:130)
at org.jetbrains.kotlin.backend.konan.KonanConfig.getLibrariesFound(KonanConfig.kt)
at org.jetbrains.kotlin.backend.konan.KonanConfig.access$getLibrariesFound$p(KonanConfig.kt:34)
at org.jetbrains.kotlin.backend.konan.KonanConfig$libraries$2.invoke(KonanConfig.kt:77)
at org.jetbrains.kotlin.backend.konan.KonanConfig$libraries$2.invoke(KonanConfig.kt:34)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:130)
at org.jetbrains.kotlin.backend.konan.KonanConfig.getLibraries$backend_native_compiler(KonanConfig.kt)
at org.jetbrains.kotlin.backend.konan.KonanConfig.loadLibMetadata(KonanConfig.kt:90)
at org.jetbrains.kotlin.backend.konan.KonanConfig.<init>(KonanConfig.kt:80)
at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:66)
at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:56)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:93)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:46)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:90)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:68)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:34)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:160)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:151)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:169)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:166)
at org.jetbrains.kotlin.backend.konan.util.UtilKt.profileIf(util.kt:33)
at org.jetbrains.kotlin.backend.konan.util.UtilKt.profile(util.kt:28)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion.main(K2Native.kt:168)
at org.jetbrains.kotlin.cli.bc.K2NativeKt.main(K2Native.kt:174)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:46)
I'm very new to Kotlin or Gradle world, I don't know if this is the way to compile the samples.
What additional packages should I install?
It can be easily solved by canceled the comments "rem call ..." in "build.bat"

Scaladocs build fails kafka

I am trying to build Apache kafka from source as explained here using gradle but I am not able to get scaladocs to build. Following is the error log for same:
== Expanded type of tree ==
ConstantType(value = Constant(kafka.utils.timer.TimerTaskList))
uncaught exception during compilation: java.io.IOException
File name too long
two errors found
:core:compileScala FAILED
:core:compileScala (Thread[Daemon worker,5,main]) completed. Took 1 mins 4.416 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':core:compileScala'.
> Compilation failed
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 13.736 secs
Stopped 1 compiler daemon(s).
Received result
CommandFailure[value=org.gradle.launcher.exec.ReportedException:org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':core:compileScala'.] from daemon DaemonInfo{pid=5656, address=[4d0d3e79-f94a-43ca-b183-792d2bfe1a95 port:55666, addresses:[/0:0:0:0:0:0:0:1%1, /127.0.0.1]], idle=false, context=DefaultDaemonContext[uid=1f1f4b55-9da9-4283-b361-8b0bfce3f208,javaHome=/usr/lib/jvm/java-7-oracle,daemonRegistryDir=/home/akshat/.gradle/daemon,pid=5656,idleTimeout=120000,daemonOpts=-XX:MaxPermSize=512m,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=IN,-Duser.language=en,-Duser.variant]}.
Though I suspect it is a memory issue but I do not see any place of altering it. I tried editing here:
tasks.withType(ScalaCompile) {
scalaCompileOptions.useAnt = false
configure(scalaCompileOptions.forkOptions) {
memoryMaximumSize = '1g'
jvmArgs = ['-XX:MaxPermSize=512m']
}
}
}
But it did not help.
Yes this is probably related to Gradle memory settings. You can increase the Gradle heap by setting the environment variable: set GRADLE_OPTS=-Xmx1024m (Windows) and it might work better.
The error was caused due to my home folder being encrypted. It seems that kafka has trouble installing in encrypted folders. I had to reinstall ubuntu to solve this. There is no other alternative.

Resources