小编she*_*rin的帖子

Android Studio:Gradle 构建完成但出现错误

我一直在使用 Android Studio,但在尝试构建时出现此错误。我无法继续。

这是 Android Studio 中的错误:

    Executing tasks: [:libraries:facebook:generateDebugSources, :library:generateDebugSources, :volley:generateDebugSources]

    Configuration on demand is an incubating feature.
    WARNING [Project: :volley] "testPackageName" is deprecated (and will soon stop working); change to "testApplicationId" instead
    :libraries:facebook:preBuild
    :libraries:facebook:preDebugBuild
    :libraries:facebook:checkDebugManifest
    :libraries:facebook:prepareDebugDependencies
    :libraries:facebook:compileDebugAidl UP-TO-DATE
    :libraries:facebook:compileDebugRenderscript UP-TO-DATE
    :libraries:facebook:generateDebugBuildConfig UP-TO-DATE
    :libraries:facebook:generateDebugAssets UP-TO-DATE
    :libraries:facebook:mergeDebugAssets UP-TO-DATE
    :libraries:facebook:generateDebugResValues UP-TO-DATE
    :libraries:facebook:generateDebugResources UP-TO-DATE
    :libraries:facebook:packageDebugResources UP-TO-DATE
    :libraries:facebook:processDebugManifest UP-TO-DATE
    :libraries:facebook:processDebugResources UP-TO-DATE
    :libraries:facebook:generateDebugSources UP-TO-DATE
    :library:preBuild
    :library:preDebugBuild
    :library:checkDebugManifest
    :library:prepareDebugDependencies
    :library:compileDebugAidl UP-TO-DATE
    :library:compileDebugRenderscript UP-TO-DATE
    :library:generateDebugBuildConfig UP-TO-DATE
    :library:generateDebugAssets UP-TO-DATE
    :library:mergeDebugAssets UP-TO-DATE
    :library:generateDebugResValues UP-TO-DATE
    :library:generateDebugResources UP-TO-DATE
    :library:packageDebugResources UP-TO-DATE …
Run Code Online (Sandbox Code Playgroud)

android android-studio android-volley build.gradle android-gradle-plugin

5
推荐指数
1
解决办法
4万
查看次数

Android Studio 发布版本构建中的问题

当我构建一个调试 .apk 时,它工作正常,并且在清单文件中我已经授予了互联网权限。不幸的是,当我生成登录版本时,它不起作用。应用程序显示崩溃。当我调试得到改造时,没有得到响应,因此它将捕获并显示空指针异常。

已授予互联网权限 API 无法正常工作。

这是我的清单文件

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


<application
    android:name=".Controller"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher"
    android:supportsRtl="true"
    android:theme="@style/AppBaseTheme"
    android:usesCleartextTraffic="true">
   <activity
        android:name=".activites.SplashScreen"
        android:exported="true"
        android:theme="@style/Theme.AppCompat.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
Run Code Online (Sandbox Code Playgroud)

摇篮文件

 plugins {
    id 'com.android.application'
 }

android {
  compileSdk 31

defaultConfig {
    applicationId "com.motors"
    minSdk 21
    targetSdk 31
    versionCode 2
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile(
                'proguard-android-optimize.txt'),
                'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility …
Run Code Online (Sandbox Code Playgroud)

android

-1
推荐指数
1
解决办法
477
查看次数