【问题标题】:Gradle Sync Failed: Xposed Module FrameworkGradle 同步失败:Xposed 模块框架
【发布时间】:2019-01-14 18:00:42
【问题描述】:

我想构建一个 Xposed 模块,但我没有通过 Gradle 构建。

AndroidManifest.xml

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

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

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

        <activity
            android:name=".Activities.SplashActivity"
            android:theme="@style/SplashTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".Activities.MainActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar"/>

        <!--Xposed Framework-->
        <meta-data
            android:name="xposedmodule"
            android:value="true" />
        <meta-data
            android:name="xposeddescription"
            android:value="Change IMEI"/>
        <meta-data
            android:name="xposedminversion"
            android:value="53" />
    </application>

</manifest>

app/build.gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.simple"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 29
        versionName "2.351"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "com.android.support:appcompat-v7:$support_version"
    implementation "com.android.support:customtabs:$support_version"
    implementation "com.android.support:animated-vector-drawable:$support_version"
    implementation "com.android.support:design:$support_version"
    implementation "com.android.support:cardview-v7:$support_version"
    implementation "com.android.support:support-v4:$support_version"
    implementation "com.android.support:recyclerview-v7:$support_version"
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

//xposed framework

    compileOnly 'de.robv.android.xposed:api:82'
    compileOnly 'de.robv.android.xposed:api:82:sources'
}

apply plugin: 'com.google.gms.google-services'

Gradle 同步错误消息:

无法解析 ':app@debug/compileClasspath' 的依赖关系:可以 不下载 api.jar (de.robv.android.xposed:api:82)

打开文件

显示详情

无法解析 ':app@release/compileClasspath' 的依赖关系: 无法下载 api.jar (de.robv.android.xposed:api:82)

打开文件

显示详情

我做错了什么?

【问题讨论】:

    标签: android android-gradle-plugin xposed xposed-framework


    【解决方案1】:

    我终于通过删除这些来让它工作:

    dependencies { 
       testImplementation 'junit:junit:4.12'
       androidTestImplementation 'com.android.support.test:runner:1.0.2'
       androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    
       //xposed framework
       compileOnly 'de.robv.android.xposed:api:82'
       compileOnly 'de.robv.android.xposed:api:82:sources'
    }
    

    来自我的依赖列表

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-16
      • 2016-12-29
      • 2015-06-10
      • 2016-05-18
      • 2016-02-05
      • 1970-01-01
      • 2023-04-09
      相关资源
      最近更新 更多