迁移到androidx后,我的应用程序无法连接到互联网

0tdrvxhp  于 2021-09-29  发布在  Java
关注(0)|答案(1)|浏览(466)

迁移到androidx后,我的应用程序停止连接到internet。我没有收到任何错误,只是无法连接到互联网。我相信这可能是由于依赖性的一些实现。我有一个很大的实现列表,如下所示(问题可能在wordpress部分);

implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.vectordrawable:vectordrawable:1.0.0'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.12'
    implementation project(path: ':library')
    implementation 'androidx.appcompat:appcompat:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
    implementation 'org.greenrobot:eventbus:3.1.1'

// for language selector
    implementation 'devlight.io:navigationtabbar:1.2.5'
    implementation 'com.github.mirrajabi:search-dialog:1.2.3'
    implementation 'com.github.shts:TriangleLabelView:1.1.2'
    implementation 'me.wangyuwei:ParticleView:1.0.4'
    implementation 'com.kyleduo.switchbutton:library:2.0.0'
    compile 'com.sackcentury:shinebutton:0.2.0'
/// wordpress
    implementation 'com.lsjwzh:materialloadingprogressbar:0.5.5-RELEASE'
    implementation 'com.marshalchen.ultimaterecyclerview:library:0.3.17'
    implementation 'com.mikepenz:iconics-core:1.7.9@aar'
    implementation 'com.mikepenz:google-material-typeface:1.2.0.1@aar'
    implementation 'com.mikepenz:community-material-typeface:1.2.64.1@aar'
    implementation('com.mikepenz:materialdrawer:4.4.4@aar') { transitive = true }
    implementation 'com.github.iammert:MaterialIntroView:1.6.0'
    implementation 'com.github.ksoichiro:android-observablescrollview:1.6.0'
    implementation 'com.google.android.gms:play-services-ads:20.2.0'
    implementation 'net.i2p.android.ext:floatingactionbutton:1.10.0'
    implementation 'com.makeramen:roundedimageview:2.2.1'
    implementation 'com.cleveroad:fan-layout-manager:1.0.4'
    implementation('com.afollestad.material-dialogs:core:0.9.0.2') { transitive = true }
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'com.github.mrengineer13:snackbar:1.2.0'
    implementation 'com.github.f0ris.sweetalert:library:1.5.6'
    implementation files('libs/slideme_inappsdk_v1.6_22Sept2015.jar')
    implementation 'com.sothree.slidinguppanel:library:3.3.1'
    implementation 'com.gjiazhe:MultiChoicesCircleButton:1.0'
    implementation files('libs/AndroidViewAnimations-1.1.3.jar')
    implementation 'io.github.kexanie.library:MathView:0.0.6'

    implementation 'com.android.volley:volley:1.2.0'
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    implementation 'io.github.inflationx:calligraphy3:3.1.1'
    implementation 'io.github.inflationx:viewpump:2.0.3'

// Enabling multidex support.
    implementation 'androidx.multidex:multidex:2.0.1

'
此外,我在清单中尝试了internet连接权限,但没有解决问题!如果有人能帮我度过难关,我将不胜感激。
舱单如下:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="***.***.***">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:replace="android:icon"
        android:usesCleartextTraffic="true">

        <activity
            android:name=".***.**.ActivityBrowser"
            android:label=""
            android:launchMode="singleTop"
            android:parentActivityName=".**.activities.ActivityHome"
            android:screenOrientation="portrait"
            android:exported="true">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="**.**.**.**.activities.ActivityHome" />
        </activity>
        <activity
            android:name=".***.***.ActivityArticlesByCategory"
            android:label=""
            android:launchMode="singleTop"
            android:parentActivityName=".***.activities.ActivityHome"
            android:screenOrientation="portrait"
            android:exported="true">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="***.***.***.***.activities.ActivityHome" />
        </activity>
        <activity
            android:name=".***.***.ActivityDetail"
            android:label=""
            android:launchMode="singleTop"
            android:parentActivityName=".***.***.ActivityHome"
            android:exported="true">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="***.***.***.***.activities.ActivityHome" />
        </activity>
        <activity
            android:name=".***.activities.ActivityComments"
            android:label="@string/comment"
            android:launchMode="singleTop"
            android:parentActivityName=".**.***.ActivityDetail"
            android:screenOrientation="portrait"
            android:exported="true">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="***.****.****.****.activities.ActivityDetail" />
        </activity>
        <activity
            android:name=".****.activities.ActivityHome"
            android:label=""
            android:launchMode="singleTop"
            android:screenOrientation="portrait"
            android:exported="true">
            <meta-data
                android:name="android.app.default_searchable"
                android:value=".activities.ActivitySearch" />
        </activity>
        <activity
            android:name=".***.***.ActivitySearch"
            android:label=""
            android:launchMode="singleTop"
            android:parentActivityName=".***.***.ActivityHome"
            android:screenOrientation="portrait"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
            </intent-filter>

            <!-- Parent activity meta-data to support 4.0 and lower -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="**.***.***.***.activities.ActivityHome" />
            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable" />
        </activity>
        <activity android:name=".splash"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".MainPage"
            android:exported="true"/>
        <activity
            android:name=".CatActivity"
            android:noHistory="true"
            android:exported="true"/>
        <activity android:name=".Blank_Activity"
            android:exported="true"/>
        <activity android:name=".***.MultiLanguage.LanguageActivity"
            android:exported="true"/>
        <activity android:name=".Settings"
            android:exported="true"/>
        <activity
            android:name=".Purchase_Activity"
            android:label="@string/title_activity_purchase_"
            android:parentActivityName=".MainPage"
            android:theme="@style/AppTheme"
            android:exported="true">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="**.***.***.MainPage" />
        </activity>
        <activity
            android:name=".***.**.***"
            android:label="@string/****"
            android:theme="@style/AppTheme"
            android:exported="true"
            />
    </application>

</manifest>
2w3rbyxf

2w3rbyxf1#

不,在这个世界上没有什么可做的 implementations . 尝试将此添加到您的 AndroidManifest.xml :

<uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

如果不起作用,请添加您的 AndroidManifest.xml 回答你的问题。可能是出了什么事。同时尝试在另一个版本中更新您的版本 gradle 文件夹名为 build.gradle(Project:) 遵循此文档并更新您的 XML 文件夹。可能是你的 XML 文件未迁移到 androidx ,只有你的 java 文件夹

相关问题