Android Studio cannot find the required classes after introducing aar.

implementation 'io.github.sinaweibosdk:core:13.6.1@aar'

 Then

import com.sina.weibo.sdk.openapi.IWBAPI;

I found that it was all there before, but IWBAPI was not visible.

Rename aar to zip, extract the classes.jar inside, and then

jar jt classes.jar

can be seen:

com/sina/weibo/sdk/openapi/IWBAPI.class

Explain that this class exists.

Method 1: At this time, click the "elephant" button of Android Studio, that is, Sync Project with Gradle Files, and use the shortcut key Ctrl + Shift + O.

Method 2: Copy aar to a folder, and then

implementation fileTree(dir: 'C:\\yourdir', include: ['*.aar', '*.jar'], exclude: [])

Then click the sync button

Guess you like

Origin blog.csdn.net/piggy514/article/details/133619678