在我的应用程序中,我用来DownloadManager从 Firebase 下载文件。
import static android.os.Environment.DIRECTORY_DOWNLOADS;
public class Physics extends AppCompatActivity {
PDFView pdfView;
FirebaseStorage firebaseStorage;
StorageReference storageReference;
StorageReference ref;
File file;
File files;
ProgressBar progressBar;
private Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
setContentView(R.layout.activity_physics1);
pdfView = findViewById(R.id.pdfview);
progressBar = (ProgressBar) findViewById(R.id.progressBar);
Context mContext = getApplicationContext();
String path = mContext.getFilesDir().getAbsolutePath() + "/storage/emulated/0/Android/data/com.impwala.impwala/files/Download/asd.nomedia";
File file = new File("/storage/emulated/0/Android/data/com.impwala.impwala/files/Download/asd.nomedia");
if (file.exists()) {
files = new File("/storage/emulated/0/Android/data/com.impwala.impwala/files/Download/asd.nomedia");
pdfView.fromFile(files).load();
} else {
if (haveNetwork()) {
download();
} else …Run Code Online (Sandbox Code Playgroud) 执行任务:[:app:assembleDebug]
任务 :app:preBuild UP-TO-DATE 任务 :app:preDebugBuild UP-TO-DATE 任务 :app:compileDebugAidl NO-SOURCE 任务 :app:checkDebugManifest UP-TO-DATE 任务 :app:compileDebugRenderscript NO-SOURCE 任务 :app: generateDebugBuildConfig UP-TO-DATE Task :app:prepareLintJar UP-TO-DATE Task :app:processDebugGoogleServices UP-TO-DATE Task :app:generateDebugSources UP-TO-DATE Task :app:javaPreCompileDebug UP-TO-DATE Task :app: mainApkListPersistenceDebug UP-TO-DATE Task :app:generateDebugResValues UP-TO-DATE Task :app:generateDebugResources UP-TO-DATE Task :app:createDebugCompatibleScreenManifests UP-TO-DATE Task :app:mergeDebugResources Task :app:processDebugManifest UP-TO-DATE日期任务 :app:processDebugResources 失败
FAILURE:构建失败,出现异常。
出了什么问题:任务 ':app:processDebugResources' 执行失败。
Android 资源链接失败 C:\Users\user\StudioProjects\IMPwala\app\src\main\res\layout\activity_main2.xml:23: AAPT: 错误: 属性 android:clipToOutline 未找到。
C:\Users\user\StudioProjects\IMPwala\app\src\main\res\layout\activity_main2.xml:87:AAPT:错误:未找到属性 layout_constrainttop_toTopOf(又名 com.example.impwala:layout_constrainttop_toTopOf)。
C:\Users\user\StudioProjects\IMPwala\app\src\main\res\layout\activity_main2.xml:87: AAPT: 错误: 属性 android:clipToOutline 未找到。
C:\Users\user\StudioProjects\IMPwala\app\src\main\res\layout\activity_main2.xml:150: AAPT: 错误: 属性 android:clipToOutline 未找到。
C:\Users\user\StudioProjects\IMPwala\app\src\main\res\layout\activity_main2.xml:212: …