Android Studio 一個module引用另一個模塊module的方法

轉自Android Studio引用另一個模塊module的方法

app中有兩個module,其中一個需要引用另一個的jni庫,直接在app模塊中引用這個類 提示無法解析這個類

android中引用別的module 需要加入對它的依賴選擇了 直接修改build.gradle腳本引入的方式

修改build.gradle實現

app 模塊的 build.gradle:
  dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'com.android.support:appcompat-v7:26.1.0'
      implementation 'com.android.support.constraint:constraint-layout:1.0.2'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.1'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

      implementation project(':module') // 添加依賴模塊
  }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章