question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

build successful ,but can't running

See original GitHub issue
C:\Users\pdog18\Desktop\android-architecture-components-master\BasicSample\app\src\main\java\com\example\android\persistence\db\AppDatabase.java

Error:(31, 17) 警告: Schema export directory is not provided to the annotation processor so we cannot export the schema. You can either provide `room.schemaLocation` annotation processor argument OR set exportSchema to false.

AppDatabase

/*
 * Copyright 2017, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.example.android.persistence.db;

import android.arch.persistence.room.Database;
import android.arch.persistence.room.RoomDatabase;
import android.arch.persistence.room.TypeConverters;

import com.example.android.persistence.db.dao.CommentDao;
import com.example.android.persistence.db.dao.ProductDao;
import com.example.android.persistence.db.entity.CommentEntity;
import com.example.android.persistence.db.entity.ProductEntity;
import com.example.android.persistence.db.converter.DateConverter;

@Database(entities = {ProductEntity.class, CommentEntity.class}, version = 1)
@TypeConverters(DateConverter.class)
public abstract class AppDatabase extends RoomDatabase {

    static final String DATABASE_NAME = "basic-sample-db";

    public abstract ProductDao productDao();

    public abstract CommentDao commentDao();
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

32reactions
wafer-licommented, May 21, 2017

Try to export the schema by adding this to your app/build.gradle

android {
    ...
    defaultConfig {
        ...
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation":
                             "$projectDir/schemas".toString()]
            }
        }
    }
}
4reactions
firekesticommented, Sep 20, 2017

This helped me: https://movieos.org/2017/android-room-data-binding-compile-time-errors/

I was seeing a max of 100 databinding errors, with no “real” error message. By expanding the number of messages that can be shown, check the last error and it will be a real Room compilation error! So, hopefully you can fix that error and get compilation working again 😃

allprojects {
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xmaxerrs" << "4000"
            options.compilerArgs << "-Xmaxwarns" << "4000"
        }
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

android project build successful,but can not run at virtual device
when i build my android project use Android Studio, it shows BUILD SUCCESSFUL, But when i run at my virtual Device , it...
Read more >
react-native run-android shows BUILD SUCCESSFUL but ...
I am opening my AVD and running the command react-native run-android , it seems to go right but exits the process and my...
Read more >
Why does Android Studio build successfully but doesn't run ...
Android studio is a very big software and consumes a large amount of your RAM. When you are working on AS(android studio) you...
Read more >
Fix error build successful but no output window - YouTube
Fixed error build successful but no out shown.How to fix the error program is successfully build but cant see the out...
Read more >
Android build successful but will not deploy on phone
I'm having a problem with the Build and Run functionality. I am able to successfully build an apk. When the entire process completes, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found