Yasic / ParticleTextView

一个用粒子动画显示文字的 Android 自定义 View
1.32k stars 197 forks source link

Issue importing #6

Open AndroidDeveloperLB opened 7 years ago

AndroidDeveloperLB commented 7 years ago

I get this:

No service of type Factory available in ProjectScopeServices. Open File

image

rayliverified commented 7 years ago

You don't have the appropriate plugins installed. Please use the following gradle code that works.

apply plugin: 'com.android.library'

version = "0.0.5"

ext {
    bintrayRepo = 'maven'
    bintrayName = 'ParticleTextView'

    publishedGroupId = 'com.yasic.library'
    libraryName = 'ParticleTextView'
    artifact = 'particleTextView'

    libraryDescription = ''

    siteUrl = 'https://github.com/Yasic/ParticleTextView'
    gitUrl = 'https://github.com/Yasic/ParticleTextView.git'

    libraryVersion = '0.0.4'

    developerId = 'yasic'
    developerName = 'yasic'
    developerEmail = 'yuxuan2580@gmail.com'

    licenseName = 'The Apache Software License, Version 2.0'
    licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
    allLicenses = ["Apache-2.0"]
}

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    resourcePrefix "yasic__"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'io.reactivex:rxandroid:1.1.0'
}

If you are planning on submitting a PR, do not commit this custom Build file. The author of this repo uses it to upload the library to Maven. Instead, take a look at what I have done with PR #4 and proceed that way. Hope this helps!

AndroidDeveloperLB commented 7 years ago

What exactly is missing that I need to download? Why the need to change gradle? Why not put it on the repo?

Also, after putting the above text in gradle file, I still have a build error:

Error:resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found Error:failed linking references Error:java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.AaptException: AAPT2 link failed: Error:com.android.builder.internal.aapt.AaptException: AAPT2 link failed: Error:Execution failed for task ':app:processDebugResources'.

Failed to execute aapt

image

rayliverified commented 7 years ago

Most of the code in the Gradle file is for uploading the library to Maven. The author needs that code as part of the library.

What version of Build tools are you using?

AndroidDeveloperLB commented 7 years ago

It says I have 26.0.0 rc2 , and many before.

rayliverified commented 7 years ago

Try 25.0.2 to see if that works. Also, make sure to change the build tools and SDK version in the sample app folder as well. If all else fails, try downloading my fork. It has quite a few enhancements!

Yasic commented 7 years ago

@searchy2 Hi. I am sorry that I was working on another project recently so that I didn't see the notification. I have merged your pr just now and I am reviewing the code.

Yasic commented 7 years ago

@AndroidDeveloperLB I have update the build.gradle file and I think it should be work now. Please try it again.

rayliverified commented 7 years ago

@Yasic Great library, thanks for the merge! There's still work to be done however. If the code looks good and passes your tests, it will need to be copied over to the Particle Surfaces class.

AndroidDeveloperLB commented 7 years ago

@Yasic I've cloned the project . Now it works, but the "Sureface View Demo" is quite slow, espeically when trying to exit it.

rayliverified commented 7 years ago

@Yasic I've cloned the project . Now it works, but the "Sureface View Demo" is quite slow, espeically when trying to exit it.

The improvements made to the Particle View have not been added to the Particle Surface yet. Currently, I am not too sure what the Particle Surface is for? Maybe @Yasic can explain the use scenarios.