How to fix the proxy setup issue with flutter? - android

I am new to flutter. We have a proxy setup in the network. The proxy is already applied to android studio and it is working fine. While creating a new application it is working fine. But, get packages is not working. It returns
Could not resolve URL "https://pub.dartlang.org".
pub get failed (69) -- attempting retry 1 in 1 second...'
set https_proxy=USERNAME:PASSWORD#hostname:port' I tried this code. Even though it is not working
Get packages is not working

You need to run these 2 lines on both your Flutter folder and your project folder:
set https_proxy=USERNAME:PASSWORD#hostname:port
set http_proxy=USERNAME:PASSWORD#hostname:port

Related

Expo notifications can't call `getExpoPushTokenAsync()`

Am currently trying to setup notifications on my managed expo project
Expo version 47.0.0
Expo notifications version 0.17.0
Device: Samsung Galaxy s10
Android version 12
I am currently just trying to get the basic setup itself working and retrieve my devices push token. This should be done using Notifications.getExpoPushTokenAsync() as described here.
The Problem
My error is strange, when I call getExpoPushTokenAsync it does indeed get me the expo push token, however shortly after my app crashes with the following messages
ERROR TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[1], "../../../src/util").types.isPromise')
WARN [expo-notifications] Error encountered while updating server registration with latest device push token. [TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[5], "#ide/backoff").computeNextBackoffInterval')]
I have tried
re-installing node_modules and expo-notifications but still get the same.
I can definitely see the #ide/backoff package is installed in my node_modules.
I also followed these instructions to setup firebase in app, even though my understanding is that it should work out of the box in expo go app while devving.
One other interesting thing is that I can call Notifications.getDevicePushTokenAsync() fine with no error. But still get the same error if i pass that in to getExpoPushTokenAsync method after. At a surface level it seems like somehow the request out to expo services to get the expo push token is both passing and failing 🤷‍♂️
const devicePushTokenResponse = await Notifications.getDevicePushTokenAsync();
const expoPushTokenResponse = await Notifications.getExpoPushTokenAsync({
devicePushToken: devicePushTokenResponse,
}); // <--- Returns token & errors a few seconds later
Couldn't see any other posts with this error and expo-notifications, so would be keen to see if anyone else has ran into / fixed a similar issue recently
Cheers
Alright I figured it out, it was somewhat hinted at by this line
ERROR TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[1], "../../../src/util").types.isPromise')
And more specifically the fact that a node_modules dependency is referencing 3 levels up in the file system.
The solution
Turns out that for some reason my module resolver (defined in babel.config.js) was resolving my project's util folder instead of the packages util folder. I think this was compounded by my metro config making use of the inlineRequires functionality to improve performance (see more)
I am sure there is some actual config that could be updated to exclude node_modules from using inline requires (i did try use a blocklist to no avail), but as an interim, i was able to get it working fine by changing the path of my util folder to be #my-project/util so that it avoids future collisions.
Hope this helps anyone who runs into the same issue in the future :)

NativeScript Build - Error executing Static Binding Generator: Class not found android.support.v4.view.ViewPager.OnPageChangeListener

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

Unable to determine the workspace. You may be able to correct this by running

I try to build apk file in my tfs server. When i run build, after 5 minutes tfs server tell me that my apk file was build and status ok, byt in folder not apk file , in folder only my logs.
Run build_APK.bat
F:\Android\projects\Mrdoc\TeamBuildTypes\mobile_v3R\\build_APK.bat "\\tfb\storage\mobile v3r_1.7\"
Get last version in TFS Server...
Unable to determine the workspace. You may be able to correct this by running 'tf workspaces /collection:TeamProjectCollectionUrl'.
Enviroment initializing...
The system cannot find the path specified.
Assembling...
Deploing path:"\\tfbd\storage\mobile v3r_1.7\"
The command "F:\Android\projects\Mrdoc\TeamBuildTypes\EOSmobile_v3R\\build_APK.bat "\\tfb\storage\mobile v3r_1.7\"" exited with code 1.
I ran the command 'tf workspaces /collection:TeamProjectCollectionUrl'
and I saw all users but it did not help me.
Overall Build Process
Get the Build
Update Build Number
Run On Agent Default Agent - test1
Get the Build Directory
If Not String.IsNullOrEmpty(ConfigurationFolderPath)
Run TfsBuild for Configuration Folder
Getting sources
Labeling sources
Generating list of changesets and updating work items
Выполнена сборка $/Doc/TeamBuildTypes/mobile_v3R/TFSBuild.proj для целевых объектов CompileConfiguration.
MSBuild Log File
If CompilationStatus = Unknown
Set CompilationStatus to Succeeded
If TestStatus = Unknown
Set TestStatus to Succeeded
First if your build service was registered with network service. Give a try with changing it to a windows user with enough build permission.
Moreover, please make sure you have a workspace mapping for your build computer and for the windows account under which build agent runs.
Take a look at this similar issue: Team Build, fixing the "Unable to determine the workspace" error

React Application biqComfortApp has not been registered.due to require() error during initialisation or failure to call AppRegistry.registerComponent

Cloned the project from Git and started it with react..
Did not do any changes in the code for the project as I just wanted to run it using react..
but I got the following error in the emulator..
Application biqComponentApp has not been registered. This is either due to require() error during initialization or failure to call AppRegistry.registerComponent.
I am using windows 7 but same project up and running without any problem for colleagues with mac computers.Not sure whether it is a problem in the project with windows or any installation problem in windows..
please help to find the issue..
Error in the emulator
Make sure you don't have any other react-native/node process running in another terminal. If you do, close it and then re run it, it works for me.
or else
It could be an error caused by not matching name of project and your registered component.
You have created a project with a certain name, example:
react-native init biqComponentApp
But in your index.android.js file you register other component
AppRegistry.registerComponent('Bananas', () => Bananas);
When it must be
AppRegistry.registerComponent('biqComponentApp', () => Bananas);

Gradle "MyApplication4" project refresh failed Error: Connection refused: connect

Good day!! I'm new to android development... I've successfully started my Android Development Studio, downloaded the necessary SDKs via sdk manager, and created a project. I'm following a tutorial where it says that I should be able to run my project (Blank Activity) after setting up a virtual device. Problem is I was able to run the virtual device but I cannot run my project. I kept on receiving the error: Gradle "MyApplication4" project refresh failed Error: Connection refused: connect i've tried using the solution provided here (AndroidStudio gradle proxy) but issue still occurs:
I went to File >> Settings >> Project Settings >> Gradle...
Under Global Gradle Settings, I set Gradle VM options to -Dhttp.proxyHost=www.somehost.org -Dhttp.proxyPort=8080
I cannot post screenshots since I'm also new here at StackOverflow.
Kindly help me in solving this issue.
I had a similar problem starting out; this is what worked for me:
When I set the proxy in the regular menu it appears not to have set the https properties, only http properties. I ended up adding the https properties myself by editing the gradle.properties file (literally as simple as copying the 4 lines beginning with systemProp.http.proxy and adding an "s" to to get systemProp.https.proxy).
The file would look like this:
systemProp.http.proxyPassword=[PASSWORD]
systemProp.http.proxyHost=[IP ADDRESS]
systemProp.http.proxyPort=[PORT]
systemProp.http.proxyUser=[USERNAME]
systemProp.https.proxyPassword=[PASSWORD]
systemProp.https.proxyHost=[IP ADDRESS]
systemProp.https.proxyPort=[PORT]
systemProp.https.proxyUser=[USERNAME]

Categories

Resources