Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.12 mobile build net::ERR_CONNECTION_REFUSED #12891

Closed
gabrielnicolae3103 opened this issue Nov 17, 2023 · 1 comment
Closed

2.12 mobile build net::ERR_CONNECTION_REFUSED #12891

gabrielnicolae3103 opened this issue Nov 17, 2023 · 1 comment

Comments

@gabrielnicolae3103
Copy link

Hi,

I am trying to upgrade my meteor app from 2.2 to 2.12, before upgrading (on 2.2), I could build and run the app without any problems on my phone/emulator, after upgrading to 2.12 the app crashes every timeI open it.

1700151410624

What I did that is different from before is:
-Upgrade to java 11 vs java 8
-Removed the cordova-plugin-whitelist as it's not supported in cordova-android 10 anymore (it's included by default).

I am using a remote server, not a local one. I also tried running it using meteor run on device/emulator or building the apk and running it on my phone/emulator, same thing. There are no logs whatsoever, no error, just the net::ERR_CONNECTION_REFUSED that appears in the network tab.

My mobile-config.js

App.info({
    id: 'app',
    name: 'app',
    description: 'dsa',
    author: 'Team',
    email: 'contact@',
    website: 'https://www.dsadsa',
    version: '1.9.100'
});

App.setPreference('AndroidXEnabled', 'true');
App.setPreference('SplashScreenBackgroundColor', '0xFFFFFFFF');
App.setPreference('SplashShowOnlyFirstTime', 'true');
App.setPreference('SplashScreenDelay', '1000');
App.setPreference('SplashMaintainAspectRatio', 'true');
App.setPreference('BackgroundColor', '0xffffffff');
App.setPreference('StatusBarBackgroundColor', '#ffffff');

App.icons({
    // iOS
stuff
});

App.appendToConfig(`
  <platform name="ios">
    <icon height="1024" width="1024" src="../../../private/icons/ios_app_store.png" />
  </platform>
`);

App.appendToConfig(`<platform name="ios">
    <config-file platform="ios" target="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
      <string>This is to allow uploading a profile picture or attaching an image to a question</string>
    </config-file>
    <config-file platform="ios" target="*-Info.plist" parent="NSCameraUsageDescription">
      <string>This is to allow uploading a profile picture or attaching an image to a question</string>
    </config-file>
  </platform>`);

App.appendToConfig(`
  <platform name="android">
    <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
        <application android:usesCleartextTraffic="true" />
    </edit-config>
    <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity" xmlns:android="http://schemas.android.com/apk/res/android">
        <activity android:exported="true"></activity>
    </edit-config>
  </platform>
`);

App.launchScreens({
    // iOS
   stuff
});

// Enable external urls
App.accessRule('https://www.youtube.com/*', { type: 'navigation' });
App.accessRule('https://www.youtube.com/*', { type: 'network' });
App.accessRule('https://www.youtube.com/*', { type: 'intent' });
App.accessRule('https://connect.facebook.net/*', { type: 'network'});
App.accessRule('https://m.facebook.com/*', { type: 'navigation'});
App.accessRule('https://maps.google.com/*');
App.accessRule('https://embed.tawk.to/');
App.accessRule('https://www.google-analytics.com/*');
App.accessRule('https://static.hotjar.com/*');
App.accessRule('https://in.hotjar.com/*');
App.accessRule('https://vc.hotjar.io/*');
App.accessRule('https://graph.facebook.com/*');
App.accessRule('https://storage.googleapis.com/*');
App.accessRule('https://api.segment.io/*');
App.accessRule('https://*', { type: 'navigation' });
//App.accessRule('http://*', { type: 'navigation' });
//App.accessRule('https://*');
//App.accessRule('http://*');

// Extend load URL timeout for Android to fix startup bug
App.setPreference('LoadUrlTimeoutValue', 60000, 'android');

// Set target SDK version
App.setPreference('android-targetSdkVersion', '33');
App.setPreference('android-minSdkVersion', '22');

My cordova-plugins

cordova-custom-config@5.1.0
cordova-plugin-badge@0.8.8
cordova-plugin-facebook-connect@3.2.0
cordova-plugin-inappbrowser@4.0.0
cordova-plugin-meteor-webapp@1.9.1
cordova-plugin-splashscreen@6.0.0
cordova-plugin-statusbar@2.4.3
onesignal-cordova-plugin@3.3.0

I really don't know what to do, google isn't helping at all... Thx

@matheusccastroo
Copy link
Contributor

matheusccastroo commented Dec 20, 2023

@gabrielnicolae3103 Hopefully you already found what was wrong, but I think your case is the same as this one: https://forums.meteor.com/t/meteor-mobile-build-err-connection-refused/60822.

Edit: yes, looking at your cordova-plugins file this is the issue. You are pinning the meteor-webapp plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants