I figured i would try the 'new' CLI tool for Ionic, Package, but i am getting some weird errors that i haven't seen before.
When running the command :
ionic package build android --profile release
The error i am getting
undefined:0
^
SyntaxError: Unexpected end of input
at Object.parse (native)
at /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/io-config.js:179:28
at fs.js:271:14
at Object.oncomplete (fs.js:107:15)
After some research i found that this can happen when a command is run without sudo, but when running the command with sudo i am getting the dam error message.
Hopefully i am lucky and ill find an Ionic enthusiast who might help me with the matter. Couldn't find any Ionic related topics where this error was mentioned.
Any help appreciated!
I had to add [] to the .io-config.json file in the root directory of my ionic app.
Btw. dont forget to install ionic add ionic-platform-web-client
The solution for me was annoyingly simple. In the file mentioned, find the line where CONFIG_BACKUP is defined and change it. You should see that it is:
var CONFIG_BACKUP = './.io-config.json'
It should actually be:
var CONFIG_BACKUP = './io-config.json'
I was building for iOS but had the same error as you which disappeared after the above.
For me the error resulted from the config.xml file. I would open all ionic files to make sure there are no formatting errors. The rebuild
Related
Thanks in advance
I received the below error when I tried to upgrade react native from 68.1 to 70.6.
I tried this in android.
I ran react-native run-android and everything went well.
Upon running the app the metro bundler started loading 99% and showed this error in red screen
error: node_modules/react-native-svg/src/elements/Shape.tsx: /Users/jarenk/Documents/myApp/node_modules/react-native-svg/src/elements/Shape.tsx: child.isClassAccessorProperty is not a function
Can anybody help me on this.
Am using react native SVG and its version was old. I updated it to latest version too.
(13.6.0) but still its getting same error.
Error In Detail (If I take Build)
./gradlew assembleRelease
I get following error
error node_modules/react-native-svg/src/elements/Shape.tsx: /Users/jarenk/Documents/myApp/node_modules/react-native-svg/src/elements/Shape.tsx: child.isClassAccessorProperty is not a function.
TypeError: /Users/jarenk/Documents/myApp/node_modules/react-native-svg/src/elements/Shape.tsx: child.isClassAccessorProperty is not a function
at /Users/jarenk/Documents/myApp/node_modules/#babel/plugin-transform-typescript/lib/index.js:361:89
at Array.forEach (<anonymous>)
at PluginPass.Class (/Users/jarenk/Documents/myApp/node_modules/#babel/plugin-transform-typescript/lib/index.js:353:31)
at newFn (/Users/jarenk/Documents/myApp/node_modules/#babel/traverse/lib/visitors.js:171:21)
at NodePath._call (/Users/jarenk/Documents/myApp/node_modules/#babel/traverse/lib/path/context.js:53:20)
at NodePath.call (/Users/jarenk/Documents/myApp/node_modules/#babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/Users/jarenk/Documents/myApp/node_modules/#babel/traverse/lib/path/context.js:90:31)
at TraversalContext.visitQueue (/Users/jarenk/Documents/myApp/node_modules/#babel/traverse/lib/context.js:110:16)
at TraversalContext.visitQueue (/Users/jarenk/Documents/myApp/node_modules/#babel/traverse/lib/context.js:116:21)
info Run CLI with --verbose flag for more details.
Once again thank you.
Updating the package.json file helped me to resolve this.
just downgrade the babel versions like below
Also make sure same below version are in package-lock.json file
"#babel/core": "7.12.9",
"#babel/runtime": "7.12.5"
To solve this issue, you need to delete the "node_modules" folder and run either
"yarn install" or
"npm install" command.
It is likely that you switched to a Git branch with a higher version of Babel, which is causing the problem.
I'm new to NativeScript and took over a project recently upgraded from NativeScript 4 to 6. Here is my environment detials:
Windows 10
Node v16.6.1
NativeScript 8.0.2
Android Studio 11 (with al
the recommended updates to date)
VS Code 1.58.2
I can create a new Native script project with "tns create" and build/run it in the simulator just fine. However, when I try to run the project the build throws the following error:
java.lang.RuntimeException: Class not found android.support.v4.view.ViewPager.OnPageChangeListener
at org.nativescript.staticbindinggenerator.Generator.getClass(Generator.java:551)
at org.nativescript.staticbindinggenerator.Generator.getInterfacesFromCache(Generator.java:534)
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:55)
Here is the run command I'm using: "tns run android --emulator"
I have tried tons of things and searches but no luck resolving this issue.
So I had an idea and searched with a different search engine than I normally use. I did find some ideas which helped me resolved the issue.
I had previously searched in VSCode for variations on "android.support.v4.view.ViewPager.OnPageChangeListener", but only found the log file with the error. Then I learned you have to change the filter options of the find in file search otherwise the files you are looking for can be excluded from the search results. I also used Baregrep to confirm I was getting everything.
I fixed the issue by replacing all occurrences of:
android.support.v4.view.ViewPager with androidx.viewpager.widget.ViewPager
Also you may need to install widgets:npm i tns-core-modules-widgets
Since the files where I made the changes were all non-project files (many of them in the node_modules directory) there is probably something else that involves updating Node or NativeScript that may solve this as well.
If someone else figures that out, I'll be watching this thread for updates, and thanks in advance!
Fissh
I'm trying to build my ionic app for android and most users have a white screen after the splashscreen. I've past the past week to try to determine where it could come but got no idea... So I'm trying to get rid of all the errors I have when building. (it still succed to build with the errors and worked on almost half phones).
First one is here :
Building for Android...
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd plugin remove sentry-cordova exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
> cordova.cmd plugin remove sentry-cordova Sentry: running before_plugin_rm - set SENTRY_SKIP_WIZARD=true to skip this angular.json build.json build_android.sh build-extras.gradle CertificateSigningRequest.certSigningRequest
...
tslint.json www Uninstalling sentry-cordova from android Subproject Path: CordovaLib Subproject Path: app Uninstalling sentry-cordova from browser js-module uninstall called : plugins\sentry-cordova\dist\js\sentry-cordova.bundle.js Uninstalling sentry-cordova from ios Removing "sentry-cordova" Removing sentry-cordova from package.json doc.find is not a function
Second one is after, there is multiples lines like this :
- warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/1-es5.1922
I'm pretty sure I miss some informations. Don't hesitate to ask if necessary but I'm sure I forget to do something, but i'm kinda desperate now...
EDIT : Here is the begining of the script I'm using for build :
echo "Building for Android..."
#npm run android:build:prod
sentryRemove=$(ionic cordova plugin remove sentry-cordova)
echo $sentryRemove
sentryAdd=$(cordova plugin add sentry-cordova)
echo $sentryAdd
echo "successfully added the sentry. \n Performing build now."
appBuildOut=$(ionic cordova build android --prod --release --source-map)
echo $appBuildOut
BUILD_MESSAGE='BUILD SUCCESSFUL'
Thanks for your help
The first question is why are you running a plugin remove command when building your app, if I understand correctly. I would check what is calling this command because the script that is erroring before_plugin_rm should only be called when the plugin is being removed.
To get this script to just work, try running with the environment variable SENTRY_SKIP_WIZARD=true and see if the build works. I don't think the reason for the white screen is related to Sentry as the step that is failing looks to be related to source map uploading.
I have been trying for 2 days to sort out this problem I am having with phonegap/cordova.
Working on a mac, I can build for iOS. But everytime I try to build for android, I get this error:
BUILD FAILED
/Users/m/Documents/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:601: The following error occurred while executing this line:
/Users/m/Documents/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/Users/m/Documents/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:734: Class not found: javac1.8
Any help would be great!! No online resources has helped!
Do you have java sdk/JDK installed in your mac? you may try javac -version in your terminal and check the results.
you can also refer to http://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html
Easy to solve, look at error message:
.../sdk/tools/ant/build.xml:734: Class not found: javac1.8
So open this file, on line 734, and you find fork="${need.javac.fork}"> . What's need.javac.fork? I don't know, but let's search this in document and we got this on line 199:
<condition else="false" property="need.javac.fork">
<and>
<matches pattern="1\.[56]" string="${java.specification.version}"/>
<not>
<os family="unix"/>
</not>
</and>
</condition>
Whoa, pattern="1\.[56]" ?? It looks like this pattern is about Java 1.5 and 1.6, what If I change this to pattern="1\.[8]" ? Now it will build and works like a charm!!!
Some people said this is related because the ant version is old and doesn't support Java 8..or you need to install Java 1.6.. and yes doing this works too, but we programmers need to read error messages and be at least a little bit curious to understand and try to solve too, I spent a minute or two to find and solve this problem... just by reading the error message!
I am trying to build my phonegap app locally and am incountering the following error
[phonegap] adding the Android platform...
Error: Invalid attribute name Line: 0 Column: 36 Char: ?
at error (/usr/lib/node_modules/phonegap/node_modules/cordova/node_modules/elementtree/node_modules/sax/lib/sax.js:347:8)
at strictFail (/usr/lib/node_modules/phonegap/node_modules/cordova/node_modules/elementtree/node_modules/sax/lib/sax.js:364:22)
at Object.write (/usr/lib/node_modules/phonegap/node_modules/cordova/node_modules/elementtree/node_modules/sax/lib/sax.js:876:16)
at XMLParser.feed (/usr/lib/node_modules/phonegap/node_modules/cordova/node_modules/elementtree/lib/parsers/sax.js:48:15)
at ElementTree.parse (/usr/lib/node_modules/phonegap/node_modules/cordova/node_modules/elementtree/lib/elementtree.js:263:10)
at Object.exports.XML (/usr/lib/node_modules/phonegap/node_modules/cordova/node_modules/elementtree/lib/elementtree.js:593:13)
at Object.module.exports.parseElementtreeSync (/usr/lib/node_modules/phonegap/node_modules/cordova/src/xml-helpers.js:111:38)
at Object.config_parser (/usr/lib/node_modules/phonegap/node_modules/cordova/src/config_parser.js:25:20)
at Object.platform (/usr/lib/node_modules/phonegap/node_modules/cordova/src/platform.js:65:15)
at LocalBuildCommand.module.exports.addPlatform (/usr/lib/node_modules/phonegap/lib/phonegap/local.build.js:153:13)
I am using phonegap 3.0.0
I might be a little late but I just had this problem and solved it.
I just deleted the android folder in 'platforms' and reran
phonegap run android
you can also do phonegap add android if you don't want to run it.
Make sure to back up your xml manifests if you made any changes.
The right way is:
1) $ phonegap platform rm android
2) $ phonegap plaftorm add android
3) $ phonegap build android
It is also recommended to do this when you add or remove plugin.