Comments (4)
Sorry, not connected to this lib
Check your class Map.java:95
from mapscaleview.
This is my gradle
`buildscript {
repositories {
jcenter()
}
dependencies {
if (rootProject.ext.has("gradle_classpath")) {
classpath rootProject.ext.gradle_classpath
} else {
logger.warn('classpath not found in rootProject')
classpath 'com.android.tools.build:gradle:2.3.2'
}
}
}
apply plugin: 'com.android.application'
android {
if (rootProject.ext.has("compileSdkVersion")) {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
} else {
logger.warn('compileSdkVersion not found in rootProject')
compileSdkVersion 24
buildToolsVersion "25.0.0"
}
defaultConfig {
applicationId "de.j4velin.mapsmeasure"
if (!project.file("key.properties").exists()) {
resValue "string", "maps_api_key", "0000"
}
}
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
zipAlignEnabled true
minifyEnabled true
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
debug {
signingConfig signingConfigs.release
zipAlignEnabled true
minifyEnabled false
shrinkResources false
debuggable true
}
}
if (System.getenv("TRAVIS")) {
lintOptions {
ignoreWarnings true
abortOnError false
}
}
}
dependencies {
compile 'com.android.support:support-v4:25.3.1'
compile 'com.google.android.gms:play-services-location:10.2.6'
compile 'com.google.android.gms:play-services-maps:10.2.6'
compile 'com.github.pengrad:mapscaleview:1.2.1'
}`
from mapscaleview.
Add repositories { jcenter() }
outside of buildscript
.
Or maybe you enabled offline mode in android studio.
Try ./gradlew
in terminal
from mapscaleview.
Thanks you,
solved by this:
allprojects {
repositories {
jcenter()
}
}
Next, I found this error.
When implementing the code:
05-19 19:47:50.286 15545-15545/com.barayuda.mapsmeasure E/AndroidRuntime: FATAL EXCEPTION: main Process: com.barayuda.mapsmeasure, PID: 15545 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.barayuda.mapsmeasure/com.barayuda.mapsmeasure.Map}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference at Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference at android.app.Activity.findViewById(Activity.java:2107) at com.barayuda.mapsmeasure.Map.<init>(Map.java:95)
and pointer refers to MapScaleView scaleView = (MapScaleView) findViewById(R.id.scaleView);
I have put this code to my layout:
<com.github.pengrad.mapscaleview.MapScaleView android:id="@+id/scaleView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="4dp"/>
from mapscaleview.
Related Issues (20)
- mapbox example HOT 1
- Needs a little bit of margin at top. HOT 4
- Another incorrect scaling? HOT 7
- Add centimeters HOT 3
- Update release POM file HOT 3
- OSM example? HOT 1
- Add tests
- Add API for using model without UI
- Dynamic width HOT 2
- Set font of ScaleView HOT 1
- Simple setup scaleView with GoolgeMap, MapboxMap, etc
- Mapbox example HOT 5
- Text can be hidden
- Outline color
- Add feature similar wikiloc HOT 1
- Add feature auto scale_color HOT 6
- deprecated code HOT 1
- add stroke color HOT 7
- Add feature to change scale bar expand direction HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapscaleview.