My apps can't get internet access - why so?
I'm making an app which uses firebase,
I tried many apps before and they just don't get Internet access
I don't know why but all my last apps didn't get Internet access,
I already added the permissions which should be used for internet access.
and tried to add the permissions under the tag as I saw but it didn't work.
Manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.co.app">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<provider
android:name=".DatabaseContentProvider"
android:authorities="com.yourpackage.name"
android:exported="false" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginActivity" />
<activity android:name=".SignUpActivity" />
<activity
android:name=".nav_drawer"
android:label="@string/title_activity_nav_drawer"
android:theme="@style/AppTheme" />
<activity android:name=".list" />
<activity android:name=".detail"></activity>
</application>
</manifest>
Build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.co.app"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation "com.google.firebase:firebase-core:16.0.4"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.android.gms:play-services-base:16.0.1'
implementation 'com.google.android.gms:play-services-analytics:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
//add libraries
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
compile 'com.parse:parse-android:1.16.3' //update version to the latest one
compile 'com.android.support:design:27.1.1'
compile 'com.android.support:recyclerview-v7:27.1.1'
compile 'com.android.support:cardview-v7:27.1.1'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
compile 'info.hoang8f:fbutton:1.0.5'
compile 'com.cepheuen.elegant-number-button:lib:1.0.2'
compile 'com.squareup.picasso:picasso:2.5.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
testCompile 'junit:junit:4.12'
// compile fileTree(dir: 'libs',include: ['*.jar'])
//androidTestImplementation(com.android.support.test.espresso:espresso-cor2.2.2',)
//[add the library]
}
apply plugin: 'com.google.gms.google-services'
java
add a comment |
I'm making an app which uses firebase,
I tried many apps before and they just don't get Internet access
I don't know why but all my last apps didn't get Internet access,
I already added the permissions which should be used for internet access.
and tried to add the permissions under the tag as I saw but it didn't work.
Manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.co.app">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<provider
android:name=".DatabaseContentProvider"
android:authorities="com.yourpackage.name"
android:exported="false" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginActivity" />
<activity android:name=".SignUpActivity" />
<activity
android:name=".nav_drawer"
android:label="@string/title_activity_nav_drawer"
android:theme="@style/AppTheme" />
<activity android:name=".list" />
<activity android:name=".detail"></activity>
</application>
</manifest>
Build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.co.app"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation "com.google.firebase:firebase-core:16.0.4"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.android.gms:play-services-base:16.0.1'
implementation 'com.google.android.gms:play-services-analytics:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
//add libraries
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
compile 'com.parse:parse-android:1.16.3' //update version to the latest one
compile 'com.android.support:design:27.1.1'
compile 'com.android.support:recyclerview-v7:27.1.1'
compile 'com.android.support:cardview-v7:27.1.1'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
compile 'info.hoang8f:fbutton:1.0.5'
compile 'com.cepheuen.elegant-number-button:lib:1.0.2'
compile 'com.squareup.picasso:picasso:2.5.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
testCompile 'junit:junit:4.12'
// compile fileTree(dir: 'libs',include: ['*.jar'])
//androidTestImplementation(com.android.support.test.espresso:espresso-cor2.2.2',)
//[add the library]
}
apply plugin: 'com.google.gms.google-services'
java
1
Are you sure your emulator/device has access to the internet? Can you share the code you are using to connect and any relevant logcat output?
– Chris Stillwell
Nov 14 '18 at 16:49
It can't be possible, Just check you will be missing something
– jitesh mohite
Nov 14 '18 at 17:04
@jiteshmohite this is the gradle and manifest in front of it, and I already checked it, it should work perfectly but it didn't
– user8915900
Nov 14 '18 at 17:32
add a comment |
I'm making an app which uses firebase,
I tried many apps before and they just don't get Internet access
I don't know why but all my last apps didn't get Internet access,
I already added the permissions which should be used for internet access.
and tried to add the permissions under the tag as I saw but it didn't work.
Manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.co.app">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<provider
android:name=".DatabaseContentProvider"
android:authorities="com.yourpackage.name"
android:exported="false" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginActivity" />
<activity android:name=".SignUpActivity" />
<activity
android:name=".nav_drawer"
android:label="@string/title_activity_nav_drawer"
android:theme="@style/AppTheme" />
<activity android:name=".list" />
<activity android:name=".detail"></activity>
</application>
</manifest>
Build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.co.app"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation "com.google.firebase:firebase-core:16.0.4"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.android.gms:play-services-base:16.0.1'
implementation 'com.google.android.gms:play-services-analytics:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
//add libraries
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
compile 'com.parse:parse-android:1.16.3' //update version to the latest one
compile 'com.android.support:design:27.1.1'
compile 'com.android.support:recyclerview-v7:27.1.1'
compile 'com.android.support:cardview-v7:27.1.1'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
compile 'info.hoang8f:fbutton:1.0.5'
compile 'com.cepheuen.elegant-number-button:lib:1.0.2'
compile 'com.squareup.picasso:picasso:2.5.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
testCompile 'junit:junit:4.12'
// compile fileTree(dir: 'libs',include: ['*.jar'])
//androidTestImplementation(com.android.support.test.espresso:espresso-cor2.2.2',)
//[add the library]
}
apply plugin: 'com.google.gms.google-services'
java
I'm making an app which uses firebase,
I tried many apps before and they just don't get Internet access
I don't know why but all my last apps didn't get Internet access,
I already added the permissions which should be used for internet access.
and tried to add the permissions under the tag as I saw but it didn't work.
Manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.co.app">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<provider
android:name=".DatabaseContentProvider"
android:authorities="com.yourpackage.name"
android:exported="false" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginActivity" />
<activity android:name=".SignUpActivity" />
<activity
android:name=".nav_drawer"
android:label="@string/title_activity_nav_drawer"
android:theme="@style/AppTheme" />
<activity android:name=".list" />
<activity android:name=".detail"></activity>
</application>
</manifest>
Build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.co.app"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation "com.google.firebase:firebase-core:16.0.4"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.android.gms:play-services-base:16.0.1'
implementation 'com.google.android.gms:play-services-analytics:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
//add libraries
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
compile 'com.parse:parse-android:1.16.3' //update version to the latest one
compile 'com.android.support:design:27.1.1'
compile 'com.android.support:recyclerview-v7:27.1.1'
compile 'com.android.support:cardview-v7:27.1.1'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
compile 'info.hoang8f:fbutton:1.0.5'
compile 'com.cepheuen.elegant-number-button:lib:1.0.2'
compile 'com.squareup.picasso:picasso:2.5.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
testCompile 'junit:junit:4.12'
// compile fileTree(dir: 'libs',include: ['*.jar'])
//androidTestImplementation(com.android.support.test.espresso:espresso-cor2.2.2',)
//[add the library]
}
apply plugin: 'com.google.gms.google-services'
java
java
edited Nov 14 '18 at 17:13
Fantômas
32.6k156389
32.6k156389
asked Nov 14 '18 at 16:44
user8915900
1
Are you sure your emulator/device has access to the internet? Can you share the code you are using to connect and any relevant logcat output?
– Chris Stillwell
Nov 14 '18 at 16:49
It can't be possible, Just check you will be missing something
– jitesh mohite
Nov 14 '18 at 17:04
@jiteshmohite this is the gradle and manifest in front of it, and I already checked it, it should work perfectly but it didn't
– user8915900
Nov 14 '18 at 17:32
add a comment |
1
Are you sure your emulator/device has access to the internet? Can you share the code you are using to connect and any relevant logcat output?
– Chris Stillwell
Nov 14 '18 at 16:49
It can't be possible, Just check you will be missing something
– jitesh mohite
Nov 14 '18 at 17:04
@jiteshmohite this is the gradle and manifest in front of it, and I already checked it, it should work perfectly but it didn't
– user8915900
Nov 14 '18 at 17:32
1
1
Are you sure your emulator/device has access to the internet? Can you share the code you are using to connect and any relevant logcat output?
– Chris Stillwell
Nov 14 '18 at 16:49
Are you sure your emulator/device has access to the internet? Can you share the code you are using to connect and any relevant logcat output?
– Chris Stillwell
Nov 14 '18 at 16:49
It can't be possible, Just check you will be missing something
– jitesh mohite
Nov 14 '18 at 17:04
It can't be possible, Just check you will be missing something
– jitesh mohite
Nov 14 '18 at 17:04
@jiteshmohite this is the gradle and manifest in front of it, and I already checked it, it should work perfectly but it didn't
– user8915900
Nov 14 '18 at 17:32
@jiteshmohite this is the gradle and manifest in front of it, and I already checked it, it should work perfectly but it didn't
– user8915900
Nov 14 '18 at 17:32
add a comment |
1 Answer
1
active
oldest
votes
For android API 23rd and above add below line to
<application
...
android:usesCleartextTraffic="true"
..
</application>
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53305022%2fmy-apps-cant-get-internet-access-why-so%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
For android API 23rd and above add below line to
<application
...
android:usesCleartextTraffic="true"
..
</application>
add a comment |
For android API 23rd and above add below line to
<application
...
android:usesCleartextTraffic="true"
..
</application>
add a comment |
For android API 23rd and above add below line to
<application
...
android:usesCleartextTraffic="true"
..
</application>
For android API 23rd and above add below line to
<application
...
android:usesCleartextTraffic="true"
..
</application>
answered Nov 15 '18 at 12:01
Dino SunnyDino Sunny
959
959
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53305022%2fmy-apps-cant-get-internet-access-why-so%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Are you sure your emulator/device has access to the internet? Can you share the code you are using to connect and any relevant logcat output?
– Chris Stillwell
Nov 14 '18 at 16:49
It can't be possible, Just check you will be missing something
– jitesh mohite
Nov 14 '18 at 17:04
@jiteshmohite this is the gradle and manifest in front of it, and I already checked it, it should work perfectly but it didn't
– user8915900
Nov 14 '18 at 17:32