Phonegap SyntaxError:Unexpected Token - android

So I'm running the phonegap build command
phonegap build android
But I'm getting a bunch of Unexpected Token.
I haven't done anything to any of those files so I'm wondering why it's throwing those errors.

You can use build.phonegap.com to build once to verify that there is no problem with the hybrid code. If you can build it there then that indicates there is some issue with the setup like android sdk/version etc or plugins that are installed.

Related

React Native build signed bundle: Error "Cause: argument mismatch"

I am trying to build my app in react native via Build => Generate signed bundle /APK
The standard gradle sync works perfectly but when it comes to build the AAB file, I get this error without any more specification:
This happened in particular after upgrading Android Studio to the new version "Bumblebee".
I use gradle version 7.4 because 6.9 is not possible due to some plugins complaining about it, they require 7.2 latest. I read that this is a solution for this problem but it does not work for me.
I am completely helpless here as I cannot narrow down the error. So maybe someone has a similar issue with react native and can help out.

Cordova Web App

I'm trying to make an apk of the web app I made in babylonjs.
From my understanding you can use Cordova to convert a web app into an apk.
I was able to install Cordova and make its hello world apk download to my phone and open and run it just fine.
However my problem occurs when I put all of my web app files into the www folder in my Cordova project folder. After I do that Cordova gives me this error
Error: ENOENT: no such file or directory, stat '/Users/dylan/practiceApk/www/node_modules/.bin/nopt'
when I try to build the android version.
Here is some information about my setup I believe is relevant.
OS: Mac
cordova -v: 7.1.0
Cordova requirements:
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-24
Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle
cordova info also gives this error(similar error I believe to the one above):
Error retrieving Android platform information:
Android SDK is not set up properly. Make sure that the Android SDK 'tools' and 'platform-tools' directories are in the PATH variable.
Error: android: Command failed with exit code ENOENT
But I tried a lot of different things to fix this. Most of them involved making the android tools in the path (er something..?) I also downgraded from the most recent version of Cordova and android. I believe the problem is in my web app node_modules/.bin/nopt
But I don't know why its is a problem.
Also im not sure how this affects it, but I'm not hosting the website anywhere I just assumed I can used Cordova to create the web app as an apk that could be used offline, all resource are in the project folder though.
Any ideas on how to fix this? I only started using Cordova today so I don't know much about it.
Thanks for your time!
Update: I tried building an iOS version and I get the same error. I believe this is an issue with my npm setup...
It seems that when I was copying over my project to the newly made Cordova project folder I also copied the node_modules folder and didn't actually initialize npm. After initializing it and then updating it would build the app.

ionic3 - android platform cannot get http data from backend

After I format my MAC, I copy and paste my ionic3 project from my hard disk, and set up all environment successfully.
ionic cordova build ios --prod can build success, can run without problem and also can get data from backend.
when I run ionic cordova build android --prod --release also build success without error showing but when run it in my android devices cannot get data from backend and also some function cannot used(I got a phone call function when I press it in android which is not working).
Don't know why can run and get data by IOS, but cannot get data when run in android devices(no this problem showing when I run before).
Run ionic serve -l in web also very nice without problem
And I already tried :
remove and rebuild android platform a lot of time, still cannot get data from backend!
build without --prod version, like ionic cordova build android also cannot get data.
Finally, I solved my problem : android platform cannot get http data from backend
android console showing : Failed to load resource: the server responded with a status of 404 (Not Found)
My mistake is I uninstall WhiteList cordova plugin, because I think this plugin is unused...
So reinstall WhiteList cordova plugin again and android can get data from backend already.
whitelist plugin install : cordova plugin add cordova-plugin-whitelist
Also copy this in config.xml file <allow-navigation href="http://ionic.local/*" />
referenceļ¼šIonic requests return 404 only on android, in Chrome it works fine

Getting 404 error in phonegap/cordova with whitelist installed

I have the whitelist plugin installed however, Im getting a build discrepancy between what is compiled in Android Studio and what is compiled using the cli.
When I compile my application in Android Studio it runs perfectly fine and can access all webpages needed by my app.
However when I use the command:
cordova build android --release
I am getting 404 errors as if the whitelist plugin isnt installed.
We are using a remote machine that is dependent on the cli tools to build.
Im hoping someone on here has run into this issue and has some advice on it.
Thank you.

Apache Cordova - Error in adding platform

I am trying to build an android app using Cordova. When I try to add any platform to the project , it gives a weird message
"lokesh#algo1:~/hello$ cordova platform add android
Unable to fetch platform android: Error: EACCES, mkdir '/home/lokesh/tmp/npm-20721-
vboL12Ej'
I have tried for more than two hours searching to the extent possible but didn't find any thing useful.
Please help me .Below are my attempts like exporting proxy , paths .....

Categories

Resources