我尝试集成SDK,之后所有其他从android.support.design导入的包都以红色突出显示。当我尝试在模拟器上运行应用程序时,出现以下错误:“错误:程序包android.support.design.widget不存在”
我试图重建项目,但是没有成功。我使缓存无效并重新启动,它无法解决我的问题。我正确地实现了SDK,如我的代码所示。
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//implementation fileTree(dir: 'libs', include: ['*.aar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0-alpha1'
implementation 'com.android.support:support-v4:28.0.0-alpha1'
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'
implementation 'com.android.support:recyclerview-v7:28.0-alpha1'
}
这是导入语句。
import android.os.Handler;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
找不到所有小部件(TextViews,Recyclerview,Buttons ...)(找不到符号)。