I added plugin nativescript-ui-dataform to my project with command,
tns plugin add nativescript-ui-dataform
I checked package.json after install and noticed "nativescript-ui-dataform": "^3.10.0" was added to the project.
When I build project with tns build android, I get following exception,
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)
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)
and build failed with an error,
FAILURE: Build failed with an exception.
any suggestion on above error, why does this error occur?
It seems to be the problem with using right dependent version for nativescript-ui-autocomplete. I'm sure the versions below are compatible to each other as it's being used in the latest Playground app as of today.
npm i nativescript-ui-dataform#3.9.1 nativescript-ui-autocomplete#3.10.3 --save
Related
I have recently updated the version of the Firebase Appdistribution Gradle plugin from 1.4.0 to 2.0.1.
Since then Jenkins started giving the build time error below:
Execution failed for task app:appDistributionUpload[Variant]. Could not find the APK. Make sure you build first by running ./gradlew assemble[Variant], or set the api Path parameter to point to your APK
This is my Gradle script on Jenkins:
... ./gradlew cleanBuildCache :app:testDebugUnitTest :app:appDistributionUpload[Variant] ...
Starting with version 1.4.1 Running appDistributionUpload{Variant} no longer automatically rebuilds the app.
https://firebase.google.com/support/release-notes/android#appdistro_gradle_plugin_v1-4-1
Updating the Gradle script by adding :app:assemble[Variant] before :app:appDistributionUpload[Variant] solved the issue in my case. Hope it will help others as well.
I am using Svelte Native, which is an offshoot of NativeScript. One of the libraries that I've imported has been nativescript-geolocation.
I've done this like so: import * as geolocation from "nativescript-geolocation";
This works fine when I do a cloud build and test out on my phone using tns preview
When I try and build an APK using tns cloud build android it cannot resolve the nativescript-geolocation dependency.
I get the following error:
ERROR in ./App.svelte
Module not found: Error: Can't resolve 'nativescript-geolocation' in '/home/arthur/todoapp/app'
# ./App.svelte 14:0-56 68:1-34 72:1-26
# ./app.ts
How can I get native-script geolocation to resolve?
Seems like your build is missing the nativescript-geolocation dependency.
Running tns plugin add nativescript-geolocation should add it to package.json and fix the build.
I believe the reason it works in the preview version is that the Preview app has the geolocation plugin pre-installed.
I am working on a react native application. when I try to build the applications using react-native run-android the build fails. Here is the output of the error that occurs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 8s
253 actionable tasks: 5 executed, 248 up-to-date
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: ./gradlew app:installDebug
debug Error: Command failed: ./gradlew app:installDebug
at checkExecSyncError (child_process.js:607:13)
at execFileSync (child_process.js:627:13)
at runOnAllDevices (/Users/FaisalHussain/mobile/node_modules/#react-native-community/cli/build/commands/runAndroid/runOnAllDevices.js:58:39)
at buildAndRun (/Users/FaisalHussain/mobile/node_modules/#react-native-community/cli/build/commands/runAndroid/runAndroid.js:142:41)
at then.result (/Users/FaisalHussain/mobile/node_modules/#react-native-community/cli/build/commands/runAndroid/runAndroid.js:104:12)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
The application was on a old version of react native (0.48.x) I have updated it to 0.59.10.
What I have done so far:
used jetifier to resolve issues with the plugins.
checked that the build tools version matches the compile sdk version
checked if the emulator is running.
Hence I have tried everything I could to resolve this but had no luck. Please do guide me on how to resolve this issue. Looking forward to your answers.
make sure you have followed all the necessary steps from the upgrade helper https://react-native-community.github.io/upgrade-helper/?from=0.48.0&to=0.59.10
also i would suggest you to upgrade to v0.60+ because there are breaking changes after v0.59.10.
having said that
before you run the app make sure your gradle is clean
run the following command to clean your gradle cd android && ./gradle clean
then later you can navigate back to your app folder cd .. and try and run again react-native run-android
Looks like your packages not working stable with Android side. It's better be update all packages and react native version to their last stable versions.
If you face with too much error while update, you can create fresh new react native project (with same package name with your current project), install all packages (and their dependencies) and copy your current project's source code to your new project.
Android in React Native does not allow similar packages to reside in the project.
In my case I had react-native-cookies and #react-native-cookies/cookies packages that add similar code to the Kotlin file upon build. This causes issue of similar imports in java JDK.
I removed one and it worked.
SOLVED at the same issue:
My solution was at /android/build.gradle file.
Somehow, the buildscript versions were wrong.
Follow the exact same step of RN documentation and make a totally new & clean project.
And compate the /android/build.gradle file > buildscript & dependencies part.
There should be some version differences.
It matters by your own local env settings.
After changing buildToolsVersion, ndkVersion, classpath, it worked fine again!!
also, remove duplicated libraries, as #Nimantha said.
My error:
:app:preReleaseBuild FAILED
FAILURE: Build failed with an exception.
* What went wrong:
The library com.google.android.gms:play-services-measurement-base is being
requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]],
but resolves to 16.5.0. Disable the plugin and check your dependencies tree
using ./gradlew :app:dependencies.
I reinstalled the npm and cordova plugins for Firebase, I deleted the node-modules, the plugins and everything but the issue is still there and can't build the project.
Any thoughts?
This resolved my problem:
In your project folder execute cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
ionic cordova platform rm android
ionic cordova platform add android.
You can find the solution here: https://github.com/arnesson/cordova-plugin-firebase/pull/1058
for ionic , go to projects.gardle and
change cordova.system.library.8=com.google.firebase:firebase-messaging:17.0.+ to (17.5.0)
The following error occurs when trying to build an android app with cordova and the cordova-crosswalk plugin:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_armv7DebugCompile'.
> Could not find any version that matches com.android.support:support-v4:+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml
https://repo1.maven.org/maven2/com/android/support/support-v4/
https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/android/support/support-v4/maven-metadata.xml
https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/android/support/support-v4/
Required by:
:android:unspecified
* 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: 2.918 secs
/home/remi/dev/git/gitlab/sirap-sas/tereo-mobile/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /home/remi/dev/git/gitlab/sirap-sas/tereo-mobile/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/remi/dev/git/gitlab/sirap-sas/tereo-mobile/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true
ERROR running one or more of the platforms: Error: /home/remi/dev/git/gitlab/sirap-sas/tereo-mobile/platforms/android/cordova/run: Command failed with exit code 1
You may not have the required environment or OS to run this project
Please notice that section:
Could not resolve all dependencies for configuration ':_armv7DebugCompile'.
It can happen because building an android project with the crosswalk plugin try to build two apks : one for ARM, the other for x86.
The solution is to install Android Support Repository :
Open the SDK manager (from command line, type android).
Under Extras, Make sure you have Android Support Repository and Google Repository downloaded.
Update answer
Seems starting from crosswalk 16, Android Support Repository and Google Repository is not enough.
You need to install Local Maven repository for Support Libraries from Extras as well.
for me Solution was:
i updated crosswalk to #15.44.384.13
ionic browser add crosswalk#15.44.384.13
then i changed config.xml:
<preference name="xwalkVersion" value="15+" />
cuz versions "16+" - "18+" not work for me
It may be the problem when you did not include google support respository and android support repository under extras. as well as when you not update the cordova with your cordova platform.because cordova and cordova platform must be use latest version.update your Cordova with npm update cordova -g --save and cordova platform with cordova platform update platform_name(like android).
This worked for me
1.goto platforms\android\cordova-plugin-crosswalk-webview folder
2.Open .gradle file
3.find
dependencies { compile xwalkSpec }
and replace with
dependencies {
compile 'org.xwalk:xwalk_core_library:22.52.561.4'
}
**
note: 22.52.561.4 is version of crasswalk on your machine
to know it , open ionic app , chrome://inspect then
window.navigator.userAgent
This will print some lines , copy xwalk details from there
I know it's a little late to add an answer. but I faced this issue for a long time and none of these steps fixed it. If your IP is from Iran, then you should build your project with VPN on. It seems that dependencies are banned for some countries.