An unhandled exception occurred: Project target does not exist - android

I have a problem when I write:
ionic cordova prepare androidŲŒ
Knowing that this is happening with every new project I create.
Please help.

The problem is caused by required builders that are missing from the angular.json file. To install those builders, run:
ng add #ionic/cordova-builders
You should get an output similar to this:
After that, go ahead and run your build.

Ionic CLI v6.19.0 has been released with this fix:
npm install -g #ionic/cli#latest
bug report on GitHub:
https://github.com/ionic-team/ionic-framework/issues/24940#issuecomment-1068016921

Related

Project with path ':unimodules-core' could not be found in project ':#unimodules_react-native-adapter'

Taking over RN project from another developer and trying to make a build for Android, however Gradle keeps giving me this issue:
ERROR: Project with path ':unimodules-core' could not be found in project ':#unimodules_react-native-adapter'.
The only solution I could find regarding this is adding settings.gradle file:
include ':#unimodules_react-native-adapter'
project(':#unimodules_react-native-adapter').projectDir = new File(rootProject.projectDir, '../node_modules/#unimodules/react-native-adapter/android')
but this doesn't work for me.
I have linked the native dependecies
I have tried npm and yarn
Project is using:
"#unimodules/core": "^3.0.2",
"#unimodules/react-native-adapter": "^3.0.0",
Gradle is directing me to the #unimodules/react-native-adapter/android/build.gradle file:
apply from: project(":unimodules-core").file("../unimodules-core.gradle")
Any guidance of what could possible be wrong, would greatly be appreciated
Something that solved this for me was removing: #unimodules/react-native-adapter from dependencies entirely.
I solved my issue by installing react-native-unimodules.
$> yarn add react-native-unimodules
Managed to fix it by deleting project, cloning it again and only running yarn instead of trying npm and yarn.
To resolve this, you can try using npm to:
1- Remove from your package.json
this line:
"#unimodules/core": "^3.0.2",
on "dependencies": { part
2- Install the unimodules-core package:
with npm:
npm install #unimodules/core --save
you can do identical thing with yarn , you can take a look to the official doc:
https://www.npmjs.com/package/#unimodules/core?activeTab=readme
For me, the issue was using expo packages (e.g. "import * as Crypto from 'expo-crypto"). I removed them and the problem went away.

NativeScript tns build failed after adding nativescript-ui-dataform plugin

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

error: uncompiled PNG file passed as argument. Must be compiled first into .flat file

In react-native, I am trying to generate signed APK following their instructions. But when I execute this ./gradlew assembleRelease command it shows me this error. Error details.
My platform:
OS: Windows 10
node: 8.9.1
npm: 5.5.1
react: 16.3.2
react-native: 0.55
Can anybody tell me, why I am getting this error?
I got a solution here by adding android.enableAapt2=false into android/gradle.properties. Apparently, I read that it's only a temporary solution. No way to solve it with others solutions?
Add org.gradle.configureondemand=true to android/gradle.properties

Ionic plugin barcodescanner

When I try to build the application "ionic build android" see the error below. This error only happens when I install phonegap-plugin-BarcodeScanner.
Anyone know what can this be?
Error: error code 1 for command: /path/to/app/platforms/android/gradlew with args: cdvBuildDebug, -b, /path/to/app/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
Mostly this error happens because the gradle version of your project and the gradle version of a plugin is missmatching.
What you can do is removing the platform and add it again.
Open the project and deny the question from AndroidStudio to upgrade to the newest gradle version.
I think that the problem was solved.
What I did was remove a line from myapp-barcodescanner.gradle file.
This is the code removed:
compile 'com.android.support:support-v4:+'.
Now, it is working normally.

React Native Android: screenPhysicalPixels.width is undefined

I recently upgraded to RN 0.20 and I now have the following exception thrown when I try to load my app:
undefined is not an object (evaluating 'screenPhyisicalPixels.width')
<unknown>
index.android.bundle?platform=android& def=true:32950
requireImpl
index.android.bundle?platform=android& def=true:76
_require
index.android.bundle?platform=android& def=true:36
Which apparently causes a JS error the following file:
node_modules/react-native/Libraries/Utilities/Dimensions.js at line 30
For info, I'm not using the Dimensions API in my app.
Any tip on this?
You need to update the string in android/app/build.gradle to
dependencies {
compile "com.facebook.react:react-native:0.20.+"
}
Then just run
npm start
react-native run-android
I had a similar problem when upgrading my project from 0.19 to 0.20.
What did it for me, was running react-native upgrade.
After that, you'll probably have to reinstall your modules with npm install.
edit: and of course rebuild your app after that via react-native run-android.
The best thing to do is to remove node_modules folder. After that run on root directory
watchman watch-del-all
Next step is to run
npm install
Then start packager manually with
react-native start --reset-cache
Thats what helped for me. Good luck!
I'm unclear of what command did what exactly, but I fixed it after the following steps, thanks to a combination of #mr-brown and #matija-grcic answers:
Set "react-native": "^0.20.0", in package.json
Delete node_modules
Run react-native upgrade (updates android/app/build.gradle among others)
Uninstall app on my phone
react-native run-android

Categories

Resources